diff --git a/farm.install b/farm.install index 142d6521..2dc64a67 100644 --- a/farm.install +++ b/farm.install @@ -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', [ diff --git a/src/Form/FarmModulesForm.php b/src/Form/FarmModulesForm.php index ab774b9d..33cf0c31 100644 --- a/src/Form/FarmModulesForm.php +++ b/src/Form/FarmModulesForm.php @@ -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); }