Posted: October 4, 2020 at 5:33 pm
Getting this critical error on my event page, not sure why: Here is the code it’s referring to in Thanks in advance! |
|
Hi there, It means your You’ll need to troubleshoot and see what the To prevent the error you can wrap lines 58 and 59 in something like:
Then see what ‘event’ has a missing description and work from there. |
|
Strange, I’ve put the if statement in on 58 and 59. All my events have descriptions. The part I find strange is that Im calling events through the What I mean by updating is that all my events have expired but they are still showing up through the short code, why is this happening? |
|
Then just after the above if statement, add something like this:
Will output all kinds of details for
Do expired events show on your default Or whatever you are using for the events slug in Event Espresso -> Events -> Templates -> Event List Pages -> Event Slug. On the same setting page above, do you have the ‘Display Expired Events’ option set to Yes? |
|
They are displaying similar info, how will I know which is causing the error?
Yes they do
No, it is set to “No” |
|
If you added the code I gave you above to use var_dump() on the $post object when $event was not an EE_Event object it will give you all kinds of details for the specific $post object that is throwing the error.
Then you may have some additional code on your site that is changing the event query, where that is I have no idea. Have you added any custom snippets to your site? If so work through those and comment them out to see if they make a difference. Which page do you have the shortcode on so I can take a look? |
|
So I added it but there was a lot of info shown, what should I be looking out for exactly? It all looks similar, nothing that stood out.
https://kidsgreatminds.org/courses
I am using FacetWP to filter the events which may be conflicting with the expired events? It was working fine right before the events expired so I am not too sure about the problem. |
|
The var_dump output will only happen for a post that isn’t returning an EE_Event for $event, so find out which specific event posts that is (check the ID) then compare that event with a working event and see what the difference is.
I don’t use FacetWP so I’m not sure, if you’d like to send a copy over I’ll install it on a test site and see if anything stands out. I’m guessing its just pulling the events based on the event posts so then FaceWP doesn’t know about expired datetimes etc but I’m simply guessing right now. |
|
Well all my posts seem to be returning the var_dump… Here is a link to FacetWP I believe it can differentiate between expired and active events as we have over 1000 events but it knew to only show the active ones at time of setup. |
|
Repost/update the content of your template file to Pastebin and link it here, please.
Requested access. |
|
Granted, click the link again.
|
|
Ok, so what do I need in FaceWP to reproduce what you are doing? I checked the code on a test site and it’s working as expected, no var_dump() is displayed when |
|
In FacetWP I have 5 facets: https://imgur.com/a/AD8uGsv Each facet is set up like this: https://imgur.com/a/RWkvvDt Afterwards, you need to click reindex. Then I have a page set up with the facet shortcodes at the top and the event espresso shortcode under it. |
|
My apologies, I missed this reply and the forum automatically closes threads with no activity. When looking at your new thread it reminded me of this post. To fix this you need to change line 26 from this:
To this:
Which will force the function to return an EE_Event for the ID specified if one exists. |
|
The support post ‘EE Critical Error’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.