Commit fb3a8d8b authored by James Williams's avatar James Williams Committed by Andrei Mateescu
Browse files

Issue #3287338 by james.williams, Project Update Bot, kevinfunk,...

Issue #3287338 by james.williams, Project Update Bot, kevinfunk, DieterHolvoet, claudiu.cristea, amateescu: Automated Drupal 10 compatibility fixes
parent 356362d6
Loading
Loading
Loading
Loading
+1 −1
Changes for entityqueue.info.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -2,5 +2,5 @@ name: Entityqueue
type: module
description: 'Allows users to collect entities in arbitrarily ordered lists.'
package: Entityqueue
core_version_requirement: ^8.7.7 || ^9
core_version_requirement: ^8.7.7 || ^9 || ^10
configure: entity.entity_queue.collection
+1
Changes for entityqueue.install: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@ function entityqueue_update_8006() {
  $queue_ids = \Drupal::entityTypeManager()
    ->getStorage('entity_queue')
    ->getQuery()
    ->accessCheck(FALSE)
    ->execute();

  $bfo_ids = array_map(function ($queue_id) {
+1
Changes for entityqueue.module: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ function entityqueue_entity_delete(EntityInterface $entity) {
  foreach ($queues as $queue) {
    // Get all the subqueues which are referencing the deleted entity.
    $query = \Drupal::entityQuery('entity_subqueue')
      ->accessCheck(FALSE)
      ->condition('queue', $queue->id())
      ->condition('items', $entity->id());
    $result = $query->execute();
+1 −1
Changes for modules/entityqueue_smartqueue/entityqueue_smartqueue.info.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ name: 'Entityqueue Smartqueue'
type: module
description: 'Provides automated subqueues for each entity of a given entity type.'
package: Entityqueue
core_version_requirement: ^8.7.7 || ^9
core_version_requirement: ^8.7.7 || ^9 || ^10

dependencies:
  - entityqueue:entityqueue
+18 −4
Changes for modules/entityqueue_smartqueue/src/Plugin/EntityQueueHandler/SmartQueue.php: 18 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -192,7 +192,11 @@ class SmartQueue extends Multiple implements ContainerFactoryPluginInterface {
    // Generate list of subqueues to be deleted, and add batch operations
    // to delete them.
    // 1. Get the existing subqueue ids.
    $subqueue_ids = $this->entityTypeManager->getStorage('entity_subqueue')->getQuery()->condition('queue', $queue->id())->execute();
    $subqueue_ids = $this->entityTypeManager->getStorage('entity_subqueue')
      ->getQuery()
      ->accessCheck(FALSE)
      ->condition('queue', $queue->id())
      ->execute();

    // 2. Get the list of relevant subqueues for this queue.
    $subqueue_id_list = array_map(function ($subqueue_id) use ($queue) {
@@ -234,7 +238,11 @@ class SmartQueue extends Multiple implements ContainerFactoryPluginInterface {
   */
  public function onQueuePostDelete(EntityQueueInterface $queue, EntityStorageInterface $storage) {
    // Create batch operation to delete all the subqueues when the parent queue is deleted.
    $subqueue_ids = $this->entityTypeManager->getStorage('entity_subqueue')->getQuery()->condition('queue', $queue->id())->execute();
    $subqueue_ids = $this->entityTypeManager->getStorage('entity_subqueue')
      ->getQuery()
      ->accessCheck(FALSE)
      ->condition('queue', $queue->id())
      ->execute();
    $subqueue_id_chunks = array_chunk($subqueue_ids, 20);
    $operations = [];
    foreach ($subqueue_id_chunks as $subqueue_id_chunk) {
@@ -257,7 +265,11 @@ class SmartQueue extends Multiple implements ContainerFactoryPluginInterface {
   * Create initial subqueues based on smartqueue configuration.
   */
  public function initSubqueuesCreate($queue, $entity_ids, $entity_type_id, &$context) {
    $subqueue_ids = $this->entityTypeManager->getStorage('entity_subqueue')->getQuery()->condition('queue', $queue->id())->execute();
    $subqueue_ids = $this->entityTypeManager->getStorage('entity_subqueue')
      ->getQuery()
      ->accessCheck(FALSE)
      ->condition('queue', $queue->id())
      ->execute();

    // Add new queues according to configured entity and/or bundle.
    $entities = $this->entityTypeManager->getStorage($entity_type_id)->loadMultiple($entity_ids);
@@ -332,7 +344,9 @@ class SmartQueue extends Multiple implements ContainerFactoryPluginInterface {
    $entity_type_id = $this->configuration['entity_type'];
    $entity_type = $this->entityTypeManager->getDefinition($entity_type_id);

    $query = $this->entityTypeManager->getStorage($entity_type_id)->getQuery();
    $query = $this->entityTypeManager->getStorage($entity_type_id)
      ->getQuery()
      ->accessCheck(TRUE);

    if ($entity_type->hasKey('bundle') && !empty($this->configuration['bundles'])) {
      $query->condition($entity_type->getKey('bundle'), $this->configuration['bundles'], 'IN');
Loading