While looking through our entity tracking code just now, I realized that we actually never check the entity's language against the datasource settings before it is added to the tracker. This is mitigated by the fact that, as far as I can see, the entity (resp., the "undesired" translation in question) would still never actually be indexed, even if it's in the tracker. Even better, as soon as indexing is attempted for the item (which would be "right away" if "Index items immediately" is enabled) the code in \Drupal\search_api\Entity\Index::loadItemsMultiple()
would recognize it as unloadable by the datasource and remove it from tracking again.
So, it's not actually a large problem, I think, but still not very clean and should be fixed.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2886978-6--disabled_languages_tracking.patch | 10.72 KB | drunken monkey |
|
Comments
Comment #2
drunken monkeyThese two patches should demonstrate both the bug itself and that it's not a big problem.
PS: Oops, didn't mean to include those
search_api.module
changes, those were just meant to be included in the fix, to also make the documentation clearer there a bit.Comment #4
drunken monkeyThis should fix that.
Comment #6
drunken monkeyAh, of course, the config key doesn't exist if the entity type isn't translatable.
Comment #7
borisson_Test looks solid, as does the code. Great work!
Comment #9
drunken monkeyGood to hear, thanks for your feedback!
Committed.