Silverstripe Version:
4.1.
Question:
I want to give some error back with httpError, but it wont work … it redirects to the 404 error page and not the custom message
$this->httpError(404,'That region could not be found');
Silverstripe Version:
4.1.
Question:
I want to give some error back with httpError, but it wont work … it redirects to the 404 error page and not the custom message
$this->httpError(404,'That region could not be found');
This is a long standing problem with ErrorPage. If you remove the ErrorPage module your code should work, but your error message would be displayed as plain text (un-themed).
The good news is that now that ErrorPage is out of core, it’s possible to create a module that will render your custom error message with your theme. The bad news is that module hasn’t been made yet (AFAIK)
(If you’re interested in sponsoring a few hours work to produce a module like that, feel free to PM me)
A module seems to have materialised this evening: GitHub - jonom/silverstripe-custom-errors: Themed custom error responses for SilverStripe CMS
I made an ugly work around now … I hope noone has to ever read it …
And I think my Coding Skills aren’t good enough to produce code other want to use
Publishing modules is a great way to get constructive criticism and improve your skills