Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The code below is executed each time you create a configurable option. Suppose you add $form_state['rebuild'] = TRUE; to your custom action, when you create a new instance of the action the form appears again, but the actions_save() is executed anyhow. Is there a workaround for this?
function system_actions_configure_submit($form, &$form_state) {
$function = actions_function_lookup($form_state['values']['actions_action']);
$submit_function = $function .'_submit';
// Action will return keyed array of values to store.
$params = $submit_function($form, $form_state);
$aid = isset($form_state['values']['actions_aid']) ? $form_state['values']['actions_aid'] : NULL;
actions_save($function, $form_state['values']['actions_type'], $params, $form_state['values']['actions_description'], $aid);
drupal_set_message(t('The action has been successfully saved.'));
$form_state['redirect'] = 'admin/settings/actions/manage';
}
Comments
Comment #1
dpearcefl CreditAttribution: dpearcefl commentedIs this still an issue using current Drupal 6?
Comment #2
alcroito CreditAttribution: alcroito commentedIt probably does, but the thread is 3 years old, and I found a workaround at the time.