• Resolved criself

    (@criself)


    I’m using tribe_update_event() to update an event’s URL and after calling it, any associated venues or organizers are lost on the event (though the URL is updated). It appears that since the array of meta fields that I pass in do not include the organizer or venue, they are removed from the event. When I delved into this, it appears that Linked_Posts::instance()->handle_submission is causing the problem, since within its child methods it discovers my meta array doesn’t include organizers or venues and then clears those linked posts out on the event I’m trying to update.

    This is how I call tribe_update_event(). FWIW I think my issue began with the 4.2.x series of TEC; it was working fine with 4.1.x :

    $record = array (
    'EventURL' => array (
    get_the_permalink ( $post->ID )
    )
    );
    $rc = tribe_update_event ( $eventId, $record);

    https://wordpress.org/plugins/the-events-calendar/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Oh, interesting!

    We actually have a similar issue in our system that we plan to hit in our next maintenance release (4.2.4), though it seems to be related to another one of our plugins. I will note this thread in the ticket to see if this indicates it’s a bigger issue that we can wipe out in the same ticket.

    Thanks!
    Geoff

    Thread Starter criself

    (@criself)

    Cool. Hope it makes it to the maintenance release and the maintenance release is soon. The workaround of fixing the event to add back the venue and organizer has been a bit cumbersome (though at least now I know when to expect it will happen!)

    Me too! I made the note in our system and we’ll do our best to follow-up. In the meantime, keep your eyes open for 4.2.4 in the next couple of weeks — you can also watch our blog for what that is released:

    https://theeventscalendar.com/blog/

    Cheers!
    Geoff

    Thread Starter criself

    (@criself)

    Since 4.2.4 didn’t fix the problem, I added a workaround. I don’t consider this a fix, because I don’t think updating an event without attaching the linked venues or organizations should be considered an update to the event to remove the venues or organizations. Basically I’m fetching the venue and organizer and passing them in again on the update to re-add the linked posts. Now my venue and organizers don’t disappear. Hopefully this will be useful to someone.

    $venue = tribe_get_venue_id($eventId);
    $organizers = tribe_get_organizer_ids($eventId);
    $record = array (
    		'EventURL' => array (get_the_permalink ( $post->ID ),
    				),
    		'Venue' => array ('VenueID' => array($venue)
    				),
    		'Organizer' => array('OrganizerID' => $organizers
    				)
    		);
    $rc = tribe_update_event ( $eventId, $record );

    Plugin Author Andras Guseo

    (@aguseo)

    Hi criself,

    Thanks for posting this, very helpful.

    We will look into this issue again to check what could be the problem.

    Cheers

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘tribe_update_event removes venue and organizer associations’ is closed to new replies.