Ensure `scheduled_transition` fields are present in an entity type's active field storage definition before attempting to transition entities of that type

Created on 14 September 2020, over 4 years ago
Updated 26 July 2024, 10 months ago

Problem/Motivation

In the lightning_scheduler_cron hook, before the transition manager is allowed to process an entity type, it's verified that the entity type has the scheduled_transition_state and scheduled_transition_date fields by way of it's field map. However, the field map retrieved does not necessarily match up with the active fields for that content type. This can result in the transition manager failing to process one of the entity types, and preventing any further entity types from being processed.

Steps to reproduce

I encountered this problem while using this module in conjunction with the entityqueue contrib module. The "Scheduler" cron job appeared to hang of the entity_subqueue content type with the following error:

Error: Call to a member function getColumns() on bool in Drupal\Core\Entity\Query\Sql\Tables->addField() (line 253 of /app/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).

This error appears to be related to the following issue in Drupal Core: πŸ› Call to a member function getColumns() on boolean Needs work
However, the proposed resolution in that issue will only result in a QueueException being thrown instead, which does not solve this problem.

Proposed resolution

Validate the presence of the scheduled_transition_state and scheduled_transition_date fields against an entity type's active field storage definitions as opposed to it's field map in the lightning_scheduler_cron hook.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cliddell

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.71.5 2024