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.
When I visit edit page (http://site_domain/en/admin/structure/menu/item/3008/edit) for a menu entry added by taxonomy_menu, I get the following errors:
Notice: Undefined index: #default_value in special_menu_items_form_menu_edit_item_alter() (line 181 of /path/to/site/sites/all/modules/special_menu_items/special_menu_items.module).
Notice: Undefined index: #description in special_menu_items_form_menu_edit_item_alter() (line 190 of /path/to/site/sites/all/modules/special_menu_items/special_menu_items.module).
Comment | File | Size | Author |
---|---|---|---|
#8 | undefined-indexes-1407172-8.patch | 984 bytes | drzraf |
#3 | undefined-indexes-1407172-2.patch | 1.64 KB | jsenich |
Comments
Comment #1
tami.allen CreditAttribution: tami.allen commentedI just had the same error when visiting my Admin>Menus page. I cleared my cache and it went away. I've been changing some settings on Views that were Main Menu items, I think that caused the error.
Comment #2
jsenich CreditAttribution: jsenich commentedThe issue occurs when a menu item's link path is being controlled by another module such as views, panels (pages), etc. and there is not text field for link path.
Comment #3
jsenich CreditAttribution: jsenich commentedHere's a patch.
Comment #4
gotobedsleepyhead CreditAttribution: gotobedsleepyhead commentedThat fixed it - thanks!
Comment #5
dgastudio CreditAttribution: dgastudio commentedpatch fixes the problem.
Comment #6
dimitriseng CreditAttribution: dimitriseng commentedI can also confirm that the patch removes the warnings.
Comment #7
hwasem CreditAttribution: hwasem commentedI applied it as well and it seems to have resolved the error.
Thanks!
Comment #8
drzraf CreditAttribution: drzraf commentedconfirmed, and attached a version generated with git diff -w for the sake of clarity.
Comment #9
gagarine CreditAttribution: gagarine commentedComment #10
HazaThe patch from #8 don't respect the indentation inside the "if".
Patch from #3 seems better.
Comment #11
gagarine CreditAttribution: gagarine commentedhttp://drupal.org/commitlog/commit/9840/c777f0e79f2514fbd23f58f4fa1c3bec...
Comment #13
valery86 CreditAttribution: valery86 commentedIt worked for me too!!
Thanks !
Comment #14
BillyTom CreditAttribution: BillyTom commentedI am getting almost the same error in version 7.x-2.0:
Notice: Undefined index: #description in special_menu_items_form_menu_edit_item_alter() (line 138 of /var/data/vhosts/dev/httpdocs/drupal/sites/all/modules/special_menu_items/special_menu_items.module).
It happens when I edit menu items that have been created by panel pages. Clearing the cache does not remove the error. As far as I can tell the module works fine otherwise: other attributes like "class" and "title" are beeing displayed normally.
Comment #16
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedEvery time there is a
$form['link_path']
and the default value set (https://git.drupalcode.org/project/special_menu_items/-/blob/7.x-2.x/spe...), there should be a#description
attribute set as well, see:https://git.drupalcode.org/project/drupal/-/blob/7.x/modules/menu/menu.a...
I suppose there was/is another module altering the form. Moving back to Fixed, as that is not a issue in this module. The module is working ok with taxonomy_menu and other programatically created menu items as far as i know. In case there is still an issue with this module, please create a new issue. Thanks!