? Success

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
5 Sep 2015

See test instructions in #7812

When access is not permitted, in the cases taken care off in this PR, we will get an Error message instead of loading the error.php page.

avatar infograf768 infograf768 - open - 5 Sep 2015
avatar infograf768 infograf768 - change - 5 Sep 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Sep 2015
Labels Added: ?
avatar mbabker
mbabker - comment - 5 Sep 2015

There's a small concern here I didn't think about before (not trying to block this in case someone gets that impression). In our bootstrap, we define the error handler for JError::raiseError() to ultimately call JError::customErrorPage() which renders the page as a JDocumentError instance (what we're trying to avoid here). One of the things JDocumentError::render() does is set the response headers with the correct 403 HTTP code. That needs to be accounted for IMO if we are going to move away from rendering an error document, otherwise you're going to have error pages go from returning a 403 code to a 200 code which is incorrect for that context.

avatar infograf768
infograf768 - comment - 5 Sep 2015

@mbabker
If you think this is wrong, I could use instead:
JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));

What do you think?

avatar mbabker
mbabker - comment - 5 Sep 2015

raiseWarning doesn't change the response headers either. So there's really two options:

1) Leave raiseError calls as is, like I mentioned before JDocumentError just sucks when it comes to adding extra bells and whistles.
2) Set the response header ($app->setHeader()) the same way JDocumentError::render() does in the controller. You avoid the error page and still set the right HTTP code.

avatar infograf768
infograf768 - comment - 5 Sep 2015

2) Set the response header ($app->setHeader()) the same way JDocumentError::render() does in the controller. You avoid the error page and still set the right HTTP code.

That's over my head I am afraid. Better close this and let it to someone more qualified.

Could you look also at #7825 where the matter is slightly different?

avatar infograf768 infograf768 - change - 5 Sep 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-09-05 15:58:00
Closed_By infograf768
avatar infograf768 infograf768 - close - 5 Sep 2015
avatar infograf768 infograf768 - close - 5 Sep 2015
avatar infograf768 infograf768 - change - 5 Sep 2015
Status Closed New
Closed_Date 2015-09-05 15:58:00
Closed_By infograf768
avatar infograf768 infograf768 - reopen - 5 Sep 2015
avatar infograf768 infograf768 - reopen - 5 Sep 2015
avatar infograf768
infograf768 - comment - 5 Sep 2015

Added setHeader as suggested by @mbabker

avatar zero-24 zero-24 - change - 5 Sep 2015
Category Front End
avatar zero-24 zero-24 - change - 5 Sep 2015
Status New Pending
Easy No Yes
avatar Bakual
Bakual - comment - 5 Sep 2015

Looks fine from review.
Thanks for doing this. This will likely serve as an example for other cases :)

avatar gwsdesk
gwsdesk - comment - 5 Sep 2015

Applied patch and looks fine to me as well. Thanks JM

avatar infograf768 infograf768 - change - 5 Sep 2015
Status Pending Ready to Commit
avatar infograf768 infograf768 - alter_testresult - 6 Sep 2015 - Bakual: Tested successfully
avatar infograf768 infograf768 - alter_testresult - 6 Sep 2015 - gwsdesk: Tested successfully
avatar infograf768
infograf768 - comment - 6 Sep 2015

2 testers OK. RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7824.

avatar joomla-cms-bot joomla-cms-bot - change - 6 Sep 2015
Labels Added: ?
avatar Kubik-Rubik Kubik-Rubik - change - 11 Sep 2015
Milestone Added:
avatar Kubik-Rubik
Kubik-Rubik - comment - 14 Sep 2015

Thank you @infograf768!

avatar Kubik-Rubik Kubik-Rubik - change - 14 Sep 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-09-14 07:45:36
Closed_By Kubik-Rubik
avatar Kubik-Rubik Kubik-Rubik - close - 14 Sep 2015
avatar joomla-cms-bot joomla-cms-bot - close - 14 Sep 2015
avatar Kubik-Rubik Kubik-Rubik - reference | 379ab86 - 14 Sep 15
avatar Kubik-Rubik Kubik-Rubik - merge - 14 Sep 2015
avatar Kubik-Rubik Kubik-Rubik - close - 14 Sep 2015
avatar joomla-cms-bot joomla-cms-bot - change - 14 Sep 2015
Labels Removed: ?
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone

Add a Comment

Login with GitHub to post a comment