Problem/Motivation
The module implements search_api_et_entity_translation_delete() to update the tracking when a translation is deleted.
But SearchApiEtDatasourceController::trackItemDelete() expands the passed in search_api_et item id to all ids of the given id by invoking SearchApiEtDatasourceController::getTrackableItemIdsFromMixedSource().
So, if a single id e.g. array([NID]/it) is given this will be expanded to all available translation ids e.g. array([NID]/it, [NID]/de, [NID]/en) - leading to the deletion of all the items.
And since the tracking isn't "self-headling", meaning the tracking item ids aren't re-inserted on the next node update, the whole item essentially disappears permanently from the index while still existing.
Proposed resolution
Change SearchApiEtDatasourceController::trackItemDelete() to only expand item ids if a non search api et item id is given.
Remaining tasks
Reviews needed.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff-4-6.txt | 4.4 KB | idebr |
| #6 | 2953473-6.patch | 7.11 KB | idebr |
| #6 | 2953473-6-test-only.patch | 2.08 KB | idebr |
Comments
Comment #2
idebr commentedAdd test assertions to show the current behavior.
Comment #4
idebr commentedAdding the patch together with the test shows the deleted translation is removed from the index, but lingers on the backend, so the patch needs more work.
Comment #6
idebr commentedThe item remained in the backend, because it was wrong updated from
search_api_et_entity_update(). I have included your patch from #2924846: Wrong language detection used in search_api_et_entity_update() to correct this.The change also means
\SearchApiEtDatasourceController::trackItemDelete()is compatible withsearch_api_entity_update(), so our ownsearch_api_et_entity_delete()can be removed.Comment #9
idebr commented