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.

Comments

das-peter created an issue. See original summary.

idebr’s picture

StatusFileSize
new2.08 KB

Add test assertions to show the current behavior.

Status: Needs review » Needs work

The last submitted patch, 2: 2953473-2-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

idebr’s picture

Status: Needs work » Needs review
StatusFileSize
new3.93 KB

Adding 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.

Status: Needs review » Needs work

The last submitted patch, 4: 2953473-4.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

idebr’s picture

Status: Needs work » Needs review
StatusFileSize
new2.08 KB
new7.11 KB
new4.4 KB

The 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 with search_api_entity_update(), so our own search_api_et_entity_delete() can be removed.

The last submitted patch, 6: 2953473-6-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • d8fdb10 committed on 7.x-2.x
    Issue #2953473 by idebr, das-peter: All tracking items deleted when...
idebr’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.