Commit 5462c066 authored by Dieter Holvoet's avatar Dieter Holvoet
Browse files

Issue #3284866 by DieterHolvoet, casey: QueueItemDeleteSubscriber does not...

Issue #3284866 by DieterHolvoet, casey: QueueItemDeleteSubscriber does not check migration source plugin
parent bcb59a24
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Drupal\migrate_source_queue\EventSubscriber;
use Drupal\Core\Queue\QueueFactory;
use Drupal\migrate\Event\MigrateEvents;
use Drupal\migrate\Event\MigratePostRowSaveEvent;
use Drupal\migrate_source_queue\Plugin\migrate\source\Queue;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
@@ -36,6 +37,10 @@ class QueueItemDeleteSubscriber implements EventSubscriberInterface {
  }

  public function onPostRowSave(MigratePostRowSaveEvent $event): void {
    if (!$event->getMigration()->getSourcePlugin() instanceof Queue) {
      return;
    }

    // Queue item is processed, release it.
    $row = $event->getRow();
    $queue = $this->queueFactory->get($row->get('queue_name'));