From e94b3db54e49a3576c18debbe9dc818f6bc305f7 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 10 Dec 2021 00:49:55 -0800 Subject: [PATCH] (REF) CRM/Upgrade - Remove unused entrypoint `verifyPreDBstate()` Overview -------- In olden times, upgraders sometimes implemented the method `verifyPreDBstate()`. However, this appears to be unused. Additionally, it's not clear (from the documentation) how you would use it (if you wanted to). So... simplify the code.... Before ------ Function exists. But it does nothing. Because no subclasses implement it. After ----- Function does not exist. It still does nothing. --- CRM/Upgrade/Form.php | 16 ---------------- CRM/Upgrade/Incremental/Base.php | 11 ----------- 2 files changed, 27 deletions(-) diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index 79305b2fce..513ffd1c47 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -733,22 +733,6 @@ SET version = '$version' $versionObject = $upgrade->incrementalPhpObject($rev); - // pre-db check for major release. - if ($upgrade->checkVersionRelease($rev, 'alpha1')) { - if (!(is_callable([$versionObject, 'verifyPreDBstate']))) { - throw new CRM_Core_Exception("verifyPreDBstate method was not found for $rev"); - } - - $error = NULL; - if (!($versionObject->verifyPreDBstate($error))) { - if (!isset($error)) { - $error = "post-condition failed for current upgrade for $rev"; - } - throw new CRM_Core_Exception($error); - } - - } - $upgrade->setSchemaStructureTables($rev); if (is_callable([$versionObject, $phpFunctionName])) { diff --git a/CRM/Upgrade/Incremental/Base.php b/CRM/Upgrade/Incremental/Base.php index b3884010e3..771ed8ad67 100644 --- a/CRM/Upgrade/Incremental/Base.php +++ b/CRM/Upgrade/Incremental/Base.php @@ -68,17 +68,6 @@ class CRM_Upgrade_Incremental_Base { return $revList; } - /** - * Verify DB state. - * - * @param $errors - * - * @return bool - */ - public function verifyPreDBstate(&$errors) { - return TRUE; - } - /** * Compute any messages which should be displayed before upgrade. * -- 2.25.1