0

it happens to me repeatedly that suddenly the frontend is not displayed correctly (see screenshot attached). I see no trigger, it seems to happen without reason (just changing ordinary html-tags in a template). Even if I copy the template from the working live-system over to the broken dev-system, it is not working in the dev-system. Strange. broken page in dev-system In another thread, it was suspected that incorrect PHP code could be the cause. But that is not the case for me, if I remove the entire PHP code from the template, the error remains. BUT: If I turn off php in the template settings, the page works again. Similarly, the page works if I remove a larger Switchee branch.

Does anyone have any idea of what can be done here? Could switchee be the culprit? It hasn't been updated in 5 years after all. Thank you in advance for any help!

EDIT 26 Jan 2023

Actually the problem just vanished. A day later the error completely was gone. I know how that sounds, but definitely the problem just vanished. I also deleted all EE-caches while coping with the error, so it wasn't a caching-problem. Have to mention that there was a similar problem some weeks ago. Suddenly the live system AND the dev-system showed such errors. I solved it for both systems by emptying a template, saving and pasting the same(!) code into it. Sounds strange - and IS strange, therefore I really would appreciate any help!

5
  • 1
    If you set debug to 2 do you see any errors from the template? What version of EE and PHP are you running. Gut reaction is that it's a PHP error... could very well be due to a newer PHP version and switchee as a whole.
    – Tom Jaeger
    Jan 24, 2023 at 20:41
  • Thanks @TomJaeger - I am pretty sure that it's not PHP (because I removed the PHP-code to test, this changed nothing; also nobody changed the php-code when the error appeared). I cannot show debug-reports because the error has vanished. Pleas see edit in the original post. So perhaps only Switchee to blame? :-)
    – BNetz
    Jan 26, 2023 at 15:58
  • 1
    Ah, good deal.... My gut reaction is that it was likely a PHP error in Switchee (based on your debugging likely NOT the PHP in the template)
    – Tom Jaeger
    Jan 26, 2023 at 19:09
  • Ah, now I see … Ok, thanks for your help, so the problem might not be solvable without removing Switchee.
    – BNetz
    Jan 26, 2023 at 19:21
  • A bit hard to say 100%. That's really more of a guess. We'd need to see the error to know for sure.
    – Tom Jaeger
    Jan 26, 2023 at 19:39

1 Answer 1

1

As @tom-jaeger presumed the problem was the addon which threw a deprecation-notice. This lead to the error in the frontend, and it explains why the error suddenly appeared and vanished: The notice was thrown only once.

@mark-croxton helped out by updating the addon Switchee to PHP 8.1 compatibility (thanks!); you can find it on Github (croxton/Switchee).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.