API page: http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...
The function body example is are out of date. Functions blog_page() and blog_feed() don't exist in Drupal 7/8.
Finding a better example in a different hook_menu() implementation and putting it in there might be a good Novice project... with a bit of support from office hours perhaps? :)
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | hook_menu_example_function-1426150-d6-10.patch | 890 bytes | albert volkman |
| #1 | drupal-core-1426150-hook_menu-example-function-needs-update-1.patch | 919 bytes | kafitz |
Comments
Comment #1
kafitz commentedCorrect me if I'm wrong. I did a checkout of the latest version in drupal7 (Version 7.9). Then I changed the function hook_menu from system.api.php. Now it is the same like in version 8.x.
Comment #3
jhodgdonAh, you are right -- the 8.x version is already fixed, and this issue should be 7.x only. Let's see if the testbot agrees.
By the way, normally you would want to do a git checkout on the 7.x branch, rather than a specific released version like 7.9, before patching. In this case, it should be OK, but generally that is what you want to do. Check the Version Control tab on the Drupal project page for instructions:
http://drupal.org/project/drupal/git-instructions
Comment #4
jhodgdon#1: drupal-core-1426150-hook_menu-example-function-needs-update-1.patch queued for re-testing.
Comment #5
jhodgdonAssuming that the tests pass, this patch looks good to me! Thanks!
Comment #6
webchickThis isn't what we normally do (provide a made-up example as opposed to a real example from core), but agree that keeping 8.x and 7.x in sync probably makes sense.
Committed and pushed to 7.x. Thanks! Does this need to be backported to 6.x as well?
Comment #7
jhodgdonNo, the blog module still exists in 6.x. :)
Comment #8
webchickWell, it still exists in 7.x too, which is why I'm confused. :)
Comment #9
jhodgdonAh.... duh! Yes, we need to port this to Drupal 6, since the blog_page() and blog_feed() functions apparently don't exist there either.
Comment #10
albert volkman commentedD6 backport.
Comment #12
jhodgdonThanks Albert! That patch looks fine. It's in the Documentation project, so the tests will fail... but I committed it so we don't have to worry about that. :)