Problem/Motivation
If you create a translation of an article in Ukrainian, for example, and then delete it, then on page /admin/config/search/pages we see the following: "There is 1 item left to index."
Running the cron does not solve the problem.
Result:
On page /admin/config/search/pages we see the following: "There is 1 item left to index."
If this is repeated for 100 articles, the indexing of the site will stop.
There is such an entry in the database:SELECT * FROM `d8_search_dataset`
- sid = 1
- langcode = uk
- type = node_search
- data = "some text"
- reindex = 1618155506
Steps to reproduce
1. Install Drupal 8.9.13 (Latest version for now)
2. Install modules (from core): Configuration Translation, Content Translation, Interface Translation,
Language
3. /admin/config/regional/language - Add the Ukrainian language, for example
4. /admin/structure/types/manage/article - "Enable translation"
5. create an article and add a translation to it.
6. Runs Cron
7. Delete article translation.
8. Runs Cron
Proposed resolution
In Node::postSave() execture a new private method nodeSearchRemoveDeletedTranslations that will remove deleted translations from the search index.