From 252e6dbc5d4e377efeff99ee785276ca36e690b8 Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Wed, 14 May 2014 18:14:12 +0530 Subject: [PATCH] views-upgrade-error : helper method to detect upgrade mode. this is used in civicrm.views.inc --- CRM/Utils/System.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index 7573b034be..d42f699ac1 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -1815,6 +1815,15 @@ class CRM_Utils_System { } return $cache; } -} - + static function isInUpgradeMode() { + $args = explode('/', $_GET['q']); + $upgradeInProcess = CRM_Core_Session::singleton()->get('isUpgradePending'); + if ((isset($args[1]) && $args[1] == 'upgrade') || $upgradeInProcess) { + return TRUE; + } + else { + return FALSE; + } + } +} \ No newline at end of file -- 2.25.1