Skip to content
Snippets Groups Projects
Commit 7994588d authored by Matthew Connerton's avatar Matthew Connerton Committed by Dieter Holvoet
Browse files

Issue #3512551 by mrconnerton: prepareRow can't delete item from queue

parent 0623239c
No related branches found
No related tags found
1 merge request!5Issue #3512551: Allow for queue item to be properly deleted.
......@@ -84,6 +84,11 @@ class Queue extends SourcePluginBase implements ContainerFactoryPluginInterface
// Determine if the row needs processing.
$processRow = parent::prepareRow($row);
// Restore the non-field values to the source.
foreach ($nonFieldNames as $nonDataKey) {
$row->setSourceProperty($nonDataKey, $nonFieldValues[$nonDataKey]);
}
// If processing is not necessary, delete the item from the queue.
if ($processRow === FALSE || !$this->needsProcessing($row)) {
$queue = $this->queueFactory->get($row->get('queue_name'));
......@@ -91,11 +96,6 @@ class Queue extends SourcePluginBase implements ContainerFactoryPluginInterface
$queue->deleteItem($item);
}
// Restore the non-field values to the source.
foreach ($nonFieldNames as $nonDataKey) {
$row->setSourceProperty($nonDataKey, $nonFieldValues[$nonDataKey]);
}
return $processRow;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment