From e5162884dc385b42b906f4e20ba9b99868d8042d Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 2 Jul 2020 08:51:28 +1000 Subject: [PATCH] Fix logical errors and fix ENV file as well --- CRM/Core/BAO/CustomField.php | 2 +- CRM/Utils/Check/Component/Env.php | 2 +- api/v3/CustomField.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 7c5084b68c..0fcf801bd6 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -396,7 +396,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { // Temporary hack - in 5.27 a new field is added to civicrm_custom_field. There is a high // risk this function is called before the upgrade page can be reached and if // so it will potentially result in fatal error. - $serializeField = CRM_Core_BAO_Domain::isDBVersionAtLeast('5.27.alpha1') ? '' : "$cfTable.serialize,"; + $serializeField = CRM_Core_BAO_Domain::isDBVersionAtLeast('5.27.alpha1') ? "$cfTable.serialize," : ''; $query = "SELECT $cfTable.id, $cfTable.label, $cgTable.title, diff --git a/CRM/Utils/Check/Component/Env.php b/CRM/Utils/Check/Component/Env.php index c37dcff4b5..bf67ad8b05 100644 --- a/CRM/Utils/Check/Component/Env.php +++ b/CRM/Utils/Check/Component/Env.php @@ -751,7 +751,7 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component { } // if db.ver > code.ver, sth really wrong - if (version_compare($dbVersion, $codeVersion) > 0) { + if (!CRM_Core_BAO_Domain::isDBUpdateRequired()) { $messages[] = new CRM_Utils_Check_Message( __FUNCTION__, ts('Your database is marked with an unexpected version number: %1. The v%2 codebase may not be compatible with your database state. diff --git a/api/v3/CustomField.php b/api/v3/CustomField.php index 49cb0e45cd..1667721744 100644 --- a/api/v3/CustomField.php +++ b/api/v3/CustomField.php @@ -122,7 +122,7 @@ function civicrm_api3_custom_field_delete($params) { * @return array */ function civicrm_api3_custom_field_get($params) { - if (!CRM_Core_BAO_Domain::isDBVersionAtLeast('5.27.alpha1') && ($params['legacy_html_type'] ?? TRUE) && !empty($params['return'])) { + if (CRM_Core_BAO_Domain::isDBVersionAtLeast('5.27.alpha1') && ($params['legacy_html_type'] ?? TRUE) && !empty($params['return'])) { if (is_array($params['return'])) { $params['return'][] = 'serialize'; } -- 2.25.1