Created on 17 January 2024, 11 months ago
Updated 8 February 2024, 10 months ago

Problem/Motivation

When setting AI Interpolator on a field and checking the option to run it via Queue/Cron, the field is not updated and two PHP warnings are logged when cron is run:

Warning: Trying to access array offset on value of type null in Drupal\Core\Cron->processQueue() (line 264 of /var/www/html/web/core/lib/Drupal/Core/Cron.php)

Steps to reproduce

  1. Install AI Interpolator and one of the modules that extend it (I chose the OpenAI module) on a clean Drupal 10 site.
  2. Configure a field on an existing entity to use AI Interpolator (Entity and field should not matter. I chose the tags field on the article node type).
  3. Under advanced settings, choose Queue/Cron as Interpolator worker and save.
  4. Create/edit an entity of the type where you configured the AI Interpolator field. Save it to enqueue the worker (Make sure that that field is empty before you save).
  5. Run cron. You should see the above mentioned PHP warnings. The field with the AI interpolator was not updated.

Proposed resolution

The cause of the issue is that the pluginDefinition of the instantiated queue worker is Null, because its constructor is missing arguments and and a call to parent::__construct(). I propose updating __construct() and create() methods of the queue worker.

Remaining tasks

Update the queue worker. I attached a patch with the fixes.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇹Austria reinimax

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