Hi, I get the following notices when I add a basic page / article and dont link it directly to the menu.

Notice: Undefined index: localized_options in menu_navigation_links() (line 1782 of C:\xampp\xampp\htdocs\drupal\includes\menu.inc).
Notice: Undefined index: localized_options in i18n_menu_navigation_links() (line 419 of C:\xampp\xampp\htdocs\drupal\sites\all\modules\i18n\i18n_menu\i18n_menu.module).

Comments

jose reyero’s picture

Status: Active » Postponed (maintainer needs more info)

The fact that it is the core module that produces a notice first makes it looks like it is a Drupal core issue.

i18n_menu mimics the logic in core menu module so we should first fix this in core, then we'll update i18n code.

Btw, what do you mean 'don't link it directly to the menu'?
And does this happen when you disable i18n_menu module?

modulist’s picture

I'm seeing the same error without i18n installed. Could it have anything to do with nice_menus and its local submenus?

puregin’s picture

I'm seeing the same error. I created a basic page (node/1) and set it to be the home page for the site. Under Structure/Menu/Settings, I set the main links to be the Navigation menu. All of the selected items are display (as tabs in Bartik) but the first tab is blank, and links to "node/%25". I'm guessing there is some kind of translation that is happening to the "home" page title?

jose reyero’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

So not i18n (#2), please find the right module

bartl’s picture

StatusFileSize
new545 bytes

Bullshit.

The problem also occurs in other places in the Drupal code, such as includes/menu.inc, and can be fixed in the exact same way because the code in i18n_menu.module is the same code as in menu.inc.

That patch did take the long road to solve the problem, if you just suppress the PHP notices on this one line, with "@", it'll be gone too.

So here is a patch that solved the problem in 18n_menu.module. (patch with -p1)

mgifford’s picture

Gotta note here that @chx's patch in #1018614: Inaccessible menu items in navigation links cause "Notice: Undefined index: localized_options" hasn't gotten into core yet and so it hasn't been fixed in core yet.

I haven't looked into if this is a i18n or core issue.

@bartl - I don't think suppressing notices using http://php.net/manual/en/language.operators.errorcontrol.php - is generally a good idea.

jaime@gingerrobot.com’s picture

Version: 7.x-1.0-beta7 » 7.x-1.4
Status: Closed (won't fix) » Active
StatusFileSize
new679 bytes

Hi!

I also am seeing this same error with 7.x-1.4 I'm sure there's some deeper problem here that is causing this error. I went back in the git repository and found the error came up at the follow commit:

commit 48d157f376d3bcc0e8d0bcb912bb75ba1457050d
Author: Florian Weber
Date: Fri Feb 3 21:26:05 2012 +0100

Issue #1351678 by caktux, oriol_e9g, webflo: Follow menu_link_get_preferred() active trail handling for custom menus.

The change that made the error occur was removing the break 2;

I added the break 2; back into the function and I no longer see the error. here is my patch:

Updated to note this did not fix it after all. I think we will need to follow up with menu.inc, it's about the translate function.

jaime@gingerrobot.com’s picture

Status: Active » Closed (won't fix)
jaime@gingerrobot.com’s picture

So if anyone does find this the two dodgy fixes I came up with for the error messages

1. do the solution from http://drupal.org/node/1018614 to both this menu file and the file in includes.
2. Add a return to the init function in i18n so it doesn't keep looping through menu items that don't have translations.