Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
menu system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
22 Aug 2008 at 10:41 UTC
Updated:
7 Dec 2010 at 06:10 UTC
Jump to comment: Most recent file
This is a feature request by Steven Wittens and I coded it but have not tested it.
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | 298561-menu-tail-load-24.patch | 2.26 KB | pwolanin |
| #21 | 298561-menu-tail-load-21.patch | 2.47 KB | pwolanin |
| #11 | menu_tail_load_3.patch | 2.61 KB | mcarbone |
| #7 | menu_tail_load_2.patch | 2.39 KB | mcarbone |
| #5 | menu_tail_load.patch | 1.94 KB | chx |
Comments
Comment #1
moshe weitzman commentedSome comments would be helpful. I have no idea when to use this, nor even what it does.
Comment #2
dave reidThis would be very useful for auto-completion functions. It's unfortunate that it feels like %menu_tail was added as an incomplete feature. :/
See
#93854: Allow autocompletion requests to include slashes
Comment #3
chx commentedComment #4
chx commentedHm, no, this one works.
Comment #5
chx commentedwith test. I checked that the test fails when the patch is not applied.
Comment #6
mcarbone commented"arguments" is misspelled:
Comment #7
mcarbone commentedFor efficiency's sake, here's the same exact patch except with the typo fixed.
Comment #8
tstoecklerCould we get some PHPDoc for menu_tail_load()?
Comment #9
chx commentedNo :p
edit: if someone comes up with a doxygen, be my guest. I have failed trying to write one. The code is short enough not to need explanation. It's not a function your code calls. So why bother with a lengthy complicated doxygen?
Comment #10
pwolanin commentedsubscribe
Comment #11
mcarbone commentedHere's some very simple Doxygen for this and also for menu_tail_to_arg(). As chx wrote, not much has to be written here as these are automatically called functions documented here: http://drupal.org/node/109153#load (although this needs to be slightly updated for 7.x, namely the part saying that menu_tail_load doesn't exist).
Comment #12
pwolanin commentedThis seems a little too hard-coded:
Can we just make it:
Comment #13
mcarbone commentedWouldn't that make this sort of an API change, since you'd now be passing two additional arguments to every load function?
Comment #14
chx commentedYeah and then load functions might have condition, reset and other tidbits...
Comment #15
pwolanin commentedignore #12 - I was confusing load arguments with something else. I think we have little choice but to special-case this if we want it to work.
Comment #16
drunken monkeyWhat about requiring hook_menu()s to manually specify those load arguments, if they want to use menu_tail_load()?
A bit harder on the developers, but
- we wouldn't need a hard-coded special case,
- probably only few will use it anyways, and
- those should be able to read the documentation of what they are using.
I think this will be an API change anyways, since a page callback might now get different arguments, if %menu_tail was previously used without intended load functionality.
In any case, +1 for doing this, in some way. Has arguably been a bit of a pain up to now.
Comment #17
chx commentedmenu_tail_load does not work without map and index. There is no point in mandating the poor module writers to add that always. Given that already %menu_tail is already at the end of the relevant paths, nothing gets broken by the loader. Special casing is not the best, yes but given it's an internal menu function it's not that bad.
Comment #18
pwolanin commentedcore only uses it one place - I think specifying the load arguments might be preferred?
Comment #19
chx commentedCore does. And? I do not get your point, do you really want module authors do an elaborate dance to use %menu_tail? Note that if you use %menu_tail with this patch and not load arguments, PHP will be very, very unhappy when it gets only one argument and expects three. This part is not optional.
Comment #20
drunken monkeyWell, if PHP will be very, very unhappy, then module developers will almost immediately realize their mistake and add those arguments. It's not an "elaborate dance", it's two strings and would be well-documented.
Comment #21
pwolanin commentedHere's the patch putting it just in hook_menu.
Comment #22
drunken monkeyLooks good to me, seems to work perfectly and the bot doesn't complain either.
Comment #23
sunMissing phpDoc for the test class.
But on a second thought, I wonder why this is a separate test case in the first place? Isn't there an existing one already?
Can we at least use single quotes and string concatenation for the value, and make the comment actually state what is being asserted here, and why?
Powered by Dreditor.
Comment #24
pwolanin commentedLooks like it can easily be merged with the prior test case - that's pretty short and generic.
Comment #25
drunken monkeyStill works perfectly for me. (Sorry I forgot about this issue …)
Let's just let the test bot check this once again (although, as said, it still applies cleanly).
Comment #26
drunken monkey#24: 298561-menu-tail-load-24.patch queued for re-testing.
Comment #27
tom_o_t commented#24: 298561-menu-tail-load-24.patch queued for re-testing.
Comment #28
webchickD7 is closed for features.
Comment #29
mcarbone commentedwebchick, right now date search is broken unless this patch goes in. i.e., searching for "1/15/2001" or "9/11" does not work on Drupal 7 (see #915214: Regression: Slashes broken in search for more info on this).
Comment #30
pwolanin commentedAgreed - this is a bug fix. "task" was more a carry-over before we realized what else was broken.
Comment #31
webchickAh, ok. I think I misread when I was whipping through these the other day. Sorry!
Committed to HEAD.