- Issue created by @sir_squall
- 🇦🇹Austria drunken monkey Vienna, Austria
In the Search API, entity translations are indexed as individual items (i.e., “node 1, fr” and “node 1, en” are indexed as completely separate, independent items), so the Views option you mention wouldn’t make sense for us: we always use the row language for rendering.
This is also why I can’t really explain how this could be happening. This is definitely working in general, there are countless sites out there relying on this functionality.I assume you are using the “Rendered entity” row style? Then you could try debugging
\Drupal\search_api\Plugin\search_api\datasource\ContentEntity::viewMultipleItems()
to see whether a wrong$langcode
somehow ends up somewhere in there.
In some way, some custom code or (not too popular) contrib module must be interfering here to produce this wrong result.
Or is it possible that the issue is related to caching? Have you tried disabling caching to see whether that fixes it? (This should of course also work with caching, but something messing up the cache metadata could still be an explanation.)Downgrading priority to “Normal” since I’m positive this error is specific to your site.
- 🇨🇭Switzerland sir_squall
Thanks for the support, I found the cause, but I cannot explain why:
On the english content the field "image" was not translated, and once I have added the translation for this field, the url come back to normal
- 🇦🇹Austria drunken monkey Vienna, Austria
OK, then I think we can close this. If there is a bug in what happened, then it doesn’t seem like it’s in this module.