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

dpearcefl’s picture

Is this still an issue using current Drupal 6?

alcroito’s picture

It probably does, but the thread is 3 years old, and I found a workaround at the time.

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.