The plugin is using Select2 version 3.2 (outdated) and calls deprecated methods

Home Forums September 2013 Filters Bar Beta The plugin is using Select2 version 3.2 (outdated) and calls deprecated methods

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #66587
    Thomas Dexter
    Guest

    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

    #66591
    Thomas Dexter
    Guest

    Note: 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.

    #66877
    Kyle
    Participant

    Hi 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,
    Kyle

    #67810
    Thomas Dexter
    Guest

    Hi 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,
    Thomas

    #67891
    Kyle
    Participant

    Hi 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,
    Kyle

    #67973
    Thomas Dexter
    Guest

    Hi 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,
    Thomas

    #981056
    Support Droid
    Keymaster

    This 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.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘The plugin is using Select2 version 3.2 (outdated) and calls deprecated methods’ is closed to new replies.