Problem/Motivation

I have multilingual content and if I search text in translations, it is not found.

Steps to reproduce

Have a translatable content type and add content in different languages. Search for text that is available in the translation. It will not get listed.

Proposed resolution

The entity query returns the translations, but when parsing the results the original node is always loaded. In this way the translations are never taken into account.

Remaining tasks

Take translations into account when processing the text of the found content.

CommentFileSizeAuthor
#2 scanner-text_not_found-3266343-2.patch5.09 KBcgoffin

Issue fork scanner-3266343

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

cgoffin created an issue. See original summary.

cgoffin’s picture

StatusFileSize
new5.09 KB

Here a patch to fix this problem.

cgoffin’s picture

Status: Active » Needs review
smustgrave’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Status: Needs review » Needs work

Lets update for 2.0.x and add some test coverage

flagbrad’s picture

Issue tags: +Needs tests

Adding a tag for test coverage per @smustgrave

flagbrad changed the visibility of the branch 3266343-text-not-found to hidden.

yesct’s picture

me, https://www.drupal.org/u/javi-er , https://www.drupal.org/u/rfay helped mentor Brad. Thanks Brad! ping us later if we can help more!

flagbrad’s picture

Issue tags: +Atlanta2025

Worked on this at DrupalCon Atlant 2025 as a first contribution. I had noted this issue 8 months ago and thought I'd try addressing it since my website has 27 languages and runs into this problem all the time.

Got the issue fork caught up (rebased, essentially) to the 2.0.x main branch. Still needs work because (a) logic is still incomplete, (b) probably way too few guards or null checks, and (c) needs test coverage. Thanks to mentors Randy Fay and Cathy T and Javier!

damienmckenna’s picture

I think some test coverage would help with this.

damienmckenna’s picture

Can you please test the current 2.0.x dev version to see if this is still a problem?