You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an event is saved with a new venue, the venue details are $_POSTed, but not ID is given. Event Organiser's callback recognises a venue (but no ID) is given so creates a venue.
However, if that callback is called again on the request (e.g. third party code calls wp_update_post()), since there is still no venue ID it attempts to create the venue (again). This fails because it's a duplicated venue. Consequently the callback sets the venue ID to null, and the venue-event link is lost.
Instead, if when creating a venue a term_exists error is encountered, we should retrieve the existing venue ID.
The text was updated successfully, but these errors were encountered:
This was originally reported here: http://wp-event-organiser.com/forums/topic/custom-save-post-interferers-with-venue-saving/#post-11631.
When an event is saved with a new venue, the venue details are
$_POST
ed, but not ID is given. Event Organiser's callback recognises a venue (but no ID) is given so creates a venue.However, if that callback is called again on the request (e.g. third party code calls
wp_update_post()
), since there is still no venue ID it attempts to create the venue (again). This fails because it's a duplicated venue. Consequently the callback sets the venue ID tonull
, and the venue-event link is lost.Instead, if when creating a venue a
term_exists
error is encountered, we should retrieve the existing venue ID.The text was updated successfully, but these errors were encountered: