Commit a17555d5 authored by drumm's avatar drumm

#287725 by mantyla. Sort by mid to avoid inconsistencies when multiple menu items exist for a node.

parent b7715b93
......@@ -176,7 +176,7 @@ function menu_form_alter($form_id, &$form) {
if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
$item = array();
if ($form['nid']['#value'] > 0) {
$item = db_fetch_array(db_query("SELECT * FROM {menu} WHERE path = 'node/%d'", $form['nid']['#value']));
$item = db_fetch_array(db_query("SELECT * FROM {menu} WHERE path = 'node/%d' ORDER BY mid", $form['nid']['#value']));
if (isset($form['#post']['menu']) && is_array($form['#post']['menu'])) {
$item = !is_array($item) ? $form['#post']['menu'] : (($form['#post']['op'] == t('Preview')) ? array_merge($item, $form['#post']['menu']) : array_merge($form['#post']['menu'], $item));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment