The hook_menu() documentation describes a settings page at admin/config/foo as an example for how to implement tabs. However, if you follow this example, your page won't show up, because pages directly under admin/config don't appear on admin/config. Per https://drupal.org/node/549094#configuration, you need to put your pages under a sub-category, e.g. admin/config/development/foo.

Files: 
CommentFileSizeAuthor
#10 hook_menu_example-1257638-9.patch1.71 KBBès
PASSED: [[SimpleTest]]: [MySQL] 32,939 pass(es). View
#7 hook_menu_example-1257638-7.patch1.71 KBBès
FAILED: [[SimpleTest]]: [MySQL] Fetch test patch: failed to retrieve [issues] from [drupal.org]. View
#3 hook_menu_example-1257638-3.patch1.97 KBmichaellenahan
PASSED: [[SimpleTest]]: [MySQL] 33,210 pass(es). View

Comments

Dave Reid’s picture

We need to change this example to not live under admin/config as it gives a false impression that it should be used for creating new config menu categories when it should not.

jhodgdon’s picture

Title: Documentation problem with hook_menu » hook_menu example should be changed to not suggest admin/config/foo as path
Version: 7.x-dev » 8.x-dev
Issue tags: +needs backport to D7

How about making a sub-page of one of the existing admin categories? Anyway, thanks for reporting and it does sound like something that should be fixed.

michaellenahan’s picture

Status: Active » Needs review
FileSize
1.97 KB
PASSED: [[SimpleTest]]: [MySQL] 33,210 pass(es). View

Hello world, here we are at DrupalCon London 2011
LinL and michaellenahan

LinL’s picture

Subscribe

Bès’s picture

Exemple works for me with the patch

jhodgdon’s picture

Status: Needs review » Needs work

Thanks!

The patch looks good -- I think the new example is fine. However, I think we need to remove this bit from the end of the patch file:

diff --git a/scripts/drupal.sh b/scripts/drupal.sh
old mode 100755
new mode 100644
diff --git a/scripts/password-hash.sh b/scripts/password-hash.sh
old mode 100755
new mode 100644
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
old mode 100755
new mode 100644
Bès’s picture

Status: Needs work » Needs review
FileSize
1.71 KB
FAILED: [[SimpleTest]]: [MySQL] Fetch test patch: failed to retrieve [issues] from [drupal.org]. View

Here is a new version without the strange things at the end

Bès’s picture

Here is a new version without the strange things at the end

Status: Needs review » Needs work

The last submitted patch, hook_menu_example-1257638-7.patch, failed testing.

Bès’s picture

FileSize
1.71 KB
PASSED: [[SimpleTest]]: [MySQL] 32,939 pass(es). View

Whut ? no patch, double post ? hum OK let's do it again

Bès’s picture

Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, thanks! This should go into d7/d8 assuming it applies to 7.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x and 8.x. Thanks.

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