You are here

function _comment_alter_validate_node_fields in Comment Alter 7

Validation callback for the altered comment form.

Calls form_attach_form_validate() for each of the alterable node fields.

See also

form_attach_form_validate()

comment_alter_form_comment_form_alter()

1 string reference to '_comment_alter_validate_node_fields'
comment_alter_form_comment_form_alter in ./comment_alter.module
Implements hook_form_BASE_FORM_ID_alter().

File

./comment_alter.module, line 328
Provides UI to alter nodes' parameters from comment forms.

Code

function _comment_alter_validate_node_fields($form, &$form_state) {
  $node = clone $form_state['node'];
  foreach ($form_state['values']['comment_alter']['fields'] as $field_name) {
    field_attach_form_validate('node', $node, $form, $form_state, array(
      'field_name' => $field_name,
    ));
  }
}