Skip to content
Snippets Groups Projects
Commit c4d3607a authored by catch's avatar catch
Browse files

Issue #955848 by anrikun, casey: Fixed When editing an existing node with a...

Issue #955848 by anrikun, casey: Fixed When editing an existing node with a link, the link itself is listed in 'Parent item': menu_parent_options() needs some rewriting. (critical followup)
parent 6ea395e6
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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;
......
......@@ -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');
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment