Closed (fixed)
Project:
Menu Attributes
Version:
7.x-1.0-rc1
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 May 2011 at 14:42 UTC
Updated:
13 Feb 2013 at 15:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
chrisgross commentedI did not see this error before upgrading to rc1.
Comment #2
chrisgross commented*upgrading priority to major since I am unable to edit some nodes.
Comment #3
jlaurin commentedsubscribe
Comment #4
dave reidI am not able to duplicate this error with a core install + menu_attributes.
Comment #5
chrisgross commentedFrom what I can tell, this issue seems to have spontaneously resolved itself. If I see it again, I will let you know. Thanks.
Comment #6
chrisgross commentedThis error came back again, but the message goes away if I change line 131 of menu_attributes.module from
if (isset($form['menu'])) {to
if (isset($form['menu']['link'])) {I'm not sure if it's right but without it, I can't edit some nodes. It seems to be a safe thing to do because the few lines afterwards only use $form['menu'] when using $form['menu']['link'], so I don't think it will break anything.
Comment #7
jlaurin commentedYour hint works :).
Thank you
Comment #8
dlumberg commentedI changed line 146 from:
to:
I did it this way because an ajax submit might not pass everything from the form and the function definition is basically stating that it needs an array or it will break.
There may be some reason for that, I don't know.
Comment #9
dave reidAgain, according to menu_form_node_form_alter() which will always run *before* menu_attributes. How could $form['menu']['link'] *not* be an array if isset($form['menu']) is TRUE?
Comment #10
stuzza commentedI've got a situation where $form['menu'] hasn't been set, the revisioning module blithely adds $form['menu']['#collapsed'] = true; without checking if $form['menu'] exists first, so that by the time _menu_attributes_node_form_alter() gets to it, $form['menu'] does exist, but $form['menu']['link'] does not.
I guess it's hard to write a module in anticipation that another contrib module might randomly bring the crazy, but I think that if you're doing things to $form['menu']['link'] it would be a good sense to check if it's there beforehand, and not just its parent.
Cheers
Stuart
Comment #11
dibs commentedsubscribe
Comment #12
amateescu commentedThis seems like a good argument to me, so I commited the attached patch that checks for $form['menu']['link'].
http://drupalcode.org/project/menu_attributes.git/commit/51f1830
Comment #14
Sergii commentedThe same affects me and I agree with the patch supplied.
Please include the change in the next release.
Comment #15
amateescu commentedThe patch has already been committed and it's now currently in 7.x-1.x-dev.
Comment #16
lennyaspen commented#8 Worked for me, thanks