• keenangherkinmedia

    (@keenangherkinmedia)


    Hi Events Manager Team,

    We’re experiencing an issue after updating to Events Manager 7.3.7.4. Issue

    When updating an existing published event, the event is automatically changed back to Draft. Investigation

    We traced the issue to the following validation in EM_Event::validate_meta():

    if ( !$this->get_timeranges()->validate() ) {    $this->add_error( $this->get_timeranges()->errors );}

    The validation error returned is:

    Timeranges cannot overlap with each other.

    However, the event editor only displays a single all-day timerange (12:00 AM – 11:59 PM).

    We dumped the EM\Event\Timeranges object during validation and found that it contains two identical all-day timeranges for the same event, which appears to be why the validation fails.

    Both timeranges have:

    • timerange_group_id: event_1577
    • timerange_start: 00:00:00
    • timerange_end: 23:59:59
    • timerange_all_day: 1

    Since validate_meta() returns false, wp_insert_post_data() sets the post status to Draft. Questions

    • Is this a known issue in 7.3.7.4?
    • Has the timerange validation changed recently?
    • Are there any known cases where duplicate timeranges are created or loaded during validation?
    • Is there a recommended fix or patch?

    We’re happy to provide additional debugging information if needed.

    Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Could you tell me the steps needed to reproduce this problem. Are you using Gutenberg mode. Does this happen if you create a new event and publish it and then edit that event and click on Update?

    Thread Starter keenangherkinmedia

    (@keenangherkinmedia)

    We are using Elementor. To replicate just edit the event, in my test any text edit and then hit update. When you refresh the event is drafted automatically.

    In my case, I thought for a long time that it was an issue with ACF, which I use to collect additional info on events. I noticed that often, though not always, if I edit a field on a published event, the event would revert to draft. But it didn’t happen with every field.

    But looking at the OP’s post, I’m now wondering if this was because it only happens on events that I’ve marked as all-day events and I just never made the connection.

    I added Elementor and created a new event and marked it as an all day event and published the event. Then I went back and edited the event but I didn’t see the error “Timeranges cannot overlap with each other” and it didn’t revert back to Draft. I didn’t click on “Add Time Slot” so there was only one time slot.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.