You are here

function commons_bw_partial_node_form_validate in Drupal Commons 7.3

Validation handler; Attach the node validation to the partial node form.

1 string reference to 'commons_bw_partial_node_form_validate'
commons_bw_partial_node_form in modules/commons/commons_bw/commons_bw.module
Partial node form for the browsing widget.

File

modules/commons/commons_bw/commons_bw.module, line 291

Code

function commons_bw_partial_node_form_validate($form, $form_state) {
  $node = $form['#entity'];
  field_attach_validate('node', $node);
  node_validate($node, $form, $form_state);
  if ((!module_exists('commons_trusted_contacts') || module_exists('commons_trusted_contacts') && !module_exists('og_access')) && empty($form_state['group_id']) && empty($form_state['values'][OG_AUDIENCE_FIELD][LANGUAGE_NONE][0])) {
    form_set_error(OG_AUDIENCE_FIELD, t('Please enter one or more groups where this content will be posted.'));
    return FALSE;
  }
}