function trigger_assign_form_submit

cis7 trigger_assign_form_submit($form, &$form_state)
cle7 trigger_assign_form_submit($form, &$form_state)
elmsmedia7 trigger_assign_form_submit($form, &$form_state)
icor7 trigger_assign_form_submit($form, &$form_state)
meedjum_blog7 trigger_assign_form_submit($form, &$form_state)
mooc7 trigger_assign_form_submit($form, &$form_state)

Form submission handler for trigger_assign_form().

See also


1 string reference to 'trigger_assign_form_submit'
trigger_assign_form in modules/trigger/
Returns the form for assigning an action to a trigger.


modules/trigger/, line 231
Admin page callbacks for the trigger module.


function trigger_assign_form_submit($form, &$form_state) {
  if (!empty($form_state['values']['aid'])) {
    $aid = actions_function_lookup($form_state['values']['aid']);
    $weight = db_query("SELECT MAX(weight) FROM {trigger_assignments} WHERE hook = :hook", array(':hook' => $form_state['values']['hook']))->fetchField();

    // Insert the new action.
      'hook' => $form_state['values']['hook'],
      'aid' => $aid,
      'weight' => $weight + 1,

    // If we are not configuring an action for a "presave" hook and this action
    // changes an object property, then we need to save the object, so the
    // property change will persist.
    $actions = actions_list();
    if (strpos($form_state['values']['hook'], 'presave') === FALSE && isset($actions[$aid]['behavior']) && in_array('changes_property', $actions[$aid]['behavior'])) {
      // Determine the corresponding save action name for this action.
      $save_action = strtok($aid, '_') . '_save_action';
      // If no corresponding save action exists, we need to bail out.
      if (!isset($actions[$save_action])) {
        throw new Exception(t('Missing/undefined save action (%save_aid) for %aid action.', array('%save_aid' => $aid, '%aid' => $aid)));
      // Delete previous save action if it exists, and re-add it using a higher
      // weight.
      $save_action_assigned = db_query("SELECT aid FROM {trigger_assignments} WHERE hook = :hook AND aid = :aid", array(':hook' => $form_state['values']['hook'], ':aid' => $save_action))->fetchField();

      if ($save_action_assigned) {
        db_delete('trigger_assignments')->condition('hook', $form_state['values']['hook'])->condition('aid', $save_action)->execute();
        'hook' => $form_state['values']['hook'],
        'aid' => $save_action,
        'weight' => $weight + 2,

      // If no save action existed before, inform the user about it.
      if (!$save_action_assigned) {
        drupal_set_message(t('The %label action has been appended, which is required to save the property change.', array('%label' => $actions[$save_action]['label'])));
      // Otherwise, just inform about the new weight.
      else {
        drupal_set_message(t('The %label action was moved to save the property change.', array('%label' => $actions[$save_action]['label'])));



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.