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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mlncn’s picture

Status: Active » Needs review
Issue tags: +dgd7
FileSize
1.68 KB

I 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!

mlncn’s picture

The 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?

David_Rothstein’s picture

Status: Needs review » Needs work

The 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.

mlncn’s picture

Assigned: Unassigned » mlncn

Wow, 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.

mlncn’s picture

Title: Documentation of hook_help should use new menu loader placeholders » Documentation of hook_help cleanup: notes that it does *not* use menu loader placeholders, uses real paths in examples
Status: Needs work » Needs review
FileSize
2.81 KB

Improved 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.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

thx

webchick’s picture

Version: 7.x-dev » 6.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to HEAD. Thanks!

Does this need a back-port to D6?

mlncn’s picture

Status: Patch (to be ported) » Closed (fixed)

Nope, 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.