Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
node/% is now node/%node in hook_menu() and i think that same string has to be used in hook_help; the documentation currently uses just the %: http://api.drupal.org/api/function/hook_help/7
Comment | File | Size | Author |
---|---|---|---|
#5 | 930566-4-help-documentation-regarding-path-wildcards.patch | 2.81 KB | mlncn |
#1 | 930566-1-help-documentation-regarding-path-wildcards.patch | 1.68 KB | mlncn |
Comments
Comment #1
mlncn CreditAttribution: mlncn commentedI meant in node_menu(), node module's implementation of hook_menu(), above. Same change goes for user/%user paths, which are also used in the example. This patch fixes these references, and also changes two of the example static paths to paths that actually exist in Drupal 7!
Comment #2
mlncn CreditAttribution: mlncn commentedThe documentation also refers to '/user/help#modulename' The /user/help path gives me access denied in Drupal 7 (same as user/anything) whether logged in or out, including with OpenID enabled. Should this user/help#modulename example be removed, or does anyone think it is still valid?
Comment #3
David_Rothstein CreditAttribution: David_Rothstein commentedThe proposed changes aren't correct. I wish hook_help() worked the same way as hook_menu(), but unfortunately it doesn't :) Even on pages where the menu system has "user/%user", hook_help() still just gets "user/%" as input to the function.
It certainly seems like the docs could use a rewrite to make that all more clear, though.
And I have no idea what's up with the "user/help#modulename" thing either. Maybe it's trying to say that if you want, your module can define custom "pseudo-paths" like that one - and then invoke hook_help() yourself to look for them? But it's not at all clear from the way it's written. The documentation there would really be better if it focused mostly on "admin/help#modulename" (the one psuedo-path which core actually does use, and which is very important for modules implementing this hook to know about), and then only mentioned any others as an aside.
Comment #4
mlncn CreditAttribution: mlncn commentedWow, thanks David– i was so sure that node/%node was given i even noted how admin/structure/types/manage/% was "different."
There is nothing i can find that gives a path on user/help to make a pseudopath there possible, so i'll remove that and we'll let people figure out that it's possible from admin/help#modulename.
Comment #5
mlncn CreditAttribution: mlncn commentedImproved help text without introducing lies this time! The admin/help#modulename functionality is provided specially; any other use of #specialdescriptor would require special code to have any effect, so the implication that the # has any magic functionality outside of admin/help has been removed.
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commentedthx
Comment #7
webchickCommitted to HEAD. Thanks!
Does this need a back-port to D6?
Comment #8
mlncn CreditAttribution: mlncn commentedNope, this doesn't have to be back-ported to D6-- the example paths don't need to be updated, and the % wildcard without %node is what will be expected anyway.