fix: #3628164 Podcast views repeat episodes and inflate counts on multilingual sites (2.0.x)
Issue: https://www.drupal.org/project/varbase_podcasts_base/issues/3628164
Forward-port of !18 (merged) (merged on 1.0.x) to 2.0.x, the line The Rightup installs (~2.0.0). The two displays are the same on both lines except for this fix, so the change is the same two edits in config/:
views.view.podcast_episodes.yml, displaymore_by_podcast: stop inheriting the default filters and query (defaults.filters: false,defaults.query: false) and set its own: the three default filters (type, langcode, status), a langcode filter on thefield_podcastrelationship and one onreverse__node__field_podcast(interface language,und,zxx), and a distinct query.views.view.podcasts.yml: the Episodes count on thereverse__node__field_podcastrelationship aggregates ascount_distinctinstead ofcount.
Why: both relationships join every translation of the related node, and only the base table was filtered by language, so the rail repeated an episode and the cards counted each episode once per translation (19 episodes read as 76). The 2.0.x count_by_podcast display has no relationships, so it is not affected.
Checked: the two YAML files parse, and applied on a Rightup 1.0.x site (English and Arabic installed, podcasts not translated) the podcasts listing counts (19, 10, 8, 10, 10, 10), the More episodes block (three other episodes), and the English and Arabic pages render exactly as before, with no new log entries. The multilingual behaviour itself was verified on !18 (merged) with translated shows and episodes. Not re-verified here: translated podcasts on 2.0.x; the merge request pipeline runs the suite.
AI-Generated: Yes
Checkpoints:
- File an issue
- Addition/Change/Update/Fix
- Testing to ensure no regression
- Automated unit testing coverage
- Automated functional testing coverage
- UX/UI designer responsibilities
- Readability
- Accessibility
- Performance
- Security
- Developer Documentation
- User Guide Documentation
- Reviewed by human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Release notes snippet
- Release