Closed (won't fix)
Project:
Drupal core
Version:
x.y.z
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2005 at 10:58 UTC
Updated:
6 Sep 2006 at 06:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
Wesley Tanaka commentedComment #2
killes@www.drop.org commentedWhat problem are you trying to fix? Where do you get a page content of "3"?
Comment #3
moshe weitzman commentedplease explain how to reproduce
Comment #4
Wesley Tanaka commentedThe 3 problem is a bug in the i18n module, not a bug in core.
This patch just makes drupal_access_denied a bit more tolerant to the case where drupal_get_normal_path is not a no-op. If you examine the patch, I think you'll agree that this is how the logic was meant to be.
Comment #5
Wesley Tanaka commenteddrupal_get_normal_path actually returning something different than what is passed in being the normal case when i18n is installed.
Comment #6
Wesley Tanaka commentedComment #7
dries commentedI don't think this needs fixing. This is merely a side-effect of another bug.
Comment #8
Wesley Tanaka commentedLet's rhetorically completely ignore i18n for the moment.
Given that i18n is not installed, does it become an invariant of all drupal installations that
(!drupal_get_normal_path(''))is always true?If so, this patch certainly doesn't hurt anything. If variable_get('site_404', '') returns '', then given the invariant assumed above, drupal_get_normal_path('') will always evaluate the same as '' in the if ($path) guard.
If *not*, this patch fixes a bug where, if no custom site 404 or 403 page is set, variable_get('site_404','') returns '', but drupal_get_normal_path('') may in some instances return a value that evaluates as true. Given that no 404 page is set, we don't want to run a custom handler, no matter what drupal_get_normal_path returned. But without this patch, a custom handler (namely the one corresponding to drupal_get_normal_path('')) will get run, which is not the correct behavior.
The problem is in both access denied and not found functions, and the patch attached to this comment (obsoleting the previous patch) addresses both.
Comment #9
mgiffordYour patch - comment #8 - worked well for me. I was trying to followup with the other bug reports that were displaying:
====
Primary links
2
====
But they weren't working for me. Realized it was only on links that were 404'd, found this patch and applied it. Presto!
Thanks. Worked on Drupal's cvs code & i18n (although that might be irrelevant).
Mike
Comment #10
Wesley Tanaka commentedpatch again applies to HEAD
Comment #11
nickl commentedRerolled to head.
Dries commented in #7 that this won't be fixed but maybe wtanaka has a point in #8.
Either way, simple patch, makes logical sense please commit or close this issue.
Tested works as advertised.
Comment #12
drummThere are 2 ways for drupal_get_normal_path() to turn '' into something:
1. Putting a URL alias on '', which the validation on that form doesn't allow.
2. Through implementing custom_url_rewrite(), which i18n must be using.
#1 is ruled out due to impossibility and #2 is a known bug in i18n. What is left to fix in core?