I have found an issue which causes the contextual filter validation to fail when using a localised term.
The contextual filter validation "filter value type": Localised Term name/synonym converted to Term ID) and "Transform dashes in URL to spaces in term name filter values" option selected.

I have had a rummage around and it looks like the validate_argument function in the i18nviews_plugin_argument_validate_i18n_taxonomy_term class is passing the dashed version of the term name to the i18nviews_locale_source function. The i18nviews_locale_source function does not know about the dashes and return no results causing the validation to fail.

I have created a patch that will pass in a un-dashed, ie original version and then re-dash the localised term. This allows the i18nviews_locale_source function to correctly match the translation and everything then passes.

This might not be best practice fix and another approach might be better, opinions.

Comments

alexfarr’s picture

StatusFileSize
new1.37 KB
johan.gant’s picture

Gah, pleased to see someone else has hit this issue too! Couldn't get the patches to apply cleanly - looks like repo paths are based on the original site project this module was used in and not just the root of the module itself. Re-rolled against 7.x-3.x-dev.

Cheers

johan.gant’s picture

Status: Active » Needs review
StatusFileSize
new1.52 KB

Hmm, last patch didn't work for localised term names with > 1 word. I had to convert dashes to spaces for the purposes of localisation matching, then convert back to allow the remaining query to match against the original term name.

Re-rolled the patch against 7.x-3.x.

ram4nd’s picture

Status: Needs review » Reviewed & tested by the community

Tested and worked for me on: LsLight | Ledshop OÜ

vasike’s picture

i confirm both the issue and solution