Warning: Could not load the following items on index ...

Created on 5 October 2022, over 1 year ago
Updated 28 May 2023, about 1 year ago

Problem/Motivation

We are observing warnings triggered by instant indexing of user's profile:
"Could not load the following items on index Engagements search: "entity:growth_engagement/317:und", "entity:growth_engagement/317:zxx"."

growth_engagement is an untranslatable (translatable = FALSE) custom entity, that refers to profiles. This relation is part of search API index.

After some debugging, I found at, that ContentEntity::getAffectedItemsForEntityChange, returns non existing language variations for growth_engagement, eg:

["entity:growth_engagement/317:und", "entity:growth_engagement/317:zxx", "entity:growth_engagement/317:en"]

In our context, database includes just "en" version of entity. As und and zxx versions gets scheduled for index, search API triggers warning as it obviously fails to load non-existing language versions.

Proposed resolution

My proposition is to check for referenced entities what language version they actually have. I'll include patch for review. I'm not fully happy with patch (although it fixed issue for me), as it loads entities objects, instead of leaving just entity ids for further processing.

🐛 Bug report
Status

Needs review

Version

1.0

Component

General code

Created by

🇵🇱Poland jsobiecki Wroclaw

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024