1 path.admin.inc path_bulk_update_form_validate($form, &$form_state)

Validate handler for URL alias bulk generate form.

See also

path_bulk_update_form()

path_bulk_update_form_generate_submit()

File

core/modules/path/path.admin.inc, line 792
Admin page callbacks for the Path module.

Code

function path_bulk_update_form_validate($form, &$form_state) {
  $selected = array();
  $reset_errors = array();
  // At least one update checkbox must be checked.
  if (isset($form_state['values']['update'])) {
    foreach ($form_state['values']['update'] as $entity_type) {
      $values = array_filter($entity_type);
      if (!empty($values)) {
        $selected[] = $values;
      }
    }
    if (!$selected) {
      form_set_error('update', t('You must select an alias to update.'));
    }
  }
}