-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.0] Custom Error Pages - new feature #40597
Conversation
Nice. Just one idea: could we have a generic error position error-default to have a non technical error message by default. (Can be done in a different PR OFC) |
My feeling was that is what the existing text is for and that will be displayed when it is not a 404 (or 403 if you have a module for that as well.) I'm not sure what other error codes ever make it to the error.php file |
First, this is great 👍
But the existing text also contains guidance that - more or less - only applies to 404/403 errors. (i.e. anything about "out-of-date bookmarks" or "mistyped addresses", "no access"...) Another note: as the module is dependant on the error code, creating a module in position |
It is possible with this code already. I just did not add a pre-defined module for every possible error code.
Are you sure that the error.php is used in those scenario? This pr is NOT changing the way that errors are handled. It ONLY allows for changes in the infornmation dispplayed |
I know. My comment was just a case for the addition of a default/fallback error module. (so that you don't have to define a rather hacky
I am quite sure that - at least in J!3 - the frontend error.php was also called for generic exceptions or sometimes even PHP Errors. I did not 'test' this yet with J!4 (read, I never had a site that broken yet :-) |
When you are sure that its true in j4 ... |
I just verified in J!4.3: When an |
thanks, would you be so kind a create a pr for the system template too? I think documentation at manual.joomla.org would also make sense |
THANK YOU!!! I will create the docs later today |
Summary of Changes
Adds a module position to the error.php page of cassiopeia so that you can customise the 404 page without having to change language strings or asking the user to modify the error.php (which they will lose on update)
This is fully backwards compatible as the existing error page text is displayed if there is no module. If debug is enabled then the debug information is still displayed
In theory the error.php is used by joomla for all error codes so this PR is able to display a specific module for each error code.
Testing Instructions
Apply the PR
Create a new module (custom html is probably the most useful) and publish in the new position error-404
Go to a fake page on your site and you will see the 404 page with your new module
Unpublish the module and repeat and you will see the original 404 page with the language strings
Original 404
Example 404 AFTER applying this Pull Request and creating a module
If accepted then I will create a guided tour for this and post-installation message
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
cc @crystalenka @HLeithner @alexandreelise