Posted by idflood on April 15, 2011 at 3:31pm
5 followers
| Project: | Menu attributes |
| Version: | 6.x-1.0-beta1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
I created a node type with no "available menu" so it can't have a menu item. Then if you add or edit a node of this type the menu attributes form is shown in a broken way.
Expected result: menu_attributes should not alter form for node type having no available menu.
This issue may be responsible for this #1093498: 'Menu item attributes' appear suddenly & unwantedly
( possibly related to either i18n or nodeformcols module as they were installed when having this issue, I need to investigate a bit further )
Comments
#1
I can't duplicate this with a core install and the latest menu_attributes code. I posted this in #1093498: 'Menu item attributes' appear suddenly & unwantedly:
"Menu attributes only adds elements inside of $form['menu'] if the $form['menu'] element exists - which it does not when there are no menus available for a content type. So I don't see how there's any problem from the menu_attributes side of the code."
Therefore, I'm marking this as a duplicate of #1093498: 'Menu item attributes' appear suddenly & unwantedly.
#2
Similar issue in D6... the $form['menu'] is somehow set even though there is no menu enabled for this cck. Devel dsm outputs this;
menu (Array, 5 elements)link_title (Array, 1 element)
#default_value (String, 0 characters )
weight (Array, 1 element)
#default_value (Integer) 0
parent (Array, 1 element)
#default_value (String, 15 characters ) primary-links:0
options (Array, 3 elements)
#tree (Boolean) TRUE
#weight (Integer) 50
attributes (Array, 13 elements)
description (Array, 5 elements)
#type (String, 8 characters ) textarea
#title (String, 11 characters ) Description
#default_value (String, 0 characters )
#rows (Integer) 1
#description (String, 57 characters ) The description displayed when hovering over a ...
I've tried to debug, first disabled http://drupal.org/project/ctm which allows one to enabled/disable a menu per cck. Dis/enabling this module had no effect. I disabled and enabled other menu influencing modules and in my particular case disabling menu translation (part of i18n) resolved this issue. Somehow this module sets the $form['menu'] variable, yet there is no input field generated as this is prevented by CTM.
Maybe it's better not to just check existence of $form['menu'] but to check if $form['menu']['#access'] == TRUE; before adding the elements? This makes it more compatible with other modules and is also a better check IMO.
Please review my patch against 6.x-2.0-beta1
Cheers
#3
Oops forgot to change status!
#4
The last submitted patch, menu_attributes_access_check.patch, failed testing.
#5
Let's try again! why can't all these *Nix, Win, Mac line endings just get along :)
#6
CRAP, sorry, forgot again!
#7
The last submitted patch, menu_attributes_access_check.patch, failed testing.
#8
Darn line endings... let's check this one!
#9
The last submitted patch, menu_attributes_access_check.patch, failed testing.
#10
I am getting the same, enabling at least one menu in the 'Menu Settings' of the content type and everything was working as it should and the fields disappeared from my content type..this only happen as admin, the users did not see the fields appear