Fix locales tag not outputting collection specific term urls #6466
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6418
Fixes #3833
Replaces #4047
Since it's looking likely that there will be a taxonomy overhaul, I figured it's better to just apply a quick workaround into the locales tag, rather than a "proper" fix that'll end up affecting way too many parts of the codebase, and eventually may have not even be needed if taxonomies are changing. That's why #4047 was sitting there for so long - it was too big of a change. Plus I was tired of seeing it sit there.
This PR will make the locales tag compare the ID to the "page" ID. If it's the same term, it'll just use the term object, which will be associated with the collection already and therefore output the collection specific URL.
The downside to this is that if you're using a
taxonomy:foo
tag pair, with alocales
tag inside it, while on a collection specific taxonomy term url... if the page's term is in that loop, it'll output the collection specific url. Super edge case. In that case though, you can addcollection_term_workaround="false"
to the locales tag. Dumb, but hey.