Hi, I just try to install the 7.0-beta1 in my host, and when i will this path /#overlay=admin/structure/menu/settings, I get the notice:

Notice: Undefined variable: main_options in menu_configure()  (line 700 of /media/MyDocuments/xampp/htdocs/drupal7/modules/menu/menu.admin.inc).

I am not sure whether or not where i did wrong, my host environment:

Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
Files: 
CommentFileSizeAuthor
#13 937850-followup.patch1.39 KBDavid_Rothstein
PASSED: [[SimpleTest]]: [MySQL] 26,515 pass(es). View
#11 937850.patch1.31 KBbleen
PASSED: [[SimpleTest]]: [MySQL] 26,390 pass(es). View
#8 937850_menu.patch1.31 KBjaymiejones86
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 937850_menu.patch. View
#4 937850.patch1.31 KBbleen
PASSED: [[SimpleTest]]: [MySQL] 26,329 pass(es). View
#1 937850_menu_settings_php_noice_1.patch1.32 KBSivaji
PASSED: [[SimpleTest]]: [MySQL] 26,152 pass(es). View

Comments

Sivaji’s picture

Title: New install and get notice in /#overlay=admin/structure/menu/settings » PHP notice in menu settings page
Version: 7.0-beta1 » 7.x-dev
Status: Active » Needs review
FileSize
1.32 KB
PASSED: [[SimpleTest]]: [MySQL] 26,152 pass(es). View

I confirm this bug. I can reproduce the same in 7.x-dev. Attached patch will fix this.

otherjoe’s picture

I was also able to confirm this bug on 7.0-beta1. Patch works and removes Notice message.

bleen’s picture

Status: Needs review » Needs work

Wow... it took me way more time then I care to admit to actually see what changed in the patch in #1. :) Finally found it - and it is the correct change. One tiny formatting detail though:

+++ modules/menu/menu.admin.inc	11 Oct 2010 16:00:28 -0000
@@ -697,7 +697,7 @@ function menu_configure() {
+    '#description' => t("Select the source for the Secondary links. An advanced option allows you to use the same source for both Main links (currently %main) and Secondary links: if your source menu has two levels of hierarchy, the top level menu links will appear in the Main links, and the children of the active link will appear in the Secondary links." , array('%main' => $menu_options[$main])),

There shouldn't be a space before the comma

Other than this, this patch is RTBC

Powered by Dreditor.

bleen’s picture

Status: Needs work » Needs review
FileSize
1.31 KB
PASSED: [[SimpleTest]]: [MySQL] 26,329 pass(es). View

here is the patch in #1 with that formatting fix

Sivaji’s picture

Good catch bleen18.

Is there any reason for using double quotes here ? I would suggest to replace it with single quotes otherwise this patch is RTBC.

davidhhuan’s picture

good job, bleen18! :)

webchick’s picture

Status: Needs review » Needs work

Yeah, as long as we're fixing the string, let's really fix it. Single quotes, then this is good to go. Thanks!

jaymiejones86’s picture

FileSize
1.31 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 937850_menu.patch. View

Here is bleen18's patch replacing double quotes with single quotes.

bleen’s picture

Status: Needs work » Needs review

summoning testbot

Status: Needs review » Needs work

The last submitted patch, 937850_menu.patch, failed testing.

bleen’s picture

Status: Needs work » Needs review
FileSize
1.31 KB
PASSED: [[SimpleTest]]: [MySQL] 26,390 pass(es). View

this will apply (the patch in #8 had changed the quotes in both the before and the after)

webchick’s picture

Status: Needs review » Fixed

Just remembered this again today. :)

Committed to HEAD. Thanks!

David_Rothstein’s picture

Status: Fixed » Needs review
FileSize
1.39 KB
PASSED: [[SimpleTest]]: [MySQL] 26,515 pass(es). View

We had this at one point at one of the followups at #140783: A select list without #default_value always passes form validation (where the bug was introduced), and we need to get that overall issue cleaned up at some point - however, it is definitely better to have this simpler fix be a separate issue.

As we noticed there, though, this fix is not complete. You still get the PHP notice in the case where there are no main links.

This patch should fix it. Kind of ugly, but good enough for now; there is an issue elsewhere that will hopefully rewrite and rip out most of this text anyway.

  • webchick committed fd94ba2 on 8.3.x
    #937850 by sivaji, bleen18: Fix PHP notice in menu settings page.
    
    

  • webchick committed fd94ba2 on 8.3.x
    #937850 by sivaji, bleen18: Fix PHP notice in menu settings page.
    
    

  • webchick committed fd94ba2 on 8.4.x
    #937850 by sivaji, bleen18: Fix PHP notice in menu settings page.
    
    

  • webchick committed fd94ba2 on 8.4.x
    #937850 by sivaji, bleen18: Fix PHP notice in menu settings page.