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 )

Files: 
CommentFileSizeAuthor
#10 menu atriibutes.png74.45 KBdwalker51
#8 menu_attributes_access_check.patch763 bytesBartezz
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch menu_attributes_access_check_1.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]
#5 menu_attributes_access_check.patch768 bytesBartezz
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in menu_attributes_access_check_0.patch.
[ View ]
#2 menu_attributes_access_check.patch776 bytesBartezz
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in menu_attributes_access_check.patch.
[ View ]

Comments

Status:Active» Closed (duplicate)

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.

Version:6.x-1.0-beta1» 7.x-1.x-dev
Status:Needs review» Closed (duplicate)
StatusFileSize
new776 bytes
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in menu_attributes_access_check.patch.
[ View ]

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

Version:7.x-1.x-dev» 6.x-1.0-beta1
Status:Closed (duplicate)» Needs review

Oops forgot to change status!

Version:7.x-1.x-dev» 6.x-1.0-beta1
Status:Closed (duplicate)» Needs work

The last submitted patch, menu_attributes_access_check.patch, failed testing.

StatusFileSize
new768 bytes
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in menu_attributes_access_check_0.patch.
[ View ]

Let's try again! why can't all these *Nix, Win, Mac line endings just get along :)

Status:Needs work» Needs review

CRAP, sorry, forgot again!

Status:Needs review» Needs work

The last submitted patch, menu_attributes_access_check.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new763 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch menu_attributes_access_check_1.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

Darn line endings... let's check this one!

Status:Needs review» Needs work

The last submitted patch, menu_attributes_access_check.patch, failed testing.

StatusFileSize
new74.45 KB

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

I no longer get this same issue when the content type has no available menus marked by changing line 144 of menu_attributes.module

<?php
if (isset($form['menu']['enabled'])) {
?>

Thanks, that worked for me.

I tried to replicate the issue I posted in #0 with i18n and nodeformcols. With drupal 7.15 and current release of all modules the issue is gone, now everything works as expected.