When adding a menu link and specifying "#" as path, two notices are generated and the validation message is incorrect:

  • Notice: Undefined index: path in menu_edit_item_validate() (line 380 of modules/menu/menu.admin.inc).
  • Notice: Undefined index: path in menu_edit_item_validate() (line 381 of modules/menu/menu.admin.inc).
  • The path '' is either invalid or you do not have access to it.

Patch attached to fix this, including a test for this edge case.

Files: 
CommentFileSizeAuthor
#7 Screen Shot 2012-03-23 at 3.05.56 PM.png66.31 KBzeropx
#5 menu-notices-1096208-5.patch1.05 KBzambrey
PASSED: [[SimpleTest]]: [MySQL] 39,946 pass(es). View
menu-notices.patch1.04 KBmr.baileys
PASSED: [[SimpleTest]]: [MySQL] 31,599 pass(es). View

Comments

catch’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs review » Reviewed & tested by the community
Issue tags: +needs backport to D7

Looks great.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

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

Status: Fixed » Closed (fixed)

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

grasmash’s picture

Still experiencing this error in 7.10, which was released in Dec. Is this still in 7.x-dev ?

zambrey’s picture

Version: 8.x-dev » 7.x-dev
Status: Closed (fixed) » Needs review
FileSize
1.05 KB
PASSED: [[SimpleTest]]: [MySQL] 39,946 pass(es). View

Seems like this was never commited to 7.x branch.
Attaching rerolled patch.

zeropx’s picture

@zambrey I have tested and can validate the patch worked.

zeropx’s picture

Forgot to attach a screen shot, here you go.

Screen Shot 2012-03-23 at 3.05.56 PM.png

zambrey’s picture

Yes, this is expected behavior. The notices are gone.

dcam’s picture

#5: menu-notices-1096208-5.patch queued for re-testing.

dcam’s picture

Status: Needs review » Reviewed & tested by the community

I also tested #5. I got the same result as zeropx in #7. The patch fixes the issue by eliminating the PHP errors. Marking this as RTBC.

David_Rothstein’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -needs backport to D7

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