Closed (won't fix)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Mar 2009 at 11:45 UTC
Updated:
26 Nov 2013 at 14:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
beginner commenteduser_menu():
user_pass_reset:
This may be due to the combination of drupal_get_form() and drupal_access_denied(). ??
Comment #2
beginner commentedComment #3
sunThat's because drupal_access_denied() does not end the request.
Comment #4
dries commentedIt would be better to re-factor the code so we don't have to call exit(). Calling exit() is quite drastic and prevents that certain handlers run, e.g. register_shutdown_function() handlers.
Comment #5
pp commentedI couldn't reproduce this bug.
I got the fresh copy from cvs.
Installed the Drupal.
Logged out.
Viewed the url.
I didn't see the theme printed twice.
What should I do?
pp
Comment #6
catchYou should mark it as needs more info ;)
Comment #7
sunI think it is unimportant whether this can be replicated or not.
This issue clearly identifies that the proper usage of drupal_access_denied() - which is important for security - is unknown.
Proposal:
- Let drupal_access_denied() return MENU_ACCESS_DENIED and not print anything at all.
- Rename
drupal_access_denied()todrupal_access_denied_page(), so it clearly describes that it outputs a page.- So developers can simply do:
- And index.php will ensure to take the appropriate steps.
Given the regular page request and processing flow, I think that would be much more grokable. At least, every other callback in Drupal returns something. For any reason, we apply a completely different concept here.
FWIW, the same applies to drupal_not_found().
If there is an important reason to handle these pages so differently, then we should at least update the PHPDocs of those functions to contain a code example that clearly shows how developers should implement the function. That said, this issue makes me nervous whether I'm using those functions properly in my modules.
Comment #8
sunTagging. See also #122130: Replace drupal_not_found() and drupal_access_denied() with constants
Comment #9
moshe weitzman commentedsun's ideas are good but not critical, imo
Comment #10
Tor Arne Thune commentedNot an issue in Drupal 7.0. Can't replicate the bug.
Comment #11
sunWe should investigate the proposed improvements for D8.
Comment #12
Technician commentedReceived same problem after update D7.12 -> D7.14. Do not remember anything like this before update.
Comment #13
Technician commentedDowngrade back to D7.12 not help - problem persists.
Comment #14
dgastudio commentedsame problem, my users can't login after register new account (new accounts are validated by email)
Comment #15
dgastudio commentedapplying the patch from #3, solves the problem with duplicated theme content. by users still can't access to password reset/set form.
Comment #16
sun#1463656: Add a Drupal kernel; leverage HttpFoundation and HttpKernel makes this entire issue obsolete for D8.
In D7, this should not happen, but if it does, then that hints at some broken code in a module or theme.
In D6 and below, this can happen more often, but there's no way to fix that other than refactoring access/page callback code (core code should not be affected though).
Comment #17
fusionteam commentedIn my case that issue appears when I call drupal_access_denied() in one of my hooks. The page is displayed twice, stacked vertically.
Then I tried to do the following:
After that the page displayed only once, but I the output is a bit strange. See the attached image.
Comment #18
pasqualleas sun wrote, when you see this problem then you have broken code in a module or theme.
Comment #19
pasqualle