ProductionMode with error message "call a method xxxName() on null in @layout

mkoula
Backer | 52
+
0
-

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?

CZechBoY
Member | 3608
+
0
-

Try debugger if it occurs everytime…

mkoula
Backer | 52
+
0
-

As I write – it occurs just in Production Mode, when I enable Tracy in DebugMode problem is gone and everything works… So far it looks like it's something with the cache…

Last edited by mkoula (2018-09-14 20:13)

mkoula
Backer | 52
+
0
-

Problem solved:
Error4×xPresenter 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 Error4×xPresenter 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…