The term name argument validator has an option to convert dashes to spaces in the argument value, which means that you can have a URL like 'myview/term-name-with-spaces'.

The argument validator handles this correctly, but the query that is run with this by the term name argument is incorrect. With a simple view of article nodes and the tags field that comes OOTB with core, I get this clause in the query:

WHERE (( (taxonomy_term_field_data_node__field_tags.name = 'has-spaces') )AND(( (node_field_data.status = '1') )))
ORDER BY node_field_data_created DESC

Argument validator plugins only return a boolean from validateArgument(), but on D7 the equivalent function views_plugin_argument_validate_taxonomy_term::validate_argument() doctored the argument value on the argument handler like this:

        if ($term && (empty($vocabularies) || !empty($vocabularies[$term->machine_name]))) {
          if ($type == 'convert') {
            $this->argument->argument = $term->tid;
          }

There doesn't seem to be any provision for this in D8 -- argument validator plugins don't seem to be able to influence the argument value that the rest of the view uses.

Comments

joachim created an issue. See original summary.

joachim’s picture

Issue summary: View changes

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

xjm’s picture

@dawehner, @tim.plunkett, @alexpott, @cilefen, and I discussed this issue awhile back. We saw cases both for the issue to be major and for it to be normal. It could be a real pain point, but the available workaround is not use the feature or to have different aliases. So, deferring triage for now. It definitely is a bug.

I was surprised that there are no earlier copies of this issue, but I could not find any.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tea.time’s picture

Just to note, I'm on Drupal 8.3.0, and this works for me... (see screenshot)

johnny5th’s picture

This does not work for me on 8.3.2