You are here

function ArgumentPluginBase::validate_argument in Views (for Drupal 7) 8.3

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

lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php, line 959
Definition of Drupal\views\Plugin\views\argument\ArgumentPluginBase.

Class

ArgumentPluginBase
Base class for arguments.

Namespace

Drupal\views\Plugin\views\argument

Code

function validate_argument($arg) {
  $validate_info = $this
    ->default_actions($this->options['validate']['fail']);
  if (empty($validate_info['hard fail'])) {
    return TRUE;
  }
  $rc = $this
    ->validateArgument($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;
}