Automattic / Automattic/jetpack

Related posts module and WPML compatibility (or general multilingual compatibility)

Open
#6,341 21 comments 2 reactions 0 assignees View on GitHub
[Feature] Related Posts [Focus] Compatibility [Pri] Normal Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Steps to reproduce the issue

1. Install WPML bundle and Jetpack
2. Add 10+ dummy posts and translate them with WPML
3. Open one of the posts and observe "Related Posts" section

#### What I expected

It is expected that "Related Posts" module show three related posts in a proper language (currently selected one).

#### What happened instead

Posts in all languages are shown.

#### NOTES

I've dug a bit, and noticed that you are getting back JSON response through REST from the ElasticSearch service, where the actual issue lay.

Since JSON is returning post IDs from all languages there was no point for filtering them in your code, which was the first thing that came to my mind.

Can you help me out with this one?

Warm regards
Vuk

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with WPML and Jetpack, then inspect the Related Posts module and the REST JSON response from the ElasticSearch service. Trace where post IDs are returned and determine how the selected language should be represented; done means the module shows three related posts in the current language.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, php
Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.