The richness of Views never ceases to amaze me, thanks so much for your ongoing work and for pushing it into D8.

Today I believe I've found something strange.

This is NOT about taxonomy terms.
This is about contextual string filters, in particular file views/handlers/

On the from that it produces is a tickbox "Transform spaces to dashes in URL", which sets $this->options['transform_dash'] accordingly.
Curiously, elsewhere in that same file the code seems to do the opposite of what the label suggests: it converts dashes to spaces in TWO places:

  function query($group_by = FALSE) {
    $argument = $this->argument;
    if (!empty($this->options['transform_dash'])) {
      $argument = strtr($argument, '-', ' ');

  function title() {
    $this->argument = $this->case_transform($this->argument, $this->options['case']);
    if (!empty($this->options['transform_dash'])) {
      $this->argument = strtr($this->argument, '-', ' ');

However, still in the same file we have the third and final transformation:

  function summary_argument($data) {
    $value = $this->case_transform($data->{$this->base_alias}, $this->options['path_case']);
    if (!empty($this->options['transform_dash'])) {
      $value = strtr($value, ' ', '-');
    return $value;

So, I'm confused.
What is this option really meant to do? What would you use it for and shouldn't all transformations be from SPACE to DASH, rather than DASH to SPACE ?



RdeBoer’s picture

As an aside... I find it odd the title() function shown above actually changes $this->argument, rather than just putting the result of the transformation in a local variable, which is what query() does.

RdeBoer’s picture

Issue summary:View changes