You are here

public function views_handler_argument::validate_argument in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 handlers/views_handler_argument.inc \views_handler_argument::validate_argument()
  2. 6.2 handlers/views_handler_argument.inc \views_handler_argument::validate_argument()

Called by the menu system to validate an argument.

This checks to see if this is a 'soft fail', which means that if the argument fails to validate, but there is an action to take anyway, then validation cannot actually fail.

File

handlers/views_handler_argument.inc, line 1082
Definition of views_handler_argument.

Class

views_handler_argument
Base class for arguments.

Code

public function validate_argument($arg) {
  $validate_info = $this
    ->default_actions($this->options['validate']['fail']);
  if (empty($validate_info['hard fail'])) {
    return TRUE;
  }
  $rc = $this
    ->validate_arg($arg);

  // If the validator has changed the validate fail condition to a soft fail,
  // deal with that.
  $validate_info = $this
    ->default_actions($this->options['validate']['fail']);
  if (empty($validate_info['hard fail'])) {
    return TRUE;
  }
  return $rc;
}