Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted April 24, 20222 yr 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, 20222 yr by Colonel_mortis
April 24, 20222 yr Author 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.
April 24, 20222 yr 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.