Don't run trackItemsDeleted when $item_ids is empty

Created on 1 February 2024, 11 months ago
Updated 15 February 2024, 11 months ago

Problem/Motivation

In some scenarios (in my case during tests) search_api_revisions_entity_predelete can run when an entity is already deleted which means there are no revisions, resulting in $index->trackItemsDeleted($datasource_id, $item_ids); being called with an empty array.

Steps to reproduce

Index items in a test using drupal-test-traits, mark those entities for cleanup and run the test twice.

Proposed resolution

Check if empty.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇦🇺Australia acbramley

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024