From c7732732f93627eb5cb458e15f1b2b6af7ae36c0 Mon Sep 17 00:00:00 2001 From: florenttorregrosa Date: Tue, 7 Feb 2017 13:14:16 +0100 Subject: [PATCH] Issue #2850164 by Grimreaper: Detect disabled module on Drupal 8 sites --- platform/drupal/packages_8.inc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/platform/drupal/packages_8.inc b/platform/drupal/packages_8.inc index 272c3a6..f8d901c 100644 --- a/platform/drupal/packages_8.inc +++ b/platform/drupal/packages_8.inc @@ -91,17 +91,26 @@ function _provision_drupal_system_map() { */ function _provision_system_query($type) { $packages = array(); - foreach (system_get_info($type) as $name => $package) { - $package = (object) $package; + + if ($type == 'theme') { + /** @var \Drupal\Core\Extension\Extension[] $extensions_data */ + $extensions_data = \Drupal::service('theme_handler')->rebuildThemeData(); + } + // Modules. + else { + /** @var \Drupal\Core\Extension\Extension[] $extensions_data */ + $extensions_data = system_rebuild_module_data(); + } + + foreach ($extensions_data as $name => $extension_data) { + $package = (object) $extension_data->info; $package->filename = drupal_get_filename($type, $name); $frags = explode("/", $package->filename); // Flag site-specific packages. if ($frags[0] == 'sites' && $frags[1] != 'all') { $package->platform = -1; } - // In Drupal 8, system_get_info returns enabled modules/themes. - $package->status = 1; - + $package->status = $extension_data->status; $package->filename = realpath($package->filename); if ($type == 'module') { -- 1.9.1