You are here

function heartbeat_comments_admin_overview_validate in Heartbeat 7

Same name and namespace in other branches
  1. 6.4 modules/heartbeat_comments/heartbeat_comments.admin.inc \heartbeat_comments_admin_overview_validate()

Validate heartbeat_comments_admin_overview form submissions.

We can't execute any 'Update options' if no comments were selected.

File

modules/heartbeat_comments/heartbeat_comments.admin.inc, line 92
Admin page callbacks for the heartbeat comments module.

Code

function heartbeat_comments_admin_overview_validate($form, &$form_state) {
  $form_state['values']['heartbeat_comments'] = array_diff($form_state['values']['heartbeat_comments'], array(
    0,
  ));
  if (count($form_state['values']['heartbeat_comments']) == 0) {
    form_set_error('', t('Please select one or more comments to perform the update on.'));
    drupal_goto('admin/content/heartbeat/comments');
  }
}