Home › Forums › Ticket Products › Event Tickets Plus › Error with select2
- This topic has 5 replies, 3 voices, and was last updated 5 years, 9 months ago by Mohammad Zubair.
-
AuthorPosts
-
July 11, 2018 at 8:11 am #1572676Mohammad ZubairParticipant
Hi,
There is a conflict between WooCommerce Memberships and Event Tickets from Tribe. I hired a dev to look at it, and this was his solution:
Unfortunately there is no way I can do it without the file edit. Normally I could dequeue the file but because of the convoluted way Event TIckets is enqueing the file this is impossible. All this means is that when you update the event tickets plugin you update and then check for this error, if it has the error you open event-tickets/common/src/Tribe/Main.php and search for trible-select2 – comment out this line
array( ‘tribe-select2’, ‘vendor/tribe-select2/select2.js’, array( ‘jquery’ ) ),
Making it
//array( ‘tribe-select2’, ‘vendor/tribe-select2/select2.js’, array( ‘jquery’ ) ),
And that will reapply the fix. Currently it is line 176 of that file.
Will Tribe fix this in an update? So we don’t have to change the file every update.
Thanks!
July 12, 2018 at 10:35 am #1573880MarioParticipantI applied the same hack and it works (temporary, waiting for TEC fix)….
July 12, 2018 at 10:47 am #1573897SkyKeymasterHi there,
I’m sorry to hear that you’re having problems with this. I will try to help get this sorted.
This problem happens due to our plugins using a different version of the Select2 library than what other plugins are using.
To solve this problem, please try adding the following code snippet to your child theme’s functions.php file, or a functionality plugin.
// Disable tribe select2 function when not in tribe admin screens
function tribe_select2_conflict_fix() {
$admin_helpers = Tribe__Admin__Helpers::instance();
if ( ! $admin_helpers->is_screen() ) {
wp_deregister_script( 'tribe-select2' );
}
}
add_action( 'admin_enqueue_scripts', 'tribe_select2_conflict_fix', 11);
You should remove any other customizations you did to the core plugin files.
Let me know if that works for you!
Thanks,
SkyJuly 13, 2018 at 3:32 am #1574480Mohammad ZubairParticipantIt seems like it is fixed now by an update of The Events Calendar PRO, specific for this WooCommerce Membership & Events Calendar problem. So this fix is not needed anymore?
July 13, 2018 at 6:14 am #1574562MarioParticipantI tested the new version of The Event Calendar Pro and it fixes the issue. No any other hack is needed (including the custom code on this thread).
Problem is solved.
July 13, 2018 at 9:34 am #1574711SkyKeymasterHi again,
It looks like there was a fix pushed out in an update of TEC Pro yesterday that has addressed this specific issue.
You will no longer need the snippet provided earlier.
Thanks,
Sky -
AuthorPosts
- The topic ‘Error with select2’ is closed to new replies.