From 5a74bbd5cf5e4c9efa30489cafb0d79299ee9c4c Mon Sep 17 00:00:00 2001 From: Patrick Figel Date: Mon, 7 Oct 2019 19:05:59 +0200 Subject: [PATCH] Fix status check not rendering before 5.19 migrations This fixes an issue where the status check page does not render when migrations to 5.19 are pending because the is_active column hasn't been added yet. The rationale for this change is to avoid scenarios where users forget to run upgrades because there's no status check warning. --- CRM/Utils/Check/Component.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/CRM/Utils/Check/Component.php b/CRM/Utils/Check/Component.php index 0c07a9395334..3772b4b3836b 100644 --- a/CRM/Utils/Check/Component.php +++ b/CRM/Utils/Check/Component.php @@ -104,11 +104,19 @@ public function checkAll() { * @throws \Civi\API\Exception\UnauthorizedException */ public function isDisabled($method) { - - $checks = $this->getChecksConfig(); - if (!empty($checks[$method])) { - return (bool) empty($checks[$method]['is_active']); + try { + $checks = $this->getChecksConfig(); + if (!empty($checks[$method])) { + return (bool) empty($checks[$method]['is_active']); + } } + catch (PEAR_Exception $e) { + // if we're hitting this, DB migration to 5.19 probably hasn't run yet, so + // is_active doesn't exist. Ignore this error so the status check (which + // might warn about missing migrations!) still renders. + // TODO: remove at some point after 5.19 + } + return FALSE; }