function ArgumentPluginBase::validateMenuArgument

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::validateMenuArgument()
  2. 10 core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::validateMenuArgument()
  3. 11.x core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::validateMenuArgument()

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

core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php, line 1018

Class

ArgumentPluginBase
Base class for argument (contextual filter) handler plugins.

Namespace

Drupal\views\Plugin\views\argument

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.