dev/core#3653 Fix on queue runner not working in upgrade
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 12 Jun 2022 22:13:07 +0000 (10:13 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 12 Jun 2022 22:13:07 +0000 (10:13 +1200)
CRM/Queue/Runner.php

index 2d1eba96bbf10fe24a9b54041ba39660725dfa1a..1e9d1b2d7ce1a7fb5da806723f3a7dc49c87ae36 100644 (file)
@@ -184,10 +184,16 @@ class CRM_Queue_Runner {
   public function runAllViaWeb() {
     $_SESSION['queueRunners'][$this->qrid] = serialize($this);
     $url = CRM_Utils_System::url($this->pathPrefix . '/runner', 'reset=1&qrid=' . urlencode($this->qrid));
-    // If this was persistent/registered queue, ensure that no one else tries to execute it.
-    CRM_Core_DAO::executeQuery('UPDATE civicrm_queue SET status = NULL WHERE name = %1', [
-      1 => [$this->queue->getName(), 'String'],
-    ]);
+    try {
+      // If this was persistent/registered queue, ensure that no one else tries to execute it.
+      CRM_Core_DAO::executeQuery('UPDATE civicrm_queue SET status = NULL WHERE name = %1', [
+        1 => [$this->queue->getName(), 'String'],
+      ]);
+    }
+    catch (PEAR_Exception $e) {
+      // For sites being upgraded the field may not exist as yet.
+      // https://lab.civicrm.org/dev/core/-/issues/3653
+    }
     CRM_Utils_System::redirect($url);
   }