stephenharris / Event-Organiser

WordPress plug-in, Event Organiser, development repository
http://wordpress.org/extend/plugins/event-organiser/
GNU General Public License v3.0
100 stars 76 forks source link

EO's time picker breaks ACF's when editing events #495

Open LazyDevStudio opened 3 years ago

LazyDevStudio commented 3 years ago

Both Event Organiser and ACF pro use the same time picker script but load their own different versions. On the event edit screen EO's time picker works, while ACF's does nothing on click. Page throws JS errors on load showing the timepickers conflict. JQuery Migrate Helper solves this for the time being but as I understand, this won't be possible in WP 5.7 anymore.

stephenharris commented 3 years ago

Hi @krays what are the errors you are seeing? If its a naming conflict I'm not sure how jQuery migrate would resolve that.

rossberenson commented 3 years ago

Hi, I'm also encountering this issue. I was about to report a bug but saw this ticket. This conflict appears the same way for me as it does for @krays. On the event post, I have ACF fields and two of them happen to be Time Picker fields.

Here is the error that I get:

jquery.js?ver=3.5.1:4055 Uncaught TypeError: Cannot read property 'msie' of undefined at Timepicker._generateHTML (time-picker.js?ver=3.10.4:614) at Timepicker._updateTimepicker (time-picker.js?ver=3.10.4:424) at Timepicker._setTimeFromField (time-picker.js?ver=3.10.4:1041) at Timepicker._attachTimepicker (time-picker.js?ver=3.10.4:157) at HTMLInputElement.<anonymous> (time-picker.js?ver=3.10.4:1371) at Function.each (jquery.js?ver=3.5.1:381) at jQuery.fn.init.each (jquery.js?ver=3.5.1:203) at jQuery.fn.init.$.fn.timepicker (time-picker.js?ver=3.10.4:1367) at Object.acf.newTimePicker (acf-input.js?ver=5.9.4:4427) at Child.initialize (acf-input.js?ver=5.9.4:4405)

Hovering over time-picker.js it shows the location: /wp-content/plugins/event-organiser/js/time-picker.js?ver=3.10.4

I also get several jquery-migrate warnings that are related to the same time-picker.js file.

rossberenson commented 3 years ago

@stephenharris - Sorry to nudge. Any guidance at all would be appreciated. Just curious if you have an idea about this or a bandaid fix I could do? I've been poking around the plugin but I'm a bit lost. I have a few sites encountering this issue. Thanks!

LazyDevStudio commented 3 years ago

@rossberenson : Try commenting out "eo-time-picker" on line 170 in event-organiser-register.php (where it says "deprecated version" ;-) ). This is an ancient time-picker version that gets loaded instead of the newer one also included in EO. It worked for me :-)

rossberenson commented 3 years ago

@krays - THANK YOU! That worked! Hopefully, this will be updated in v3.0. I never like to edit plugins.

LazyDevStudio commented 3 years ago

You're welcome :-) . This being v3.10.5 I wouldn't hold my breath. You can also deregister the script from your theme or plugin

rossberenson commented 3 years ago

v3 isn't over yet! v3.10.6 🤞🏻 I thought of deregistering and then re-registering it sans the dependency. We'll see...

rossberenson commented 2 years ago

@stephenharris - Any possible, official fix for this?