Closed (fixed)
Project:
Drupal core
Version:
6.1
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Sep 2006 at 13:12 UTC
Updated:
2 Sep 2008 at 12:15 UTC
Jump to comment: Most recent file
Comments
Comment #1
drummIs it possible to hit the third case where these are used, MENU_SITE_OFFLINE?
Please leave as 'code needs review' and wait until a second person has given a positive review before setting 'ready to commit.'
Comment #2
drummComment #3
forngren commentedHowto reproduce:
* Go to /admin/settings/error-reporting
* Set Default 403 (access denied) page and/or Default 404 (not found) page to path does not exist (e.g. /idonotexist) or is unaccessible by visitors (e.g. /admin).
* Then visit an url that does not exit or is denied by the current user.
* It will display a blank, templated page containing either "2" or "3".
Site maintenance mode (i.e. MENU_SITE_OFFLINE) does not affect this behavior.
Comment #4
dries commentedStrange patch. I'd like us to ponder on this some more to see if we can come up with something more elegant.
Comment #5
forngren commented@Dries: Sure, but I'm not sure how to accomplish something slimmer with the current menu system.
If someone has an idea; please post it even if you think it's rubbish. Thanks.
Comment #6
forngren commentedThis goes pretty deep in the hierarchy:
index.php
It looks like we'll have to do it in drupal_not_found() and drupal_access_denied(). Actually I want to remove those functions and rewrite them from bottom up, but that's another story.
Still, I'm not sure how to polish this patch even more. In 6.x I will try to rewrite the 40x-handling, but that will maybe require some API-changes. For now a just want to squeeze this bug and make 5.x as stable as possible.
Setting this PCNR to get some more attention. The patch works (for me atleast), the issue is how to implement a/this solution.
Comment #7
forngren commentedFixed missing t(). I don't think it will get any slimmer/more drupalish.
Comment #8
drummComment #9
forngren commentedUpdated version, same file still applies.
Comment #10
forngren commentedUpdated to better match chxs menu patch.
Comment #11
chx commentedThe index.php fix predates the menu patch -- this even needs to be ported back to 5.x I believe. It takes a MENU_NOT_FOUND (or denied) from the menu_execute_active_handler and tells the user. Nice, very small change.
Comment #12
chx commentedI forgot to set version. 6.x needs something similar but not exactly -- 40x is a bit broken in HEAD now, that needs to be fixed, in general.
Comment #13
chx commentedI forgot to set version. 6.x needs something similar but not exactly -- 40x is a bit broken in HEAD now, that needs to be fixed, in general.
Comment #14
drummLooks okay. Chx, if you have any review of this code that would be great.
I would like to see a comment explaining what is happening in the code.
Comment #15
msameer commentedI'd rather handle it in drupal_access_denied() and drupal_not_found()
Patch against the latest drupal6 tarball
Comment #16
msameer commentedComment #17
forngren commentedUpdated/tested patch.
@drumm: I don't think this patch requires any additional comments.
Comment #18
forngren commentedJust a little bit friendlier.
Comment #19
forngren commentedFree issue! $0
(please, push this into core)
Comment #20
pasquallereroll
Comment #21
catchExcellent, ran into this a couple of times and it was very annoying. Tested, works great.
Comment #22
gábor hojtsyIndeed, I also ran into this quite a few times. Thanks for the patch. Using the constants it does show what happens, so committed.
Seems like this was not fixed in 5.x yet, so setting for backport.
Comment #23
bart jansens commentedBackport. Works in my tests.
Comment #24
drummCommitted to 5.x.
Comment #25
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #26
davidsimpson commentedHello,
I just downloaded the latest stable release and it seems to have this patch already applied to it, however I still have the problem that is described here. Meaning that if I restrict access to content for anonymous users, and add a customized 403 page, it still writes the typical "Access Denied" page.
Any ideas as to why this may be?
Thank you all,
David
Comment #27
catchdavidsimpson: I'm pretty sure that's exactly what the original patch was supposed to do - you used to get '2' instead of 'Access Denied', now you get 'Access Denied' instead of the node which the user doesn't have access to - because it'd be really hacky to bypass the node_access system for this.
Comment #28
catchhowever, if you want to open a new feature request against 7.x for this that'd be fine. For now I'm setting this back to it's original status.
Comment #29
publicme commentedI have this same '403' problem in 6.1. Disable content access for anonymous users, with reference to a custom "access denied" page, where I'd like to instruct visitors to registar an account to view the content, and the custom page does not appear. Reading this thread, I'm left clueless as to what to try next. It sounds like it's resolved, then it sounds like it's not resolved.
Comment #30
publicme commentedHow is one to deal with this currently existing problem?
Comment #31
pasquallethat's a different issue: #238508: custom 403 page not displayed
Comment #32
Mattias-J commentedI get the same confusion...
This part of the patch is the culprit. With this part, if an anonymous user tries to access some restricted content they only get "You are not authorized to access this page."
without this patch they are redirected to the drupal 403 page. There has to be a mistake here...
Comment #33
Mattias-J commentedForgot to mention, this is on the 5.10 branch.