From 43f81ffcf27fb366f1c34418ddeb5542fa210d27 Mon Sep 17 00:00:00 2001
From: Steve Wirt <40593-swirtMiles@users.noreply.drupalcode.org>
Date: Wed, 26 Feb 2025 03:31:38 +0000
Subject: [PATCH] Issue #3508720: Error on Operation List

---
 src/cbo_scripts/TestErrorOnGatheringItems.php | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/cbo_scripts/TestErrorOnGatheringItems.php b/src/cbo_scripts/TestErrorOnGatheringItems.php
index 2401f6c..5030377 100644
--- a/src/cbo_scripts/TestErrorOnGatheringItems.php
+++ b/src/cbo_scripts/TestErrorOnGatheringItems.php
@@ -46,17 +46,14 @@ class TestErrorOnGatheringItems extends BatchOperations implements BatchScriptIn
    * {@inheritdoc}
    */
   public function gatherItemsToProcess(): array {
-    // Do whatever you need to here to put together the list of items
-    // to be processed. Can be a keyed array like
-    // [key1 => item1, key2 => item2 ...]
-    // 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.
+    // We are intentionally making an error here by lokking for something that does not exist.
+    // It should cause an error on the BatchOperation list UI page and on the trying to run it.
+    // If you see an error that is good, becuase is means the error was caught and did not WSOD.
     $query = $this->entityTypeManager->getStorage('node')->getQuery();
     $items = $query
       ->condition('type', 'yorick_parts')
       ->accessCheck(FALSE)
-      ->condition('field_parts', 'skull', '=')
+      ->condition('non_existent_field_to_cause_intentional_error-PLEASE-IGNORE', 'skull', '=')
       ->execute();
     return $items;
   }
-- 
GitLab