Commit ecd3ac8b authored by memtkmcc's avatar memtkmcc

Issue #3149961: system_rebuild_module_data() is deprecated in D8 and removed in D9

parent 74990e19
......@@ -101,12 +101,20 @@ function _provision_system_query($type) {
if ($type == 'theme') {
/** @var \Drupal\Core\Extension\Extension[] $extensions_data */
// Could be replaced with:
// \Drupal::service('extension.list.theme')->reset()
// \Drupal::service('extension.list.theme')->getList()
// https://www.drupal.org/project/drupal/issues/2942001
$extensions_data = \Drupal::service('theme_handler')->rebuildThemeData();
}
// Modules.
else {
/** @var \Drupal\Core\Extension\Extension[] $extensions_data */
$extensions_data = system_rebuild_module_data();
// $extensions_data = system_rebuild_module_data();
// system_rebuild_module_data() is deprecated in D8 and removed in D9
// https://www.drupal.org/project/drupal/issues/2926068
$extensions_rset = \Drupal::service('extension.list.module')->reset();
$extensions_data = \Drupal::service('extension.list.module')->getList();
}
foreach ($extensions_data as $name => $extension_data) {
......
......@@ -4,7 +4,18 @@
* Find modules, themes and themes engines
*/
if (drush_drupal_major_version() >= 7) {
if (drush_drupal_major_version() >= 8) {
// system_rebuild_module_data() is deprecated in D8 and removed from D9
// https://www.drupal.org/project/drupal/issues/2926068
$extensions_rset = \Drupal::service('extension.list.module')->reset();
drush_set_option('modules', _scrub_object(\Drupal::service('extension.list.module')->getList()), 'site');
// Could be replaced with:
// \Drupal::service('extension.list.theme')->reset()
// \Drupal::service('extension.list.theme')->getList()
// https://www.drupal.org/project/drupal/issues/2942001
drush_set_option('themes', _scrub_object(\Drupal::service('theme_handler')->rebuildThemeData()), 'site');
}
elseif (drush_drupal_major_version() == 7) {
drush_set_option('modules', _scrub_object(system_rebuild_module_data()), 'site');
drush_set_option('themes', _scrub_object(system_rebuild_theme_data()), 'site');
}
......
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