Commit 3af8f883 authored by Grimreaper's avatar Grimreaper Committed by helmo

Issue #2850164 by Grimreaper: Detect disabled module on Drupal 8 sites

parent 9f2b6a5d
...@@ -91,17 +91,26 @@ function _provision_drupal_system_map() { ...@@ -91,17 +91,26 @@ function _provision_drupal_system_map() {
*/ */
function _provision_system_query($type) { function _provision_system_query($type) {
$packages = array(); $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); $package->filename = drupal_get_filename($type, $name);
$frags = explode("/", $package->filename); $frags = explode("/", $package->filename);
// Flag site-specific packages. // Flag site-specific packages.
if ($frags[0] == 'sites' && $frags[1] != 'all') { if ($frags[0] == 'sites' && $frags[1] != 'all') {
$package->platform = -1; $package->platform = -1;
} }
// In Drupal 8, system_get_info returns enabled modules/themes. $package->status = $extension_data->status;
$package->status = 1;
$package->filename = realpath($package->filename); $package->filename = realpath($package->filename);
if ($type == 'module') { if ($type == 'module') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment