summaryrefslogtreecommitdiff
path: root/modules/menu
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-01-21 10:09:06 -0800
committerwebchick <webchick@24967.no-reply.drupal.org>2012-01-21 10:09:06 -0800
commit5f3834f2acef803cff80a060fa2863115c965b99 (patch)
tree95ff390bd29f07298ebe4b7dcf5ae63cd9c58b1f /modules/menu
parent7e074f9ee7fa6b8483d05d6e10cb2596f5294945 (diff)
downloadbrdo-5f3834f2acef803cff80a060fa2863115c965b99.tar.gz
brdo-5f3834f2acef803cff80a060fa2863115c965b99.tar.bz2
Issue #955848 by anrikun, Kars-T, catch, chx, casey, sun: Fixed When editing an existing node with a link, the link itself is listed in 'Parent item': menu_parent_options() needs some rewriting.
Diffstat (limited to 'modules/menu')
-rw-r--r--modules/menu/menu.module2
-rw-r--r--modules/menu/menu.test2
2 files changed, 3 insertions, 1 deletions
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index 615548c1e..40614a162 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -632,7 +632,7 @@ function menu_form_node_form_alter(&$form, $form_state) {
// menu_parent_options() is goofy and can actually handle either a menu link
// or a node type both as second argument. Pick based on whether there is
// a link already (menu_node_prepare() sets mlid default to 0).
- $options = menu_parent_options(menu_get_menus(), $link['mlid'] ? $link : $type);
+ $options = menu_parent_options(menu_get_menus(), $link['mlid'] ? $link : $type, $type);
// If no possible parent menu items were found, there is nothing to display.
if (empty($options)) {
return;
diff --git a/modules/menu/menu.test b/modules/menu/menu.test
index 44b5d687a..324ba6766 100644
--- a/modules/menu/menu.test
+++ b/modules/menu/menu.test
@@ -698,6 +698,8 @@ class MenuNodeTestCase extends DrupalWebTestCase {
// Assert that it is not possible to set the parent of the first node to itself or the second node.
$this->assertNoOption('edit-menu-parent', 'navigation:'. $item['mlid']);
$this->assertNoOption('edit-menu-parent', 'navigation:'. $child_item['mlid']);
+ // Assert that unallowed Management menu is not available in options.
+ $this->assertNoOption('edit-menu-parent', 'management:0');
}
/**