- Issue created by @roderik
- 🇳🇱Netherlands roderik Amsterdam,NL / Budapest,HU
A solution I was tinkering with (diff, no MR yet) cancels the redirection. It then renders the 404 page in "whatever default backend view mode".
I personally don't like this as a general addition to this module. Because "whatever default backend view mode" is not necessarily configured to be non-ugly. So the 404 page may come out ugly and even may disclose some information that looks strange.
Example output for https://OUR-SITE'S-BACKEND-DOMAIN/nonexistent-page is attached to this issue as a screenshot, to show what I mean.
Alternative solution, which we should probably impement, is: add an extra class that
- extends Core's DefaultExceptionHtmlSubscriber (i.e. subscribes to onException)
- that preempts CustomPageExceptionHtmlSubscriber (higher priority) - i.e. prevents CustomPageExceptionHtmlSubscriber from ever trying to render a frontend node
- that does the same check as CustomPageExceptionHtmlSubscriber (do we have page.403 or page.404 configured?)
- and in that case: renders /system/404 (a plain simple "Page not found" message) instead of the actual page.404 path.
- 🇦🇹Austria fago Vienna
@roderik
Yes, that seems fine. We should not redirect any 4xx or 5xx errors and show them within Drupal.
Thus, I think the fix is good. But I'd suggest we also test-coverage for that to fix the behavior:
* 4xx / 5xx errors are shown within drupal
* Access frontend route like node/123 redirects to frontendNot sure whether the seccond part is already covered.
- Status changed to Postponed: needs info
4 months ago 4:23am 18 December 2024 - 🇦🇹Austria fago Vienna
I cannot reproduce the described behavior. If it really happens, it certainly qualifies as bug, thus fixing the category. Please provide steps to reprodocue, e.g. with gitpod test environments.