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? :)

Comments

kafitz’s picture

Assigned: Unassigned » kafitz
Status: Active » Needs review
StatusFileSize
new919 bytes

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

Status: Needs review » Needs work
jhodgdon’s picture

Version: 8.x-dev » 7.x-dev
Status: Needs work » Needs review

Ah, 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

jhodgdon’s picture

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Assuming that the tests pass, this patch looks good to me! Thanks!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

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

jhodgdon’s picture

No, the blog module still exists in 6.x. :)

webchick’s picture

Well, it still exists in 7.x too, which is why I'm confused. :)

jhodgdon’s picture

Version: 7.x-dev » 6.x-dev
Status: Fixed » Patch (to be ported)

Ah.... duh! Yes, we need to port this to Drupal 6, since the blog_page() and blog_feed() functions apparently don't exist there either.

albert volkman’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new890 bytes

D6 backport.

Status: Needs review » Needs work

The last submitted patch, hook_menu_example_function-1426150-d6-10.patch, failed testing.

jhodgdon’s picture

Status: Needs work » Fixed

Thanks 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. :)

Automatically closed -- issue fixed for 2 weeks with no activity.