Allow smartqueues for entity types without bundles

Created on 27 May 2020, about 4 years ago
Updated 17 June 2024, 11 days ago

When using entityqueue_smartqueue for user entities, the following error happens when inserting a user, preventing adding a smartqueue for the user:

[warning] in_array() expects parameter 2 to be array, string given entityqueue_smartqueue.module:74

In entityqueue_smartqueue.module, entityqueue_smartqueue_entity_insert/update/delete() checks whether the entity that got inserted is of the relevant bundle, by doing:

if (!in_array($entity->bundle(), $queue->getHandlerConfiguration()['bundles'], TRUE)) {
  continue;
}

Attached patch adds a check for $queue->getHandlerConfiguration()['bundles'] prior to the in_array(), so the automatic subqueue creation/updating/deleting also works for entity types that don't have bundles (e.g., user).

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada brunodbo Coast Salish Territory

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