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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | l10n-for-term-names-as-contextual-arg-2179909-3.patch | 1.52 KB | johan.gant |
| #2 | replace-translated-term-name-spaces-with-dashes-2179909-2.patch | 1021 bytes | johan.gant |
| #1 | i18nviews-2179909.patch | 1.37 KB | alexfarr |
Comments
Comment #1
alexfarr commentedComment #2
johan.gant commentedGah, 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
Comment #3
johan.gant commentedHmm, 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.
Comment #4
ram4nd commentedTested and worked for me on: LsLight | Ledshop OÜ
Comment #5
vasikei confirm both the issue and solution