• Hi,
    I’m running at Multisite, and is trying to duplicate events by using either Multisite Post Duplicator or the ThreeWP Broadcast plugin, but I get the following error:

    Fatal error: Uncaught Exception: Error in formating DateTime object. Expected DateTime, but instead given boolean in /wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php:31 Stack trace: #0 /wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php(164): eo_format_datetime(false, ‘j. F Y G:i’) #1 /wp-content/plugins/event-organiser/templates/event-meta-event-single.php(53): eo_format_event_occurrence() #2 /wp-includes/template.php(686): require(‘/var/www/themename….’) #3 /wp-content/plugins/event-organiser/includes/event-organiser-templates.php(96): load_template(‘/var/www/themename….’, false) #4 /wp-content/plugins/event-organiser/includes/event-organiser-templates.php(41): eo_locate_template(Array, true, false) #5 /wp-content/themes/themename/single-event.php(33) in /wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php on line 31

    Can you help me?
    Thank you in advance!

    • This topic was modified 7 years, 10 months ago by krkjee.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Stephen Harris

    (@stephenharris)

    Most likely, it’s duplicating the post and not event data from the eo_events table.

    It’s probably copying the meta data though. So you, running eo_update_event( $duplicated_event_id ); should fix the issue. You can manually check this by updating a duplicate event. Longer term you’ll want to run that code on an appropriate hook so that whenever you duplicate an event, the duplicate event is updated using eo_update_event( ... );

    Thread Starter krkjee

    (@krkjee)

    Hi Stephen,
    Where do I place the: eo_update_event( $duplicated_event_id ); ?

    Plugin Author Stephen Harris

    (@stephenharris)

    Well hopefully one of those plug-ins has a hook for when an event is duplicated (you may have to check the post_type). You would then use that hook to call that function with the ID of the duplicated event.

    I can’t offer any specifics unfortunately as I’m not familiar with either of those plug-ins.

    The final code is probably best in its own custom plug-in, but could work in functions.php.

    If you’re not familiar with PHP and WordPress’ hooks, though I’m afraid this advice isn’t going to be much use to you. If you contact the developers behind those plug-ins, they may be able to provide you with an example of how to do this though.

    Thread Starter krkjee

    (@krkjee)

    Thank you Stephen, I’ll look into that.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fatal error: Uncaught Exception’ is closed to new replies.