Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.In trying to prepare for running different drush's depending on what site we are on, I thought the time has come to fix the hard coded "provision-$TYPE" drush command.
For those that don't know, when you implement hook_hosting_tasks(), your task type's name must match a drush command "provision-$TYPE". It's automatic. No way to override it.
What I would like to do is allow hook_hosting_tasks() to define the "command" it should run, making simpler tasks possible.
For instance:
function hook_hosting_tasks() {
$tasks['site']['sanitize'] = array(
'title' => t('Sanitize Database'),
'description' => t('Clean out your sites database by running drush sql-sanitize'),
'dialog' => TRUE,
'command' => 'sql-sanitize',
);
return $options;
}










Comments
Comment #2
Jon PughComment #3
Jon Pugh---
Comment #4
Jon PughComment #6
colanMaybe we can get the sanitizing done in #2888523: Add "Sanitize database" site task.
Comment #8
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedThis is a good preparation for provision 4.x .... And as it can be used today for e.g. #2888523: Add "Sanitize database" site task I suggest we merge it into 3.14.
Comment #10
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedMerged
Comment #11
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedThis seems to have caused a regression: #2942500: Upgrade to 3.14.0 issue on a missing task_command property