Support

Home Forums Event Espresso Premium EE Critical Error

EE Critical Error

Posted: October 4, 2020 at 5:33 pm


KGM_Adm

October 4, 2020 at 5:33 pm

Getting this critical error on my event page, not sure why:
https://pastebin.com/pbbpnJZW

Here is the code it’s referring to in content-espresso_events-shortcode.php
https://pastebin.com/SeC24NUm

Thanks in advance!


Tony

  • Support Staff

October 5, 2020 at 3:26 am

Hi there,

It means your $event variable doesn’t have an EE_Event and is null.

You’ll need to troubleshoot and see what the $post variable is on that loop to track down what is going on.

To prevent the error you can wrap lines 58 and 59 in something like:

if ( $event instanceof EE_Event ) {

}

Then see what ‘event’ has a missing description and work from there.


KGM_Adm

October 8, 2020 at 5:43 pm

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 [ESPRESSO_EVENTS] shortcode and it doesn’t seem to be updating?

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?


Tony

  • Support Staff

October 9, 2020 at 3:32 am

Strange, I’ve put the if statement in on 58 and 59. All my events have descriptions.

Then just after the above if statement, add something like this:

if ( ! $event instanceof EE_Event ) {
    var_dump($post);
}

Will output all kinds of details for $post when $event is not an EE_Event, then you’ll know which post object is causing the above and you can go from there.

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?

Do expired events show on your default /events/ output?

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?


KGM_Adm

October 12, 2020 at 2:15 pm

then you’ll know which post object is causing the above and you can go from there.

They are displaying similar info, how will I know which is causing the error?

Do expired events show on your default /events/ output?

Yes they do

do you have the ‘Display Expired Events’ option set to Yes?

No, it is set to “No”


Tony

  • Support Staff

October 13, 2020 at 2:29 am

They are displaying similar info, how will I know which is causing the error?

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.

Yes they do
No, it is set to “No”

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?


KGM_Adm

October 18, 2020 at 8:20 pm

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.

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.

Which page do you have the shortcode on so I can take a look?

https://kidsgreatminds.org/courses

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?

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.


Tony

  • Support Staff

October 20, 2020 at 6:04 am

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.

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 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.

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.

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: publish

Updated by  Tony 6 days, 13 hours ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!
[gravityform id=80 title=false description=false ajax=false]
<div class='gf_browser_unknown gform_wrapper' id='gform_wrapper_80' ><form method='post' enctype='multipart/form-data' id='gform_80' action='/topic/ee-critical-error/'> <div class='gform_body'><ul id='gform_fields_80' class='gform_fields top_label form_sublabel_below description_below'><li id='field_80_1' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_1' >First name<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_text'><input name='input_1' id='input_80_1' type='text' value='' class='medium' aria-required="true" aria-invalid="false" /></div></li><li id='field_80_2' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_2' >Email address<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_email'> <input name='input_2' id='input_80_2' type='email' value='' class='medium' aria-required="true" aria-invalid="false" /> </div></li><li id='field_80_3' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' >GDPR Agreement<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_checkbox'><ul class='gfield_checkbox' id='input_80_3'><li class='gchoice_80_3_1'> <input name='input_3.1' type='checkbox' value='I consent to have this website store my submitted information so they can respond to my inquiry.' id='choice_80_3_1' /> <label for='choice_80_3_1' id='label_80_3_1'>I consent to have this website store my submitted information so they can respond to my inquiry.</label> </li></ul></div></li><li id='field_80_4' class='gfield gform_validation_container field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_4' >Comments</label><div class='ginput_container'><input name='input_4' id='input_80_4' type='text' value='' autocomplete='off'/></div><div class='gfield_description' id='gfield_description_80_4'>This field is for validation purposes and should be left unchanged.</div></li> </ul></div> <div class='gform_footer top_label'> <input type='submit' id='gform_submit_button_80' class='gform_button button' value='Download Now' onclick='if(window["gf_submitting_80"]){return false;} if( !jQuery("#gform_80")[0].checkValidity || jQuery("#gform_80")[0].checkValidity()){window["gf_submitting_80"]=true;} ' onkeypress='if( event.keyCode == 13 ){ if(window["gf_submitting_80"]){return false;} if( !jQuery("#gform_80")[0].checkValidity || jQuery("#gform_80")[0].checkValidity()){window["gf_submitting_80"]=true;} jQuery("#gform_80").trigger("submit",[true]); }' /> <input type='hidden' class='gform_hidden' name='is_submit_80' value='1' /> <input type='hidden' class='gform_hidden' name='gform_submit' value='80' /> <input type='hidden' class='gform_hidden' name='gform_unique_id' value='' /> <input type='hidden' class='gform_hidden' name='state_80' value='WyJbXSIsIjBiNjdjZjkyMDUzOWUxOWY5Y2NiZjIwMzM4YjA1Mjk4Il0=' /> <input type='hidden' class='gform_hidden' name='gform_target_page_number_80' id='gform_target_page_number_80' value='0' /> <input type='hidden' class='gform_hidden' name='gform_source_page_number_80' id='gform_source_page_number_80' value='1' /> <input type='hidden' name='gform_field_values' value='' /> </div> </form> </div><script type='text/javascript'> jQuery(document).bind('gform_post_render', function(event, formId, currentPage){if(formId == 80) {} } );jQuery(document).bind('gform_post_conditional_logic', function(event, formId, fields, isInit){} );</script><script type='text/javascript'> jQuery(document).ready(function(){jQuery(document).trigger('gform_post_render', [80, 1]) } ); </script>
[i]
[i]