We are getting fatal errors after updating plugin. This is dire as we have live events. Example snippet – Fatal error: Uncaught TypeError: Return value of EE_Attendee::get_most_recent_registration_for_event() must be an instance of EE_Registration, null returned in
public function get_most_recent_registration_for_event(int $event_id): EE_Registration
Change it to be:
public function get_most_recent_registration_for_event(int $event_id): ?EE_Registration
The ? before the return type allows for it to be null.
Generally, we don’t recommend editing core files at all. However, we will likely include a fix for this in the next update so on this occasion it should be fine.
That custom function checks for a previous registration on the event loaded and displays a message stating the user has previously registered onto the event if it finds one.
The problem is the get_most_recent_registration_for_event() method has been set up to always return an EE_Registration, but that’s not the case, if the attended doesn’t have a registration on the event it wont return an EE_Registration.
So this line $registration = $contact->get_most_recent_registration_for_event($post->ID);
Is showing the problem, but it’s not actually the root cause, the fix I gave you above should fix it so you can keep using the above code and we’ll include that fix in an update.
Viewing 3 reply threads
The support post ‘Update is causing critical errors and now our live events won't display’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.