User tests: Successful: Unsuccessful:
This PR makes it possible for the redirect plugin, when it is enabled and acting as the global exception handler, to proxy to a previously set exception handler for conditions where it isn't aiming to handle the exception (a 404 page on the site application). This enables a custom exception handler to be used consistently regardless of whether the plugin is enabled or not (right now you could set a custom exception handler but when the redirect plugin is enabled it will only call to JErrorPage::render()
.
Install the attached exception.zip package and enable the plg_system_exception
plugin. Also enable the System - Redirect
plugin. Ensure that the plugin is ordered before the redirect plugin.
Do something to cause an exception to be thrown. Prior to the patch, you'll always get Joomla's error page. After the patch you should get a "My custom error handler" page.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Plugins |
Unrelated technically.
Thanks for clarifying
On 24 April 2016 at 21:34, Michael Babker notifications@github.com wrote:
Unrelated technically.
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#10078 (comment)
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
I have tested this item successfully on 52bdb9d
Before patch 404: Component not found
After patch: Blank page with "My custom error handler" text
Was that 404 on the frontend or backend? Because if it's the frontend the redirect plugin should process the Exception and NOT call the test plugin's handler.
Backend
Is this only for admin? Or will it be modified for frontend? Could be used to enable custom 404 pages while retaining redirect/collect URLs functionality.
It's for both applications. It is NOT changing how error pages are rendered. Rather, when the redirect plugin catches an exception it does not want to process (it will only process 404 errors on the frontend), it will fall back to the exception handler it replaced. The redirect plugin will still call JErrorPage::render()
for everything after that initial check to render the error page.
You can already do custom 404's if you check the error object in your error.php
template.
if (($this->error->getCode()) == '404') {
// Logic specific for a 404 page
}
I have tested this item successfully on 52bdb9d
Thanks.
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Milestone |
Added: |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-07 14:13:47 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
Is this in addition to Nik's PR or a replacement?
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10078.