You are here

function og_form_alter in Organic groups 7

Same name and namespace in other branches
  1. 5.8 og.module \og_form_alter()
  2. 5 og.module \og_form_alter()
  3. 5.2 og.module \og_form_alter()
  4. 5.3 og.module \og_form_alter()
  5. 5.7 og.module \og_form_alter()
  6. 6.2 og.module \og_form_alter()
  7. 6 og.module \og_form_alter()

Implements hook_form_alter().

Add own validation handler to form that might have fields. We don't add it via hook_field_attach_form() since it's to early, and we might override the default validation handler.

See also

drupal_prepare_form().

File

./og.module, line 712
Enable users to create and manage groups with roles and permissions.

Code

function og_form_alter(&$form, $form_state, $form_id) {
  if (!empty($form[OG_AUDIENCE_FIELD])) {
    $form['#validate'][] = 'og_field_widget_form_validate';
  }
}