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

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. // Assemble the batch operation for installing modules.
$operations = []; $operations = [];
foreach ($modules as $module => $weight) { foreach ($modules as $module) {
$operations[] = [ $operations[] = [
'_farm_install_module_batch', '_farm_install_module_batch',
[ [

View file

@ -115,7 +115,8 @@ class FarmModulesForm extends FormBase {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function submitForm(array &$form, FormStateInterface $form_state) { 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); $this->state->set('farm.install_modules', $modules);
} }