Plugin 'scheduler_field_type_publication' triggers a database error when a scheduler field is added to an entity that does not have a 'status' column.

Created on 6 January 2024, 12 months ago
Updated 7 August 2024, 5 months ago

Problem/Motivation

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column '<entity_name>.status' in 'where clause': ...  in Drupal\scheduler_field\SchedulerFieldTypePluginBase->processScheduler() (line 114 of /scheduler_field/src/SchedulerFieldTypePluginBase.php).

Steps to reproduce

  1. Create/use a custom entity that does not have a 'status' ('Published') column.
  2. Create a new scheduler field plugin that handles an action for that entity.
  3. Add a scheduler field to that entity, and configure it to use the new plugin.
  4. When running cron, a database exception is triggered.
  5. The 'scheduler_field_type_publication' is not used in any other scheduler field in the system.

Proposed resolution

The problem is located in scheduler_field/src/Cron.php. As it is mentioned in the code: . That is, it tries queries for all the plugin definitions that exist in the system, regardless of whether they are used or not. Somehow this step should be avoided for those plugins that are not being used for an entity.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇪🇸Spain interdruper

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