From 857bbe5bce4b53a5245de7f06b9c794fb82fb93a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 2 Sep 2010 21:07:44 +0000 Subject: [PATCH] - Patch #894530 by David_Rothstein: update system calls drupal_get_schema_versions() for lots of uninstalled modules, leading to a performance hit. --- includes/update.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/update.inc b/includes/update.inc index f89fea9bab..6b700700c1 100644 --- a/includes/update.inc +++ b/includes/update.inc @@ -977,10 +977,13 @@ function update_get_update_list() { $modules = drupal_get_installed_schema_version(NULL, FALSE, TRUE); foreach ($modules as $module => $schema_version) { - $pending = array(); + // Skip uninstalled and incompatible modules. + if ($schema_version == SCHEMA_UNINSTALLED || update_check_incompatibility($module)) { + continue; + } + // Otherwise, get the list of updates defined by this module. $updates = drupal_get_schema_versions($module); - // Skip incompatible module updates, otherwise test schema versions. - if (!update_check_incompatibility($module) && $updates !== FALSE && $schema_version >= 0) { + if ($updates !== FALSE) { // module_invoke returns NULL for nonexisting hooks, so if no updates // are removed, it will == 0. $last_removed = module_invoke($module, 'update_last_removed'); -- GitLab