Skip to content
Snippets Groups Projects
Commit ee2afa19 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

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

parent 7131fd53
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
......@@ -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']);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment