3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

The ModuleExtensionList class is not stable. Use the module_handler service to get module names.

This commit is contained in:
paul121 2020-09-10 11:32:47 -07:00
parent acdc090ca2
commit 0826801293
2 changed files with 3 additions and 6 deletions

View file

@ -56,7 +56,7 @@ function farm_install_modules(array &$install_state) {
$modules = \Drupal::state()->get('farm.install_modules') ?: [];
// Load a list of all available modules, so that we can display their names.
$files = \Drupal::service('extension.list.module')->getList();
$module_handler = \Drupal::service('module_handler');
// Assemble the batch operation for installing modules.
$operations = [];
@ -65,7 +65,7 @@ function farm_install_modules(array &$install_state) {
'_farm_install_module_batch',
[
$module,
$files[$module]->info['name'],
$module_handler->getName($module),
],
];
}

View file

@ -91,15 +91,12 @@ class FarmSettingsModulesForm extends FarmModulesForm {
return;
}
// Load a list of all available modules, so that we can display their names.
$files = \Drupal::service('extension.list.module')->getList();
// Assemble the batch operation for installing modules.
$operations = [];
foreach ($modules as $module => $weight) {
$operations[] = [
[__NAMESPACE__ . '\FarmSettingsModulesForm', 'farmInstallModuleBatch'],
[$module, $files[$module]->info['name']],
[$module, $this->moduleHandler->getName($module)],
];
}
$batch = [