- πΊπΈUnited States smustgrave
Wonder of 10+ years of inactivity if this is still a desired feature request for D10?
In the past week, I have had two projects where I needed to use hook_form_alter() to add a submit handler to a form. Problem is, I need the submit handler to fire in a particular order with regard to both the base form and any other hook_form_alter() implementations.
Right now, AFAIK, #submit is just a positional array, and you have to do some nasty sorting of that array in order to manipulate the execution order of your handler.
Proposal is to add an #order or #execution_order parameter to the #submit element, so that we can fine-tune the sort on these elements.
E.g.
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
'#order' => 0, // defaults to zero if not set
);
$form['#submit'][] = array(
'#callback' => 'mycallback_submit',
'#order' => -5, // We always runs before anything else!
);
We would then modify form_execute_handlers() to sort based on this value.
Postponed: needs info
9.5
Last updated
Enhances developer experience.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Wonder of 10+ years of inactivity if this is still a desired feature request for D10?