Posted: September 14, 2023 at 1:32 pm
I’m not sure what details to post, but since EE was upgraded to version 5, the app no longer loads.
I can tell you the app is called JazzYYC and it feeds from JazzYYC.com
Let me know what other info you need and i’ll provide it.
For more context, I am getting an error here:
with debug on, i am getting this:
Fatal error: Uncaught TypeError: Argument 1 passed to EE_Event::pretty_active_status() must be of the type bool, null given, called in /home/customer/www/jazzyyc.com/public_html/newsite/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_Event_View.helper.php on line 110 and defined in /home/customer/www/jazzyyc.com/public_html/newsite/wp-content/plugins/event-espresso-core-reg/core/db_classes/EE_Event.class.php:1243 Stack trace: #0 /home/customer/www/jazzyyc.com/public_html/newsite/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_Event_View.helper.php(110): EE_Event->pretty_active_status(NULL) #1 /home/customer/www/jazzyyc.com/public_html/newsite/wp-content/themes/jazzyyc/resources/functions.php(104): EEH_Event_View::event_active_status(26841, NULL) #2 /home/customer/www/jazzyyc.com/public_html/newsite/wp-includes/rest-api/class-wp-rest-server.php(1188): eventContent(Object(WP_REST_Request)) #3 /home/customer/www/jazzyyc.com/public_html/newsite/wp-includes/rest-api/class-wp-rest-server.php(1035): WP_RE in /home/customer/www/jazzyyc.com/public_html/newsite/wp-content/plugins/event-espresso-core-reg/core/db_classes/EE_Event.class.php on line 1243
hopefully someone can review this? I posted some private replies with existing code
We don’t provide support for custom code so I need to clarify that the above is not something we provide support for, reviewing custom code to fix bugs within that code would also not be covered under general support.
To get your app working you need to start by first fixing this request:
Notice how when you load that page its throwing a critical error, that’s what you need to start with.
You mentioned you fixed the above, but your code still isn’t correct.
Is happening because your code is running:
When $echo hasn’t been defined, so its passing
Anywhere you have this:
Change it to be:
If your code is still the same from above then fixing both instances of
You fixed it? It’s still broken on the live site on the request sent by the app.
Your code was using
PHP is/was ‘loosely typed’, meaning if a function expects a specific type, say an int or bool (true/false) value but you passed in a string or null, PHP will carry on and try to convert/guess what the value should be.
PHP8+ adds much stricter typing within PHP and within PHP8 incorrect types start to throw fatal errors rather than just guessing what it should be (overall this is a good thing, being loosely typed is one of the reasons PHP has a ‘bad’ reputation within the developer community), so within Event Espresso we have started tightening our type declarations and that’s what you have run into here. Passing values to functions that aren’t expected causes problems, setting the type declarations prevents those but means you must use the function correctly or you’ll get fatal errors.
So yes, it’s partially due to the update but the root cause is not using the function correctly.