So I'm not sure how to describe this, but this is a bug in D6 that I'm fairly sure is in D7, too. Thanks to ghoti for getting bitten by it. :-)
The new menu system allows a menu item to specify an extra include file, and a path in which that file exists. If not specified, the file and path will inherit from a parent menu item, specifically the same one that defines the page callback. That's all well and good, *except* if the parent menu item is in a different module. In that case, the "file path" key defaults to the module of the child menu item, not the parent menu item, and so is incorrect.
I am assigning this to myself as a reminder that I need to fix this, although if someone else wants to do so first I won't complain. :-) The temporary workaround is to explicitly define file and file path in the child menu item, so that they won't inherit buggily.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | D7-248173-12-menu_file_path.patch | 845 bytes | pasqualle |
| #8 | D7-248173-8-menu_file_path.patch | 825 bytes | pasqualle |
| #5 | D6-248173-5-menu_file_path.patch | 907 bytes | pasqualle |
| #4 | menu_file_path-6.x-4.patch | 909 bytes | dropcube |
| #3 | menu_file_path-6x-3.patch | 910 bytes | dropcube |
Comments
Comment #1
Crell commentedActually since the registry patch is going to change that logic anyway and is RTBC, I am setting this back to D6 as it's not worth fixing in D7 when it's about to get rewritten anyway.
Comment #2
dropcube commentedCrell: The bug seems to be because of an incorrect 'if' statement and wrong variable assignment.
This patch fixes it.
Comment #3
dropcube commentedWell, after an IRC chat with chx, the only problem here is the wrong variable name:
dropcube: chx: so 'page callback' and others are inherited as a whole ?
chx: usually yes
chx: the rule is this
chx: page callback, argument, file and file path is a package
chx: you inherit the whole package
chx: if you do not define page callback
chx: but, if you want to be more specific you can , so you override everything once inherit fires
chx: but if page callback is not inherited, there is no inheritance at all.
chx: page callback somehow "carries" the whole package with itself
chx: that's quite logical, isn't it?
chx: most of the time you want to override page arguments for a sub page and nothing else.
This new patch fixes this.
Comment #4
dropcube commentedRe-rolling the patch against the 6.x branch.
Comment #5
pasquallereroll
Comment #6
bmarcotte commentedre #4
Hi Dropcube,
Thanks for the patch. I was having this problem as well. The patch line numbers are no longer valid, so I manually patched my file. The version I have is '$Id: menu.inc,v 1.255.2.32 2009/10/06 11:59:05 goba Exp $' The current line numbers are 2423 and 2424.
All is working now
Bob
Comment #7
bmarcotte commentedFolks should note that the file's path should be placed in an array element 'file path' i.e.:
this was not ovbious to me....I think I have it right now
Bob
Comment #8
pasqualleComment #10
pasqualle#8: D7-248173-8-menu_file_path.patch queued for re-testing.
Comment #12
pasqualleComment #13
ff1 commented#12: D7-248173-12-menu_file_path.patch queued for re-testing.
Comment #14
pasqualle#688334: file inheritance is broken