Skip to content

Commit

Permalink
Alter the install tasks in instead
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpott committed Feb 14, 2024
1 parent bcb37af commit 294370d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions thunder.profile
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,26 @@ function thunder_form_install_configure_form_alter(array &$form, FormStateInterf
}

/**
* Implements hook_install_tasks().
* Implements hook_install_tasks_alter().
*/
function thunder_install_tasks(array &$install_state): array {
$tasks = [];
function thunder_install_tasks_alter(array &$tasks, array $install_state) {
if (empty($install_state['config_install_path'])) {
$tasks['thunder_module_configure_form'] = [
$thunder_tasks = [];
$thunder_tasks['thunder_module_configure_form'] = [
'display_name' => t('Configure additional modules'),
'type' => 'form',
'function' => ModuleConfigureForm::class,
];
$tasks['thunder_module_install'] = [
$thunder_tasks['thunder_module_install'] = [
'display_name' => t('Install additional modules'),
'type' => 'batch',
];
// Ensure our tasks come before the install_finished task.
$key = array_search('install_finished', array_keys($tasks), TRUE);
$tasks = array_slice($tasks, 0, $key, TRUE) +
$thunder_tasks +
array_slice($tasks, $key, NULL , TRUE);

Check failure on line 44 in thunder.profile

View workflow job for this annotation

GitHub Actions / drupal-coder (drupal)

[drupal-coder (drupal)] thunder.profile#L44 <Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma>

Space found before comma in argument list
Raw output
/github/workspace/thunder.profile:44:38: error: Space found before comma in argument list (Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma)
}
return $tasks;
}

/**
Expand Down

0 comments on commit 294370d

Please sign in to comment.