Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Notice: Undefined offset: 2 in _menu_translate() (line 759 of /var/aegir/drupal7/includes/menu.inc).
Notice: Undefined offset: 2 in _menu_translate() (line 762 of /var/aegir/drupal7/includes/menu.inc).
Notice: Undefined offset: 2 in _menu_translate() (line 759 of /var/aegir/drupal7/includes/menu.inc).
Notice: Undefined offset: 2 in _menu_translate() (line 762 of /var/aegir/drupal7/includes/menu.inc).
Receiving the above errors. From what I can tell its related to menu_block/custom_menu_active_trail.inc.
Comment | File | Size | Author |
---|---|---|---|
#24 | core--6.x--1108314-24-undef-offset.patch | 530 bytes | jwilson3 |
#21 | core--7.x--1108314-21-undef-offset.patch | 543 bytes | alberto56 |
Comments
Comment #1
Babalu CreditAttribution: Babalu commentedNotice: Undefined offset: 2 in _menu_translate() (Zeile 762 von /var/www/vhosts/.........../httpdocs/includes/menu.inc).
Comment #2
handokozhang CreditAttribution: 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 CreditAttribution: webankit commented+1
Comment #4
sreynen CreditAttribution: 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 CreditAttribution: StephenRobinson commentedI get this with D7.9 from search/*
Comment #6
aspilicious CreditAttribution: aspilicious commentedDo you have "Menu block" enabled?
Comment #7
StephenRobinson CreditAttribution: StephenRobinson commentedYes, Menu Block 7.x-2.2....
Stephen :)
Comment #8
StephenRobinson CreditAttribution: StephenRobinson commentedDisabling Menu Block makes no differences to this error.
Comment #9
aspilicious CreditAttribution: aspilicious commentedDid you clear the caches after disabling? I'm prety sure this is caused by contrib modules.
Comment #10
StephenRobinson CreditAttribution: StephenRobinson commentedperhaps it is from apache solr?
Comment #11
minnur CreditAttribution: 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 CreditAttribution: StephenRobinson commenteddone some debug, something wrong with solr:
heres the item
Comment #13
StephenRobinson CreditAttribution: 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 CreditAttribution: Damien Tournoud commentedComment #15
Daniel_KM CreditAttribution: 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 CreditAttribution: Daniel_KM commentedMy issue is resolved: in fact, I've got a
my_menu/my_submenu/%
menu item, but nomy_menu/my_submenu
item.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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: marcoka commentedi have this too if i go to /user
Comment #23
MariskaTh CreditAttribution: 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.