Posted: October 3, 2022 at 11:50 am
trying to upgrade to php8 but getting a critical error from a custom function in the theme. Using,
How can the theme code recognize a function in the plugin to be compatible with php8 works in 7.4 |
|
Hi there, Where is that code running? I’ll see if I can reproduce this. If you can add the file to say Pastebin so I can drop it in locally that would be great. |
|
Line 34. We’re including this file in our theme from the functions file. |
|
This reply has been marked as private. | |
We don’t officially support PHP8.1 as it stands and if you have the option for PHP8, I’d use that over PHP8.1 currently. PHP8.1 throws a bunch of deprecated notices because of the changes made and is also much stricter on type control, which has never been the case with PHP previously. — Now, having said that I did test the above locally using PHP8.1 and didn’t run into a fatal error from that code. The functions mentioned above are within You could try including the file manually:
As it stands it only used in that one function so you could add that to line 33. However, its odd that I’m not getting the error at all here, I’m not sure why that would be the case. |
|
I do get a different fatal error when including that. Our host is not going to support PHP 7 after November. Are there no plans for 8 compatibility? Here is the new error when clicking on download PDF: Fatal error: Uncaught Dompdf\Exception: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated 8192 in /www/wp-content/plugins/event-espresso-core-reg/core/third_party_libs/dompdf/src/Helpers.php:507 |
|
The latest version of Event Espresso 4 (4.10.40.p) is already compatible with PHP8.0 PHP8.1 brings in a lot more breaking changes, we don’t have full compatibility with it yet… although for the most part 8.1 works for me, it just throws a bunch of deprecated notices. The error you are getting means you are using an older version of EE4, please update to the latest version and see if you still get an error then. |
|
Dang, that was it. I was on 4.10.38. 4.10.40 is the fix. Didn’t see the upgrade because I needed to reset the key after moving the wp directory. |
|
You’re most welcome, I’m glad its working for you now 🙂 |
|
The support post ‘espresso_display_ticket_selector not defined’ 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.