ProductionMode with error message "call a method xxxName() on null in @layout
- mkoula
- Backer | 57
I am having strange behavior, in ProductionMode on the server I am getting 500 Server Error and in the error log I can see the message: "call a method getName() on null in @layout…
I fill in the beforeRender() method the variable $meta which has a getter getName(), it's just the value object and it's working fine in the development mode and I can not see any exception, even on the server, but in production immediately 500 with this message.
Any idea what could be wrong?
- mkoula
- Backer | 57
Problem solved:
Error4xxPresenter is having templates in the “templates/Error” directory and
they are using standard @layout.latte
So if you change and add some variables into the @layout.latte file then there won't be existing in Error4xxPresenter and this goes except 404 error into 500 error and this error from the layout is printed into the temp folder except that something else is wrong…
Maybe there would be some extra layout for error templates. I know, I know don't beat me :-D but for so many newbies this could be a problem…