function trigger_assign_form_validate

7.x trigger_assign_form_validate($form, $form_state)

Form validation handler for trigger_assign_form().

Makes sure that the user is not re-assigning an action to an event.

See also


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


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


function trigger_assign_form_validate($form, $form_state) {
  $form_values = $form_state['values'];
  if (!empty($form_values['aid'])) {
    $aid = actions_function_lookup($form_values['aid']);
    $aid_exists = db_query("SELECT aid FROM {trigger_assignments} WHERE hook = :hook AND aid = :aid", array(
      ':hook' => $form_values['hook'],
      ':aid' => $aid,
    if ($aid_exists) {
      form_set_error($form_values['hook'], t('The action you chose is already assigned to that trigger.'));