October 11, 2022 in Developer Connection
Apologies if I'm missing something, but I've just ran into an issue upgrading one of our forums to PHP8.
We make use of theme hooks which override theme functions and call the parent when necessary.
With our upgrade to PHP8 without IN_DEV, this all stopped working, presenting errors like:
Cannot use "parent" when current class scope has no parent (at ./system/Theme/Theme.php line 2703).
As far as I can tell by looking at the code in ./system/Theme/Theme.php, I cannot see how calling parent classes would work in that eval statement, as I think a parent call inside a class function in PHP8 without a parent will cause the eval to fail with a fatal error. But this is what IPS is doing. Have I massively overlooked something here or is this behavior expected?
The code works fine with PHP 7.4.X, as well as in IN_DEV mode, as the templates are not compiled in the same manner.
1 minute ago, Adriano Faria said:
Thank you very much! I do not understand the design decision from IPS here hopefully they fix this or at least mention this in their documentation at some point.
Started 1 hour ago
Started 5 hours ago
Started 3 hours ago