diff --git a/Civi/Sqltasks/CompilerPass.php b/Civi/Sqltasks/CompilerPass.php index ff7fd73..2067c53 100644 --- a/Civi/Sqltasks/CompilerPass.php +++ b/Civi/Sqltasks/CompilerPass.php @@ -20,9 +20,21 @@ public function process(ContainerBuilder $container) { E::ts('Run SQL Task'), ], []); - $query = \CRM_Core_DAO::executeQuery(" - SELECT id FROM civicrm_sqltasks WHERE input_spec IS NOT NULL ORDER BY id ASC; - "); + try { + $errorScope = \CRM_Core_TemporaryErrorScope::useException(); + $query = \CRM_Core_DAO::executeQuery(" + SELECT id FROM civicrm_sqltasks WHERE input_spec IS NOT NULL ORDER BY id ASC; + "); + } + catch (\Civi\Core\Exception\DBQueryException $e) { + // if this is executed before the upgrader for input_spec runs, civi doesn't boot + if (str_contains($e->getMessage(), 'DB Error: no such field')) { + // would like to log this, but seems to cause infinite loop in the container build process + // \Civi::log()->warning('Unable to add action providers. Please run upgraders to create column civicrm_sqltasks.input_spec'); + return; + } + throw $e; + } while ($query->fetch()) { $task_id = $query->id;