The string argument has a couple of settings affecting the final URL path when used with a page display: Case in path and Transform spaces to dashes in URL. Views TPO does not take them into account and always uses the original term name.

CommentFileSizeAuthor
#1 views_tpo-832320-1.patch1.17 KBplach

Comments

plach’s picture

Status: Active » Fixed
StatusFileSize
new1.17 KB

Committed the attached patch to HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bohz’s picture

HI!
sorry to reopen...
I have the latest version installed and still got this problem:
my terms are composed of multiple words separated by spaces, like "my term"
views_tpo works only if I leave the argument transformation settings as default.
This results in urls like "/my%20Term" which is not desiderable.

if I try to change the case or convert spaces to dashes I get page not found.
I have checked and the above patch seems to be included in the module files...

Any suggestion?

TIA
Cheers

plach’s picture

I suspect this might be a Views bug, please check the following: set up a Views summary for the same argument you are using to override the term paths. Then check that the links work and/or that they are identical to the term links produced by Views TPO. If they match and the summary links lead to a 404 page too, it's a Views bug.

bohz’s picture

Thanks for the prompt reply!! :)

I have done as suggested but, AFAIK, in order to set up a views summary, the argument should NOT be present. therefore I cannot check if it's printed correctly or if the paths work...

What I did:
- deselected views_tpo checkbox
- set the view to display a summary if argument is not present.
- modified the argument transformation settings
in the page preview i see the list of terms unchanged with paths unchanged (working)

Thanks again!

plach’s picture

Ok, that's what I meant you to set up.

in the page preview i see the list of terms unchanged with paths unchanged (working)

Do you mean that summary links do not respond to the transformation settings?

bohz’s picture

My bad, I had changed settings for the default display.
Now I have more problems :)

- the summary view has indeed changed case/dashes in links and paths but the links lead to the same view!
that is: mysite/viewpath leads to mysite/viewpath/my-term but still displays the summary with all terms.

Moreover, although I have deselected views_tpo and cleared all caches, when I save the argument settings I get

warning: array_keys() [function.array-keys]: The first argument should be an array in mysite\sites\all\modules\views_tpo\includes\views_tpo_handler_taxonomy_term_name.inc on line 130.

warning: array_fill() [function.array-fill]: Number of elements must be positive in mysite\sites\all\modules\views_tpo\includes\views_tpo_handler_taxonomy_term_name.inc on line 131.

warning: array_combine() expects parameter 1 to be array, null given in mysite\sites\all\modules\views_tpo\includes\views_tpo_handler_taxonomy_term_name.inc on line 131.

warning: Invalid argument supplied for foreach() in mysite\sites\all\modules\views_tpo\includes\views_tpo_handler_taxonomy_term_name.inc on line 102.

shall I uninstall views_tpo and reinstall later?

plach’s picture

- the summary view has indeed changed case/dashes in links and paths but the links lead to the same view!
that is: mysite/viewpath leads to mysite/viewpath/my-term but still displays the summary with all terms.

This probably means Views is not recognizing the argument.

Moreover, although I have deselected views_tpo and cleared all caches, when I save the argument settings I get
[...]
shall I uninstall views_tpo and reinstall later?

This is probably related to #871822: Error when trying to select a block display. For your testing purposes uninstalling Views TPO and re-installing it later should work.

bohz’s picture

Thanks plach.

so, it is a views bug: even with views_tpo uninstalled the summary view does not work with changed case/dashes.
do you have any suggestion on how to circumvent urls like this: "My%20Fantastic%20Term" with something more readable and search engine friendly?

As side note: may this be related with misconfigured pathauto?

plach’s picture

so, it is a views bug: even with views_tpo uninstalled the summary view does not work with changed case/dashes.
[...]
As side note: may this be related with misconfigured pathauto?

It's a possibility, but if I recall well I experienced similar problems while working on Views TPO without having Pathauto installed.

do you have any suggestion on how to circumvent urls like this: "My%20Fantastic%20Term" with something more readable and search engine friendly?

IMO the best thing to do is fixing Views (if possible) :)
Please open a bug report or try to find an existing one and link it here for future reference.

bohz’s picture

OK, I'll search if a similar issue has been already opened for views.
In the meantime, thanks a lot for your help.
Have a nice one!