Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Colonel_mortis Posted April 24, 2022 Posted April 24, 2022 (edited) Having updated my local dev environment to PHP 8.0, I'm now getting PHP Fatal error: Cannot use "parent" when current class scope has no parent in /var/www/html/ips_themes/system/Theme/Theme.php(2633) : eval()'d code on line 29 during the multiredirect, causing it to fall back to the manual redirect (and succeed due to the lock in compileTemplates still being held by the dead request). This is being caused by a theme hook that is manually overriding one of the template methods public function userReputation($member, $types, $currentAppModule, $currentType, $table, $reactions) { // ... my logic return parent::userReputation($member, $types, $currentAppModule, $currentType, $table, $reactions); } which is a supported thing to do. This is causing problems now because as of PHP 8.0 it is a fatal compile time error if the code references `parent` but is in a class that does not have a parent. Please can you update \IPS\Theme::compileTemplates (and \IPS\cms\Theme::compileTemplates) to avoid this, possibly by having the hook class extend \StdClass (or some other placeholder) so the compile time check passes? Edited April 24, 2022 by Colonel_mortis
CodingJungle Posted April 24, 2022 Posted April 24, 2022 solved this one awhile back Colonel_mortis 1
Colonel_mortis Posted April 24, 2022 Author Posted April 24, 2022 7 minutes ago, CodingJungle said: solved this one awhile back Hmm yeah I guess that works, would be nicer if the eval logic was changed to have it extend \StdClass or something though.
CodingJungle Posted April 24, 2022 Posted April 24, 2022 2 minutes ago, Colonel_mortis said: Hmm yeah I guess that works, would be nicer if the eval logic was changed to have it extend \StdClass or something though. yeah, i figured this would be a good short term solution till they figured things out, but that might've been some wishful thinking on my part.
Recommended Posts