- Issue created by @hchonov
- Status changed to Needs review
over 1 year ago 12:31pm 9 August 2023 - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago 538 pass, 2 fail The last submitted patch, 2: 3380219-1-v1.x.patch, failed testing. View results โ
- Status changed to Needs work
over 1 year ago 9:16am 1 October 2023 - ๐ฆ๐นAustria drunken monkey Vienna, Austria
Thanks for reporting this problem and already providing a patch!
First off, itโs important to note that, in general, no UI text should be present in the indexed HTML contents of an item, since that would lead to useless results. E.g., if your rendered item all contained a โTags:โ field label, then you couldnโt search for the word โtagโ anymore without receiving every single piece of content as a result.
However, some setups of course use rendered fields in the index just as a storage, sort of a cache, to be able to display results faster, without loading the entity. In this case, of course, you want the HTML exactly as it appears on the page, including all UI text. And then I guess you will run into this problem.Regarding your patch: Iโm always very hesitant to change the global application state during indexing, as it seems almost certain that this will lead to problems in some scenarios. However, as we can see by the code that is already in
RenderedItem::addFieldValues()
, this cannot really be avoided without sacrificing reliability of the generated field values. So, I guess we might need to change the translation language, too, as you indicate โ and just hope it doesnโt lead to more problems than it solves.However, this patch is definitely missing two things:
- Code that switches the language back after indexing (unless Iโm mistaken?)
- A regression test demonstrating the problem and that it is actually fixed by this change
Would be great if you could add these two things. In any case, thanks again!
- ๐ง๐ชBelgium swentel
Hmm, is this related/the same as ๐ Rendered HTML Output doesnt respect activeLanguage completely Needs work
- Status changed to Closed: duplicate
about 1 year ago 11:23am 2 February 2024 - ๐ฆ๐นAustria drunken monkey Vienna, Austria
@swentel: Youโre right, thanks for noticing!
@hchonov: Please see whether the patch in #3035977-43: Rendered HTML Output doesnt respect activeLanguage completely โ resolves the problem for you, too. Otherwise, please re-post your patch there.