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

- Patch #217803 by csevb10 and senpai: uninstall system does not correctly...

- Patch #217803 by csevb10 and senpai: uninstall system does not correctly remove dynamic menu items when a module is deleted.
parent bbc65c30
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
......@@ -373,12 +373,15 @@ function drupal_install_system() {
* The module to uninstall.
*/
function drupal_uninstall_module($module) {
// First, retrieve all the module's menu paths from db.
drupal_load('module', $module);
$paths = module_invoke($module, 'menu');
// Uninstall the module(s).
module_load_install($module);
module_invoke($module, 'uninstall');
// Remove menu links for paths declared by this module.
drupal_load('module', $module);
$paths = module_invoke($module, 'menu');
// Now remove the menu links for all paths declared by this module.
if (!empty($paths)) {
$paths = array_keys($paths);
// Clean out the names of load functions.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment