Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the book module, the 'book' path is defined twice.
$items[] = array(
'path' => 'book',
'title' => t('books'),
'access' => user_access('access content'),
'type' => MENU_NORMAL_ITEM,
'weight' => 5);
...
...
...
$items[] = array(
'path' => 'book',
'title' => t('books'),
'callback' => 'book_render',
'access' => user_access('access content'),
'type' => MENU_SUGGESTED_ITEM);
Is there any reason for that or is it a bug? If it is a bug? What should be the correct definiton? Bote hat the former is a normal menu item, but the second is a suggested item. Also, there is the weight set to 5.
I think the correct one is the second definition, may be defined as a normal item, with no explicit weight?
Comment | File | Size | Author |
---|---|---|---|
#2 | book.module.bookpath_suggested.patch | 479 bytes | markus_petrux |
Comments
Comment #1
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedI consider that a bug.
The second definition will probably override the first. We should thus keep it suggested item in order to not change anything at this point of development. The weight should be removed.
Comment #2
markus_petrux CreditAttribution: markus_petrux commentedThere you go. It is so simple that I believe this is directly RTBC (/me thinks the second menu item overrides the first one too).
Comment #3
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedapplied
Comment #4
(not verified) CreditAttribution: commented