Posted: December 23, 2024 at 9:56 am
We are having an almost identical issue to this – https://eventespresso.com/topic/error-updating-event-when-adding-a-venue/ It’s hard for me to say since some of the messages in the thread are private. But we are able to create an event using our template “Class/Events Pages Page Template (single-espresso_events.php)” but we cannot edit the venue for any already created Events. |
|
Hi there, Apologies for the delay from the holidays. We’ll need to dig into this a little to find out what is happening. I assume your setting the venue on the event itself and not the datetime? https://monosnap.com/file/xMEpVwL87E2a9yff83ShCN8Er3oWPt When doing this, if you open up Dev Tools within your browser and sit on the Network tab, you’ll see a ‘graphql’ request: https://monosnap.com/file/0EwGYhJ6qk1n3wOM89CEgU16zdkNeM Can you post the response tab from that here? |
|
Hey Tony, no problem at all! To your first question, yes we are just trying to change the Venue for an existing event. So the Venue is already set, and when we try to change the venue we get the error. To your second question, please see below: [ |
|
Yeah, that’s odd! So, the error “Invalid page template.” is from WordPress itself, within So the page template is set, but not considered valid. I’ve managed to reproduce this locally and it’s caused by Combine that with wpgraphql (which is what we use in the background to update) setting wp_update_post()to return any errors thrown and you get the above (wp_update_post just calls wp_insert_post with some additional params set) . On a standard update, wp_update_post is set not to return errors and just carries on, then something else must be setting the page template separately (I haven’t dug further into that but will), the params passed to both are the same with the exception of wp_error being false and its true within wpgraphql. — So, in short, it’s from having a custom page template set for a custom post type, which WP then doesn’t load when checking for the page template, and wpgraphql sets the update method to return errors. I tested setting wpgraphql to not return errors but then WP sets the page template to ‘Default’ because it couldn’t find a page template for the post type! So… I have a workaround which whilst isn’t great, will get your Venue updated. First, set the page template on the event to default and update the event. When the page reloads, set the venue to the correct venue, the WPGraphQL request should then work as expected and show the venue updated. Now set the page template back to whichever template you were using before and update the event as normal. I’ve created a ticket for our developers to investigate this further and see what we can do to prevent this. |
|
Thanks Tony! |
|
You must be logged in to reply to this support post. Sign In or Register for an Account