Error message

You need to log in or create an account to access this page.

Note: This ticket was drafted with the help of AI. The bug itself was hit on a real production Drupal 11 site and independently reproduced on a fresh Drupal CMS 11.4.5 install, no contrib beyond search_api + search_api_db, no custom code. The steps below were run by hand.

Problem/Motivation

Adding a translation while the node is in a pending (non-default) moderation state silently corrupts the Search API tracker. The translation still reaches the backend at publish time, so listings look correct — but the tracker never gets the row. The damage is invisible until the backend is repopulated from the tracker (a full reindex, backend rebuild, Solr schema refresh, migration), at which point every accumulated missing translation disappears from every view backed by the index, at once.

Steps to reproduce

Fresh Drupal CMS 11.4.5 install.

  1. Add French. Enable translation on the page bundle. Apply the basic_editorial workflow to page.
  2. Create a database-backed index on entity:node, defaults left as-is (index_directly: TRUE, delete_on_fail: TRUE).
  3. Create an EN page N, moderation state Published.
    • search_api_item contains entity:node/N:en. ✔
  4. Visit /fr/node/N/translations/add/en/fr, fill in, moderation state Draft, save.
    • Watchdog: Could not load the following items on index Content: "entity:node/N:fr".
    • SELECT item_id FROM search_api_item WHERE item_id LIKE 'entity:node/N:%' → only entity:node/N:en. ✘
  5. Visit /fr/node/N/edit, moderation state Published, save.
    • Backend search_api_db_content: en + fr. Listing shows FR. ✔
    • search_api_item: still only en. Row never recreated. ✘
  6. drush search-api:clear content && drush search-api:index content.
    • Backend now contains only en. FR row disappears from every view backed by the index.

Proposed resolution

Patch to follow.

Remaining tasks

Review of the attached patch

Comments

guillaumeg created an issue. See original summary.

guillaumeg’s picture