hi everybody
i updated a multisite network locally and put the database and files back to live. everything works fine, but the events can not be edited anymore. if i click on edit this ugly thing shows up:
Fatal error: Uncaught exception 'Exception' with message 'Error in formating DateTime object. Expected DateTime, but instead given string' in /home/www/mywebsite.ch/wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php:31 Stack trace: #0 [internal function]: eo_format_datetime('2017-02-11 00:0...') #1 /home/www/mywebsite.ch/wp-content/plugins/event-organiser-pro/includes/register.php(387): array_map('eo_format_datet...', Array) #2 [internal function]: eventorganiser_pro_admin_enqueue_scripts('post.php') #3 /home/www/mywebsite.ch/wp-includes/class-wp-hook.php(298): call_user_func_array('eventorganiser_...', Array) #4 /home/www/mywebsite.ch/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #5 /home/www/mywebsite.ch/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #6 /home/www/mywebsite.ch/wp-admin/admin-header.php(97): do_action('admin_enqueue_s...', 'post.php') #7 /home/www/mywebsite.ch/ in /home/www/mywebsite.ch/wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php on line 31
any hint or help is greatly appreciated!
thanks
urs
Urs Mettler
Hi Urs,
What versions of Pro and Event Organiser are you using?
Stephen Harris
hi stephen
Version 3.1.7 and Version 1.9.6
Urs Mettler
That version of Pro is not compatible with 3.1.7. You’ll need to update to 1.11.1+ (1.11.8 is the current stable version).
Alternative you can revert Event Organiser back to version 2.13.7.
As a third alternative, you can use the following code to fix the issue:
add_filter( 'eventorganiser_get_event_schedule', function( $schedule, $event_id ) {
if ( ! empty( $schedule['_occurrences']) ) {
$schedule['_occurrences'] = eo_get_the_occurrences( $event_id );
}
return $schedule;
}, 10, 2 );
That can go in a site utility plug-in, but it will also work in your theme’s functions.php. This solution is not ideal as may impact performance of the site.
Stephen Harris
that was just an amazing peace of support! thank you very much!
all the best to you, kind regards
urs
Urs Mettler