From 9452975696b65b99f91a162435ebcd7a53372b1a Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 6 Jun 2020 09:11:13 +1000 Subject: [PATCH] [REF] Replace the deprecated system_rebuild_module_data function with equivilant extension.list.module service function calls to be Drupal 9 compatiable --- CRM/Utils/System/Drupal8.php | 2 +- setup/plugins/installDatabase/FlushDrupal8.civi-setup.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/System/Drupal8.php b/CRM/Utils/System/Drupal8.php index 6e42f703b8..f2a0972a45 100644 --- a/CRM/Utils/System/Drupal8.php +++ b/CRM/Utils/System/Drupal8.php @@ -537,7 +537,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { public function getModules() { $modules = []; - $module_data = system_rebuild_module_data(); + $module_data = \Drupal::service('extension.list.module')->reset()->getList(); foreach ($module_data as $module_name => $extension) { if (!isset($extension->info['hidden']) && $extension->origin != 'core') { $extension->schema_version = drupal_get_installed_schema_version($module_name); diff --git a/setup/plugins/installDatabase/FlushDrupal8.civi-setup.php b/setup/plugins/installDatabase/FlushDrupal8.civi-setup.php index 05836729da..c1d57e2f49 100644 --- a/setup/plugins/installDatabase/FlushDrupal8.civi-setup.php +++ b/setup/plugins/installDatabase/FlushDrupal8.civi-setup.php @@ -16,7 +16,7 @@ if (!defined('CIVI_SETUP')) { } \Civi\Setup::log()->info(sprintf('[%s] Flush CMS metadata', basename(__FILE__))); - system_rebuild_module_data(); + \Drupal::service('extension.list.module')->reset(); \Drupal::service('module_installer')->install(['civicrm', 'civicrmtheme']); drupal_flush_all_caches(); civicrm_install_set_drupal8_perms(); -- 2.25.1