Posted by vegantriathlete on September 24, 2011 at 8:34pm
3 followers
| Project: | Examples for Developers |
| Version: | 6.x-1.x-dev |
| Component: | Other |
| Category: | task |
| Priority: | normal |
| Assigned: | vegantriathlete |
| Status: | needs review |
Issue Summary
This is for hook_help
Comments
#1
Here are the .info and .module for the D6 version. I'm not getting the module to even show up in the module list right now. There seems to be some issue with the fact that the module is named help_example.module. When I change things to use a different name it shows up just like expected. Am I missing something really obvious? Or is there truly a conflict with the fact that 'help' appears in the name?
#2
[See comment above] Can somebody put another set of eyes on this and see if I'm missing something?
#3
I downloaded the files in #1, unixed the line endings, installed them in a D6 instance, all seems to be working OK, ran Coder over it, just one minor issue over 1 space where there should be 2.
Ran
git clone --branch 6.x-1.x http://git.drupal.org/project/examples.gitand added help_example to it, rangit add help_example, rangit diff --cached > help_example-1289932.patchand here is the patch.The patch can be used with
patch -p1 < help_example-1289932.patchwhich creates the folder and files.#4
There's plenty of documentation about how hook_help() works... As in: http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hoo...
It might be a better use of effort to expand on the help hooks in the various modules. For instance, examples.module implements hook_help(), but only contains comments and doesn't return anything. Adding an Examples menu and hooking some help to it would improve things. Adding help to at least some of the modules would go a long way towards making them more instructive.
#5
@Mile23:
I am planning to go through all the modules and make sure they have hook_help implemented. I am also going to run all of them through coder and coder_tough_love. Finally, I am going to add references to the appropriate api links.
Having read rfay's comment about the desireable level of granularity does reinforce Mile23's point. I was heading in the wrong direction with my scheme of hook_example. What is the consensus about the best example module for me to do this more in-depth explanation of hook_menu? Would that also be page_example? Or, do you think it would be better for me to add it to examples.module?
#6
@vegantriathlete: You can submit patches for the core documentation, too. If you want to add some discussion of specifics, you can put it in the first-source documentation, and that way everyone benefits from better first-source documentation. It'd be a good idea to learn how git works first, though. The Drupal dev process runs on patches.
Adding links to all the hook documentation sounds great. The way to do it is to put @see hook_whatever() in the docblock, and then doxygen will automatically link it to the proper page. Drupal doxygen info here: http://drupal.org/node/1354
As for why hutch saw it but you didn't, it's because he added the files that you made, and then created a patch for them. Now anyone can apply the patch and end up with the new files.
#7
@Mile23: It looks like our replies crossed paths. I think I was in the process of updating my reply and you got the "old" version. So people reading the thread will get confused. Please see the updated comment and questions.
Thanks for the answer on how to add the appropriate links for the various hooks.
#8
Thanks for the clarification on the comment edit.
Not to be a smart-ass, but the best place for examples of menu types would be menu_example, I'd wager. :-) There's a lot of overlap in these examples because they were written by a lot of people over time.
#9
Ah, my mistake. What I meant to say was "this more in-depth explanation of hook_help()." I guess I was getting tired by the time I was writing that comment last night.
Should I put the work I was doing in the module I attached to this thread into page_example.module or examples.module? Or do you have a different suggestion?