Skip to content
Snippets Groups Projects
Commit 43f81ffc authored by Steve Wirt's avatar Steve Wirt
Browse files

Issue #3508720: Error on Operation List

parent f8a4e2cc
No related branches found
No related tags found
1 merge request!33#3508720 Make intentional error more explicit.
Pipeline #434199 passed with warnings
...@@ -46,17 +46,14 @@ class TestErrorOnGatheringItems extends BatchOperations implements BatchScriptIn ...@@ -46,17 +46,14 @@ class TestErrorOnGatheringItems extends BatchOperations implements BatchScriptIn
* {@inheritdoc} * {@inheritdoc}
*/ */
public function gatherItemsToProcess(): array { public function gatherItemsToProcess(): array {
// Do whatever you need to here to put together the list of items // We are intentionally making an error here by lokking for something that does not exist.
// to be processed. Can be a keyed array like // It should cause an error on the BatchOperation list UI page and on the trying to run it.
// [key1 => item1, key2 => item2 ...] // If you see an error that is good, becuase is means the error was caught and did not WSOD.
// or a flat array [item1, item2, item3 ...].
// 'item' can be something simple like a node id for processOne() to load,
// or could be a loaded entity to act on.
$query = $this->entityTypeManager->getStorage('node')->getQuery(); $query = $this->entityTypeManager->getStorage('node')->getQuery();
$items = $query $items = $query
->condition('type', 'yorick_parts') ->condition('type', 'yorick_parts')
->accessCheck(FALSE) ->accessCheck(FALSE)
->condition('field_parts', 'skull', '=') ->condition('non_existent_field_to_cause_intentional_error-PLEASE-IGNORE', 'skull', '=')
->execute(); ->execute();
return $items; return $items;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment