Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
menu system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2007 at 02:21 UTC
Updated:
20 Sep 2007 at 13:12 UTC
Jump to comment: Most recent file
Comments
Comment #1
dries commentedI don't understand what this means:
Also, could you document in the PHPdoc why this is useful? Maybe add a small use case?
Comment #2
pwolanin commentedadded more comments.
This is rarely used (see drupal_not_found()), but should be tested by someone other than me before it's RTBC.
Comment #3
pwolanin commentedI'm not sure about this approach- after thinking about it more menu_get_item() should be available to validate paths.
Comment #4
pwolanin commentedMaybe something simple like this instead
Comment #5
pwolanin commentedActually, better yet to go back to something closer to the Drupal 5.x code. This may be useful in case the theme code or other code is trying to generate output based on arg().
Comment #6
pwolanin commentedre-rolled - previous patch had lots of fuzz/offset
Comment #7
bennybobw commentedRerolled against HEAD. I don't know exactly how this would be used, but I tested it by printing $_GET['q'] in a custom 403 and a custom 404 page. Setting to RTBC.
Comment #8
dries commentedPlease document (in the code) _why_ we need to clear out the invalid path.
Comment #9
gábor hojtsyPwolanin asked me to look at this, but it seems like Dries has a pretty clear open suggestion about the code.
Comment #10
pwolanin commentedhmm, after talking this over with Jeff Eaton, I think an even more minimal patch like the attached may be the right approach (unless later testing shows that setting the path is really needed on 403/404 pages).
Comment #11
pwolanin commentedComment #12
RobRoy commentedI remember Rasmus saying a while back that he didn't like how we modified $_GET['q'], just thought I'd point that out but I know we do this in other places too.
Was Dries' question answered about why we need this? I'd like to know too, even though I've used this function in the past to do some menu hackery thought maybe D6 would not need this.
Comment #13
pwolanin commentedD5 used the function a couple places in core in addition to drupal_not_found()/access_denied().
D6 does not use it anywhere at this point. It's possible it would be helpful to use it for 403/404 pages as in the earlier patch - but it's not apparent to me that it's needed.
So, the last patch is just a really minimal effort to keep this function as part of the API in the event we find (for example) during the beta testing that it's useful and needed somewhere.
Comment #14
pwolanin commenteddiscussing this more with chx, I realize the earlier patch was better. We should set the active item for 403/404 pages since the custom 403, for example, might be a page like /search which has tabs. Re-rolled that patch with more code comments.
Comment #15
webernet commentedLooks fine, and doesn't appear to break anything.
Comment #16
pwolanin commentedminor fix - the empty string is not a valid path, and so setting the path to this was causing a side effect of making the sidebars disappear on 403 pages for logged-in users.
Comment #17
pwolanin commentedah - The empty string for $_GET[q] is not making the sidebar go away - it's making the menu blocks go away.
last patch is no good - makes random tabs appear. Re-evaluating.
Comment #18
pwolanin commentedhere's a simpler solution - only set the path if there is a custom 403 or 404 page.
Comment #19
webernet commentedMinor menu block bug fixed - looks fine.
Comment #20
pwolanin commentedsmall update to the patch re: http://drupal.org/node/172765
use the menu_set_active_item API function for clarity in user module as discussed in that issue.
Comment #21
gábor hojtsyOK, it seems Dries' issues with the patch are solved, so I have seen no reason not to commit it. Thanks.
Comment #22
(not verified) commented