I’m having an odd issue and would love some pointers. I have a site with its own custom error page, and I’m sure it has worked already. I did some refining work afterwards, and now I just noticed that the error page isn’t displayed anymore, instead there’s a Crikey error that says:
"Call to a member function getRoute() on null"
in /grav/user/plugins/flex-objects/flex-objects.php > public function onPageNotFound(Event $event)
I did check whether my redirects were interfering, but taking them out didn’t change a thing. Other than that I don’t know what might be the problem?
I’ve looked into this a little more, and the issue might yet be with my .htaccess redirects. I’m not sure – taking them out doesn’t change the Crikey error, but I’ve had quite a few run-ins with cached redirects in the past – I’m leaving them out on one site for a few days and see if that changes anything.
What seems to make a strong case for the redirects as the culprits is, on localhost everything is fine. I put this in my .htaccess file as the first redirect rule:
Okay so one step further: the error goes away when I disable the PageLocks plugin… However, I also have a website where PageLocks is in use and everything works miraculously, just as it should, so clearly there are some more factors involved here. I’m working on this, will keep you posted
This is getting more confusing the longer I look! I meant to track down the code that gives me the Crikey error, or rather, that the Crikey error reports. As you can see in the screenshot, this is supposedly line 287 in user/plugins/flex-objects/flex-objects.php:
The only file where I can find function onPageNotFound is in user/plugins/error/error.php, line 66, BUT the line from the Crikey error is actually from user/plugins/flex-objects/flex-objects.phpline 297…
So it seems to me that the error page somehow smashes these two files together. Not sure whether that’s a problem, but it’s definitely confusing me.
I have two websites that show this error instead of the custom error page (also if there is no custom error page). Both show the error page as expected if I disable the PageLocks plugin.
However, both show NO error on localhost with PageLocks enabled. And to make this really interesting, I have another two websites with PageLocks enabled where everything works just fine. I can’t seem to find any relevant difference between them??
And also, switching the use of flex objects off for pages does not change anything.