From dfe1225147f48fa36db8507020795278c9270bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Mon, 17 Dec 2007 12:23:01 +0000 Subject: #194310 by chx, catch, KarenS: run updates for disabled but previously installed modules, if they are compatible with the current system --- includes/install.inc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'includes') diff --git a/includes/install.inc b/includes/install.inc index 2ce311ee5..87ae7ff7b 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -22,8 +22,10 @@ define('FILE_NOT_EXECUTABLE', 128); * Initialize the update system by loading all installed module's .install files. */ function drupal_load_updates() { - foreach (module_list() as $module) { - module_load_install($module); + foreach (drupal_get_installed_schema_version(NULL, FALSE, TRUE) as $module => $schema_version) { + if ($schema_version > -1) { + module_load_install($module); + } } } @@ -58,10 +60,15 @@ function drupal_get_schema_versions($module) { * * @param $module * A module name. + * @param $reset + * Set to TRUE after modifying the system table. + * @param $array + * Set to TRUE if you want to get information about all modules in the + * system. * @return * The currently installed schema version. */ -function drupal_get_installed_schema_version($module, $reset = FALSE) { +function drupal_get_installed_schema_version($module, $reset = FALSE, $array = FALSE) { static $versions = array(); if ($reset) { @@ -76,7 +83,7 @@ function drupal_get_installed_schema_version($module, $reset = FALSE) { } } - return $versions[$module]; + return $array ? $versions : $versions[$module]; } /** -- cgit v1.2.3