Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
menu system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Mar 2011 at 18:09 UTC
Updated:
15 Jun 2017 at 14:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Babalu commentedNotice: Undefined offset: 2 in _menu_translate() (Zeile 762 von /var/www/vhosts/.........../httpdocs/includes/menu.inc).
Comment #2
handokozhang commentedI do have same problem: line 762 ....
Not very sure, but if I'm not wrong I never got this error but only after upgrade to 7.8 Drupal Core.
Comment #3
webankit commented+1
Comment #4
sreynen commentedI'm having the same problem. I have a Views page display with a path of /admin/appearance/fontyourface/browse/% and a hook_menu() callback with a path of /admin/appearance/fontyourface/browse. When I load the latter, this notices comes up, where $link_map matches the former. My menu callbacks are all working as expected, outside this notice.
I'm not sure if this is the best solution, but changing menu.inc line 761 to
if ($link_map[$i] == '%' && isset($path_map[$i])) {removes the notice.Comment #5
stephenrobinson commentedI get this with D7.9 from search/*
Comment #6
aspilicious commentedDo you have "Menu block" enabled?
Comment #7
stephenrobinson commentedYes, Menu Block 7.x-2.2....
Stephen :)
Comment #8
stephenrobinson commentedDisabling Menu Block makes no differences to this error.
Comment #9
aspilicious commentedDid you clear the caches after disabling? I'm prety sure this is caused by contrib modules.
Comment #10
stephenrobinson commentedperhaps it is from apache solr?
Comment #11
minnur commentedI was able to fix this, please see and try:
WAS:
1. My hook_menu implementation:
Fix:
2. hook_menu().
3. function mymoduleid_to_arg().
Comment #12
stephenrobinson commenteddone some debug, something wrong with solr:
heres the item
Comment #13
stephenrobinson commentedAh yes, is a bug in apachesolr_search.module:
%map has 2 items, not 3 before you search, hence the error.
Issue moved to apache solr - http://drupal.org/node/1364824
Comment #14
damien tournoud commentedComment #15
Daniel_KM commentedHi,
I've got the same issue and use an updated fix of the #4 above, because the bug occurs on lines 765 and 768 of menu.inc too:
Sincerely,
Daniel Berthereau
Infodoc & Knowledge management
Comment #16
Daniel_KM commentedMy issue is resolved: in fact, I've got a
my_menu/my_submenu/%menu item, but nomy_menu/my_submenuitem.So, as I don't want to create two items, I keep only this second one, because page argument is automatically send to function.
Sincerely,
Daniel Berthereau
Infodoc & Knowledge management
Comment #17
sunDuplicate of #676010: diff_menu() issue - undefined offset in includes/menu.inc on line 576 function _menu_translate()
Comment #18
alberto56 commentedOne way to reproduce this problem in D7 is to create a module with this code:
In the above example, when calling the path "undefined_offset", Drupal attempts to create a link to the local task, but it can't because an argument is missing.
In this case, of course, the API is not being used correctly.
Cheers,
Albert.
Comment #19
nitebreed@Albert, good call. Setting my custom module menu definitions to MENU_CALLBACK instead of MENU_LOCAL_TASK also fixed these notices for me
Comment #20
Uncle_Code_Monkey commentedWhat is someone supposed to do when they create two Views that exhibit this problem? There's no callback function to define anywhere.
example:
View1 has a main menu of "projects"
View2 has a main menu of "projects/%/subprojects"
Any time you view the projects page, this notice occurs and the only way to avoid it is to make sure your paths do not overlap. My current workaround is to set View1's path to "project" (make it different from "projects/..."), but I would rather not have to do such a thing.
And maybe this is a Views issue and not core.
Comment #21
alberto56 commentedMy site is built around a weird system where it is required that menu items contain "%" and be local tasks (not recommended, but I can't seem to get rid of it). Anyway, here is a quick and dirty patch I'm using "temporarily" to avoid this error. I'm not recommending you use it, but here it is.
Comment #22
marcoka commentedi have this too if i go to /user
Comment #23
mariskath commented#15 worked for me. Thanks!
Comment #24
jwilson3Here is a re-roll of the patch in #21 for Drupal 6, which also fixes this issue for me.
Comment #25
joshmillerThis is actually not a duplicate. The person who said it was a duplicate failed to note that this (albeit very similar) bug is being generated on core Drupal. We have applied the patch in #21 on a large Drupal Commerce site for the last 2 years happily.