Home › Forums › September 2013 Filters Bar Beta › The plugin is using Select2 version 3.2 (outdated) and calls deprecated methods
- This topic has 6 replies, 2 voices, and was last updated 8 years, 9 months ago by Support Droid.
-
AuthorPosts
-
September 18, 2013 at 6:54 am #66587Thomas DexterGuest
My theme requires Select2 version 3.4.1.
The plugin is using Select2 3.2 (outdated) and is calling the ‘.disable()’ method the version dependency should be increased to 3.4.x and disable should be changed to ‘.enable(false)’.
This (or potentially something else) also causes the Select2 textbox to show ‘undefined’ and not hide the original dropdown as you can seen in the screencast: https://dl.dropboxusercontent.com/u/13675289/tribe-filters-select2-wrong-version.mov
September 18, 2013 at 7:01 am #66591Thomas DexterGuestNote: this completely breaks filtering as the calendar never updates after selecting something from the drop down and all filters become disabled until a page refresh.
September 19, 2013 at 3:07 pm #66877KyleParticipantHi again, Thomas!
Are you running verion 3.0.3 of TEC and 3.0.5 of TEC Pro? Select2 was compeltely removed from the front end as of 3.0.3. Is select2 being called on select items elsewhere such as in the theme itself or another plugin?
Cheers,
KyleSeptember 26, 2013 at 6:47 am #67810Thomas DexterGuestHi Kyle:
I’m running TEC 3.0.3 (free edition – not pro) downloaded from the wordpress plugin directory. It was my theme calling ‘.select2()’ on all select elements instead of a class. However, the plugin still includes select2 in ‘/vender/select2.js’ and it still calls ‘.disable’ in ‘/resources/tribe-events.js’ on line 250:
disable_inputs: function (parent, type) {
$(parent).find(type).prop('disabled', true);
if ($(parent).find('.select2-container').length) {
$(parent).find('.select2-container').each(function () {
var s2_id = $(this).attr('id');
var $this = $('#' + s2_id);
$this.select2("disable");
});
}
},As well as ‘.enable’ on 285 (opposite to above). Those two should be changed to the newer ‘.enable(true)’ or ‘.enable(false)’. I’d like to add select2 functionality back in for the tags filter but would need the TEC plugin to be making the appropriate calls for version 3.4.x in order to do so.
Also on the admin side it still calling ‘.select2()’ in ‘/resources/events-admin.js’ on line 5:
$('.select2, .tribe-field-dropdown_select2 select').select2({width: '250px'});
Thanks,
ThomasSeptember 26, 2013 at 3:51 pm #67891KyleParticipantHi Thomas,
While running TEC 3.0.3 without pro, I can’t get the plugin’s copy of select2 to load on the front end, even when I call .select2() in my theme, though you are right we still use it a couple places in the admin.
If our copy of select2 is getting loaded on the front end, try dequeuing ‘tribe-events-select2’ in your theme’s functions file.
As far as the select2 functions that still exist in our plugin, i’m going to leave a note for our resident JS guy to weight on this.
Cheers,
KyleSeptember 27, 2013 at 6:49 am #67973Thomas DexterGuestHi Kyle:
Your version 3.2 of Select2 is not loading on the front end. Only my themes version 3.4.1.
I couldn’t find the changelog that introduces the new methods but it looks like the started in 3.4.0 so hopefully your JS guy can include an “if select2 version > 3.4” then use the new method. https://github.com/ivaynberg/select2/issues/1329
Thanks,
ThomasJuly 7, 2015 at 6:28 am #981056Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘The plugin is using Select2 version 3.2 (outdated) and calls deprecated methods’ is closed to new replies.