diff --git a/core/modules/taxonomy/src/Plugin/views/argument_validator/TermName.php b/core/modules/taxonomy/src/Plugin/views/argument_validator/TermName.php index 92d985d..a04927d 100644 --- a/core/modules/taxonomy/src/Plugin/views/argument_validator/TermName.php +++ b/core/modules/taxonomy/src/Plugin/views/argument_validator/TermName.php @@ -78,15 +78,13 @@ public function validateArgument($argument) { $terms = $this->termStorage->loadByProperties(array('name' => $argument)); } - if (!empty($terms)) { - // $terms are already bundle tested but we need to test access control. - foreach ($terms as $term) { - if ($this->validateEntity($term)) { + // $terms are already bundle tested but we need to test access control. + foreach ($terms as $term) { + if ($this->validateEntity($term)) { // We only need one of the terms to be valid, so return TRUE when we // find one. return TRUE; - } - } + } } return FALSE; } diff --git a/core/modules/taxonomy/src/Tests/Views/ArgumentValidatorTermNameTest.php b/core/modules/taxonomy/src/Tests/Views/ArgumentValidatorTermNameTest.php index a406115..4619045 100644 --- a/core/modules/taxonomy/src/Tests/Views/ArgumentValidatorTermNameTest.php +++ b/core/modules/taxonomy/src/Tests/Views/ArgumentValidatorTermNameTest.php @@ -8,8 +8,8 @@ namespace Drupal\taxonomy\Tests\Views; use Drupal\Core\Language\LanguageInterface; -use Drupal\views\Views; use Drupal\taxonomy\Entity\Vocabulary; +use Drupal\views\Views; /** * Tests the plugin of the taxonomy: term argument validator.