- Patch #145058 by pwolanin: update parents when a child is deleted.
parent
7131fd5313
commit
ee2afa19d0
|
@ -1261,6 +1261,11 @@ function _menu_delete_item($item) {
|
|||
}
|
||||
}
|
||||
db_query('DELETE FROM {menu_links} WHERE mlid = %d', $item['mlid']);
|
||||
|
||||
// Update the has_children status of the parent
|
||||
$children = (bool)db_result(db_query("SELECT COUNT(*) FROM {menu_links} WHERE plid = %d AND hidden = 0", $item['plid']));
|
||||
db_query("UPDATE {menu_links} SET has_children = %d WHERE mlid = %d", $children, $item['plid']);
|
||||
|
||||
menu_cache_clear($item['menu_name']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue