Skip to content
Snippets Groups Projects
Commit 6d93ee69 authored by Steven Wittens's avatar Steven Wittens
Browse files

- Menu: remove array_merge warning when editing a node without menu item.

parent c38da788
No related branches found
No related tags found
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
...@@ -544,7 +544,7 @@ function menu_node_form($edit = array()) { ...@@ -544,7 +544,7 @@ function menu_node_form($edit = array()) {
if ($edit['nid'] > 0) { if ($edit['nid'] > 0) {
$item = db_fetch_array(db_query("SELECT * FROM {menu} WHERE path = 'node/%d'", $edit['nid'])); $item = db_fetch_array(db_query("SELECT * FROM {menu} WHERE path = 'node/%d'", $edit['nid']));
if (is_array($edit['menu'])) { if (is_array($edit['menu'])) {
$item = ($_POST['op'] == t('Preview')) ? array_merge($item, $edit['menu']) : array_merge($edit['menu'], $item); $item = !is_array($item) ? $edit['menu'] : (($_POST['op'] == t('Preview')) ? array_merge($item, $edit['menu']) : array_merge($edit['menu'], $item));
} }
} }
......
...@@ -544,7 +544,7 @@ function menu_node_form($edit = array()) { ...@@ -544,7 +544,7 @@ function menu_node_form($edit = array()) {
if ($edit['nid'] > 0) { if ($edit['nid'] > 0) {
$item = db_fetch_array(db_query("SELECT * FROM {menu} WHERE path = 'node/%d'", $edit['nid'])); $item = db_fetch_array(db_query("SELECT * FROM {menu} WHERE path = 'node/%d'", $edit['nid']));
if (is_array($edit['menu'])) { if (is_array($edit['menu'])) {
$item = ($_POST['op'] == t('Preview')) ? array_merge($item, $edit['menu']) : array_merge($edit['menu'], $item); $item = !is_array($item) ? $edit['menu'] : (($_POST['op'] == t('Preview')) ? array_merge($item, $edit['menu']) : array_merge($edit['menu'], $item));
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment