Closed (outdated)
Project:
Context
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Dec 2012 at 10:23 UTC
Updated:
22 Jan 2018 at 11:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tekante commentedThis is likely due to having a non array for $vars['main_menu'] or $vars['secondary_array'] in hook_preprocess_page. Do you have any code in your site which may lead to this condition?
Comment #2
Gyver06 commentedThanks for your answer, but how can I know if there is any code corresponding to one of the two conditions you mentioned ?
Comment #3
tekante commentedLooking through other hook_preprocess_page functions may help. As a first step you may want to use the debug function or drupal_set_message to print the value of $vars['main_menu'] and $vars['secondary_array'] to see if that gives you some hints on what may have set the value it contains gives you hints about what modules may be adjusting that value.
Comment #4
Gyver06 commentedThank you for your appreciated help.
I have managed and removed finally Context for now. I will need it at a later time.
Hope someone else will face the same issue and resolve it.
Regards
Comment #5
tekante commentedClosing as reporter is unable to provide additional information at this time
Comment #6
lufecir commentedI have been able to reproduce this problem. It seems to be coming from the i18n_menu module. As soon as I enable that module, this error occurs.
My versions:
Drupal core 7.18
==========
name = Menu translation
moduleName = i18n_menu
version = "7.x-1.7"
core = "7.x"
project = "i18n"
datestamp = "1341236501"
Comment #7
alpersari commentedThis error occurred after updating the site to 7.18.
Comment #8
tekante commentedI am still unable to replicate the error but can you try the attached patch to see if it resolves it for you.
Comment #9
andrés chandía commentedI've got the same problem when updating to i18n-7.x-1.8 (and variable-7.x-2.2)
I've tried with your patch but no success!
Comment #10
andrés chandía commentedI have downgraded to i18n 7.x-1.7 and the problem went away
Comment #11
jose reyero commentedI think i18n and context modules clash on so many places we should just document the incompatibilities. They just happen to use the same hooks to alter stuff provided by other modules...
Anyway, if anyone wants to keep working on a patch, this is what changed in i18n 7.x-1.8 about menus, if it's any use: #1693074: Change menu translation approach (i18n_menu_translated_menu_link_alter() skips item subtree processing)
Comment #12
knalstaaf commentedFor some reason the issue was solved by upgrading to i18n 7.x-1.8. So the combination Context 7.x-3.0-beta6 and i18n 7.x-1.8 works for me.
Comment #13
bonchak commentedI have the same problem:
Notice: Undefined index: main_menu in context_reaction_menu->execute() (line 62 of /home/...../public_html/dr/sites/all/modules/context/plugins/context_reaction_menu.inc).
Notice: Undefined index: secondary_menu in context_reaction_menu->execute() (line 63 of /home/...../public_html/dr/sites/all/modules/context/plugins/context_reaction_menu.inc).
When I downgrade i18n to 7.x-1.7 the problem disappears but due to some other reasons ( string translation of filed group titles ) I am forced to use the latest version of i18n. I've noticed that when I have this error context does not work. Any suggestions?
Comment #14
tekante commentedbonchak - does the patch in #8 resolve the issue for you in terms of the error message? Also, if some other module is modifying the expected structure of the links from menu_navigation_links or i18n_menu_navigation_links such that they no longer return an array then the menu reaction won't function correctly.
Comment #15
bonchak commented@tekante: the patch in #8 did not resolve my issue. I am usin i18n and i am supposed to use the updated version. If i use i18n 7.x-1.7 than the problem disappears. However I have to translate fieldgroup titles which requires an updated version of i18n. I've disabled context module for now, and will look for a solution via using rules.
Comment #16
edwtorba commentedThe problem is in the context module, as this module is making a call to the function i18n_menu_preprocess_page. This function ceased to exist since 7.x-1.7 version of the i18n module, so that was added a condition that validates the existence of such a function and providing compatibility with earlier and later versions of the i18n module.
Comment #17
quironHi folks
I'm having a error marked as duplicated of this one: https://www.drupal.org/node/1918038 I have the following notice:
this lines have the follow code:
could be a solution wrapp each one with a if (!empty($vars['main/secondary_menu'])) ???
the versions of my source are:
core 7.31
Internationalization 7.x-1.11
Context 7.x-3.2
thank for your support!
Comment #18
andrés chandía commented