Commit ee2afa19 authored by Dries's avatar Dries

- Patch #145058 by pwolanin: update parents when a child is deleted.

parent 7131fd53
......@@ -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']);
}
}
......
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