Only provide an array of module names to install.

This commit is contained in:
paul121 2021-02-25 17:03:29 -08:00 committed by Michael Stenta
parent f360de1ea1
commit 1f3273a7eb
2 changed files with 3 additions and 2 deletions

View File

@ -68,7 +68,7 @@ function farm_install_modules(array &$install_state) {
// Assemble the batch operation for installing modules.
$operations = [];
foreach ($modules as $module => $weight) {
foreach ($modules as $module) {
$operations[] = [
'_farm_install_module_batch',
[

View File

@ -115,7 +115,8 @@ class FarmModulesForm extends FormBase {
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$modules = array_filter($form_state->getValue('modules'));
// Build array of module names to install.
$modules = array_values(array_filter($form_state->getValue('modules')));
$this->state->set('farm.install_modules', $modules);
}