summaryrefslogtreecommitdiff
path: root/includes/install.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2011-05-13 20:29:07 -0400
committerDries Buytaert <dries@buytaert.net>2011-05-13 20:29:07 -0400
commit3a736398332b24806dd0161220b7f69a02dff3b0 (patch)
tree946cbca564281932ae53c91e57f1ef1561cbe775 /includes/install.inc
parent3035021f74b01b2a0747610e6589df902d12137a (diff)
downloadbrdo-3a736398332b24806dd0161220b7f69a02dff3b0.tar.gz
brdo-3a736398332b24806dd0161220b7f69a02dff3b0.tar.bz2
- Patch #1029606 by fago, bojanz, Damien Tournoud: hook_menu() should not be called during uninstallation.
Diffstat (limited to 'includes/install.inc')
-rw-r--r--includes/install.inc34
1 files changed, 1 insertions, 33 deletions
diff --git a/includes/install.inc b/includes/install.inc
index 75ff62360..d22f4f9cb 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -547,7 +547,7 @@ abstract class DatabaseTasks {
*
* @param $database
* An array of driver specific configuration options.
- *
+ *
* @return
* An array of driver configuration errors, keyed by form element name.
*/
@@ -782,44 +782,12 @@ function drupal_uninstall_modules($module_list = array(), $uninstall_dependents
}
foreach ($module_list as $module) {
- // First, retrieve all the module's menu paths from db.
- drupal_load('module', $module);
- $paths = module_invoke($module, 'menu');
-
// Uninstall the module.
module_load_install($module);
module_invoke($module, 'uninstall');
drupal_uninstall_schema($module);
watchdog('system', '%module module uninstalled.', array('%module' => $module), WATCHDOG_INFO);
-
- // 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.
- foreach ($paths as $index => $path) {
- $parts = explode('/', $path, MENU_MAX_PARTS);
- foreach ($parts as $k => $part) {
- if (preg_match('/^%[a-z_]*$/', $part)) {
- $parts[$k] = '%';
- }
- }
- $paths[$index] = implode('/', $parts);
- }
-
- $result = db_select('menu_links')
- ->fields('menu_links')
- ->condition('router_path', $paths, 'IN')
- ->condition('external', 0)
- ->orderBy('depth')
- ->execute();
- // Remove all such items. Starting from those with the greatest depth will
- // minimize the amount of re-parenting done by menu_link_delete().
- foreach ($result as $item) {
- _menu_delete_item($item, TRUE);
- }
- }
-
drupal_set_installed_schema_version($module, SCHEMA_UNINSTALLED);
}