Active
Project:
Views (for Drupal 7)
Version:
7.x-3.23
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Apr 2013 at 16:59 UTC
Updated:
2 Aug 2019 at 15:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
svouthi commentedI am having the reverse issue with Views 7.x-3.8 when using Taxonomy term: Name as a contextual filter. This works fine for me except when a term has a space in it. This despite having checked the validator specified as you have and the "Transform dashes in URL to spaces in term name filter values" box checked.
I am appending taxonomy term field values (via the Taxonomy term: Parent term relationship) to the URL to trigger the contextual filter above, and have checked "Convert spaces in term names to hyphens" in its settings as well. The hyphens/dashes are there, but they aren't being translated properly to my terms with spaces.
Comment #2
svouthi commentedAn update - a more experienced acquaintance of mine tested this with Views 7.x-3.8 also and had the same result using Taxonomy: Term ID with the validation criteria specified as Taxonomy Term, the taxonomy vocabulary, Filter Value Type: Term name converted to Term ID, and "Convert spaces in term names to hyphens" checked.
I should mention that neither of us are using view panes.
Comment #3
svouthi commentedComment #4
Road Kill commentedFirst just a big thank you to all the people involved in the Views module you make a lot of what I do in Drupal possible. I have created a content type called brochure for uploading a brochure in pdf format which can then be downloaded from the website.
In the view I have two fields one is and icon field and the other is a file field. The file field formatter is set to URL to file and has been placed above the icon field with the file field excluded from display enabled.
In the icon field I have used a file field replacement pattern in the link path with replace spaces with dashes and transform the case set as lower case.
The replace spaces with dashes is not working. When I hover over the icon the URL structure is perfect except that the spaces have no dash which creates a 404 error when the icon is clicked.
I have done this hundreds of time but now for some reason replace spaces with dashes is not working.
My pdf structure looks something like this Test brochure 2016.pdf
I have attached my view should you need to see the structure.
Comment #5
calefilm commentedI figured out a solution to my problem (same as #2):
In view, add relationship: Content: Taxonomy terms on node
In contextual filters, select: Taxonomy term: Term ID
edit contextual filter: Taxonomy term: Term ID
Specify validation criteria: Taxonomy term
select vocabulary
filter value type: term name converted to Term ID
select: Transform dashes in URL to spaces in term name filter values
lastly, i needed to provide a default value to accompany my term's placement in the url
Comment #6
summit commentedHi, using latest D7 views and latest drupal version.
I am exactly doing what is said on latest on this thread. I made the contextual filter as such.
Terms like A6 are correctly recognised, terms like A75 - Clermont-Ferrand - Béziers are not recognized.
What can I do to let the view recognize A75 - Clermont-Ferrand - Béziers. It has dashes, spaces and special character...
Thanks a lot for your reply
Comment #7
brankoc commentedI have been able to reproduce this, but (so far) only if there were two near identical term names, where the difference was that one had a hyphen where another did not.
Let us say you have two nodes, one called Foo and the other called Bar. Foo has an associated term called 'a 1' and Bar has an associated term called 'a-1', then the view as described in #5 will only return the node associated with the term that was defined first.
I believe this may be because the validation code that expects a term name, only expects one term name, whereas the actual database statement may fit multiple term names.
In the example given above, the database statement
SELECT * FROM `taxonomy_term_data` WHERE replace(name, ' ', '-') = 'a-1'will return two rows, one containing the term 'a 1' and the other containing the term 'a-1'.The code in views/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc does not appear to iterate through the result, but appears to only look at the first result.
I just realised that what I am describing here is probably not the problem that the issue reporter had (especially since #5 describes his view as a solution).