The Term Name Argument Validator for Views Contextual Filters Does Not Work with Translations

Created on 1 November 2018, about 6 years ago
Updated 11 May 2023, over 1 year ago

The taxonomy module's Taxonomy Term Name validator for views contextual filters (located here: core/modules/taxonomy/src/Plugin/views/argument_validator/TermName.php) does not work with translations.

From TermName.php:

  public function validateArgument($argument) {
    if ($this->options['transform']) {
      $argument = str_replace('-', ' ', $argument);
      $this->argument->argument = $argument;
    }
    $terms = $this->termStorage->loadByProperties(['name' => $argument]);

The problem is present whether or not the transform option is selected, it seems that loading by name is where this fails.

Steps to Reproduce:

  1. Enable translation and translate one content type with a term reference field; also translate the vocabulary
  2. Build a view of that content type and add a relationship to the term referenced by the term reference field; the view should have a filter for translation language
  3. Add a "Name" contextual filter, using the relationship
  4. Select the Taxonomy Term Name validator
  5. In the preview, attempt to filter by the translated term name

I have described this issue in more detail here: https://drupal.stackexchange.com/questions/271754/multiple-relations-and...

πŸ› Bug report
Status

Active

Version

9.5

Component
TaxonomyΒ  β†’

Last updated about 13 hours ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @xjm
  • πŸ‡¬πŸ‡§United Kingdom @catch
Created by

πŸ‡ΊπŸ‡ΈUnited States andileco

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024