Jump to content

PHP8 & Theme Hook function overrides stopped working


Recommended Posts

Hello guys,

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.

Thanks!

Edited by G17 Media
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...