Queue factories must implement QueueFactoryInterface

Created on 7 September 2024, 3 months ago
Updated 8 September 2024, 3 months ago

Problem/Motivation

In Drupal 11, QueueFactory uses a service locator instead of receiving the whole service container.
SmLegacyQueueFactory is not automatically discovered anymore.

Steps to reproduce

Adding $settings['queue_default'] = 'sm.queue_interceptor.queue_item_factory'; no longer works, Drupal fails with:

Service "sm.queue_interceptor.queue_item_factory" not found: the container inside "Drupal\Core\Queue\QueueFactory" is a smaller service locator that only knows about the "queue.database" service.

Proposed resolution

add queue_factory to service sm.queue_interceptor.queue_item_factory.

OR

Let SmLegacyQueueFactory implements QueueFactoryInterface and add

 _defaults:
    autoconfigure: true

to sm.services.yml, but this will only works on D11, I suppose.

Remaining tasks

Decide which fix to apply.

User interface changes

None

API changes

None

Data model changes

None

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇹Italy lussoluca Italy

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