Home » Administration » Structure » Menus

Settings

"Undefined index: in menu_configure() (line 682 of /modules/menu/menu.admin.inc)."

$menu_options[$main] isn't defined in the help message for source for the secondary links when
$main was previously set as "No Main Links".

The fix is to change line 682 of /modules/menu/menu.admin.inc
'%main' => $menu_options[$main]
to
'%main' => $main ? $menu_options[$main] : 'none'

Comments

montesq’s picture

Status: Active » Needs review
StatusFileSize
new1.68 KB

Find as attached the patch according to the mejd's comment
This patch fixes the error in my case...

Status: Needs review » Needs work

The last submitted patch, 1021064.patch, failed testing.

montesq’s picture

Status: Needs work » Needs review

#1: 1021064.patch queued for re-testing.

montesq’s picture

StatusFileSize
new1.16 KB

patch in #1 contains a part not relative to the current issue...
This new patch is "clean"

Status: Needs review » Needs work

The last submitted patch, 1021064.patch, failed testing.

montesq’s picture

Status: Needs work » Needs review
StatusFileSize
new1.15 KB

grrr sorry but I'm really silly, find as attached another patch...
Time to sleep for me

Oleksa-1’s picture

Status: Needs review » Reviewed & tested by the community

thx

dawehner’s picture

Version: 7.0 » 8.x-dev
Issue tags: +Needs backport to D7
barraponto’s picture

StatusFileSize
new1.24 KB

This is mostly the same patch, for 7.x.

barraponto’s picture

StatusFileSize
new1.16 KB

last patch had some weird objects in it....

webchick’s picture

Status: Reviewed & tested by the community » Fixed

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

tr’s picture

Status: Fixed » Needs work

This patch adds:
array('%main' => $main ? $menu_options[$main] : 'none')

The string 'none' needs to be wrapped in t(). Not sure 'none' is the proper word to use here either. Also, should probably use isset($menu_options[$main]) instead of just testing if ($main).

There's another patch RTBC in #1080026: Undefined index: in menu_configure() (line 682 of menu_admin.inc) that addresses this same issue, but uses t() and isset(). I'm marking that one as duplicate of this, but the patch in there should be considered as a better way to fix this problem.

webchick’s picture

Issue tags: +Quick fix, +Novice

Wow, sorry. I'm not sure what I was smoking when I committed that patch; you're absolutely right.

OTOH, I don't think we can use the patch in #1080026: Undefined index: in menu_configure() (line 682 of menu_admin.inc) because it adds a new string. t('none') is also in book.module, so if we were to just wrap t() around 'none' that would resolve this issue without breaking string freeze.

That should be pretty easy for someone to do. :)

clayball’s picture

StatusFileSize
new1.18 KB

added t() wrapper.

clayball’s picture

Assigned: Unassigned » clayball
Status: Needs work » Needs review
Issue tags: -Needs backport to D7

I forgot to set the status on this :)

This patch also applied cleanly to D7.

Zgear’s picture

xjm’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs backport to D7

Regarding #15, note that we want to have the needs backport tag even if the backport is exactly the same patch. :)

Retests pass, and this is sort of a no-brainer. RTBC.

catch’s picture

Version: 8.x-dev » 7.x-dev

Yeah just to reiterate, if it doesn't say 'needs backport to D7' in the tags, I'm liable to just mark it fixed for 8.x and forget about 7.x since I'm only allowed to commit to 8.x and that tag is the main thing to remind me things need to be moved back afterwards.

Committed/pushed to 8.x, moving to 7.x.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 7.x. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix, -Novice, -Needs backport to D7

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