Batch worker initial entity ID to be aware of ID type

Created on 22 January 2023, almost 2 years ago
Updated 23 January 2023, almost 2 years ago

Problem/Motivation

In EntityUsageBatchManager::updateSourcesBatchWorker(), the batch initial entity ID is set to -1:

...
$context['sandbox']['progress'] = 0;
$context['sandbox']['current_id'] = -1;
...

This makes totally sense for an entity type whose ID is an integer. However, Drupal entity/field API allows also strings as entity ID. Some entity types are expecting strictly a string in the entity query condition and with the current approach will throw an error.

Proposed resolution

Check the type of the entity ID before assigning the initial value.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇷🇴Romania claudiu.cristea Arad 🇷🇴

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

Comments & Activities

Production build 0.71.5 2024