From d6694785ca0828ce3f53694a6078be786b383170 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 21 Dec 2020 13:21:26 +1300 Subject: [PATCH] dev/core#2252 remove all handling of strict mode as it has aged out of relevance --- CRM/Core/DAO.php | 10 ---------- CRM/Utils/File.php | 3 --- CRM/Utils/System.php | 12 +++++++++++- distmaker/utils/joomlaxml.php | 2 +- templates/CRM/common/civicrm.settings.php.template | 11 ----------- 5 files changed, 12 insertions(+), 26 deletions(-) diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 70d248bfb0..0e248c5dda 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -186,16 +186,6 @@ class CRM_Core_DAO extends DB_DataObject { } $factory = new CRM_Contact_DAO_Factory(); CRM_Core_DAO::setFactory($factory); - $currentModes = CRM_Utils_SQL::getSqlModes(); - if (CRM_Utils_Constant::value('CIVICRM_MYSQL_STRICT', CRM_Utils_System::isDevelopment())) { - if (CRM_Utils_SQL::supportsFullGroupBy() && !in_array('ONLY_FULL_GROUP_BY', $currentModes) && CRM_Utils_SQL::isGroupByModeInDefault()) { - $currentModes[] = 'ONLY_FULL_GROUP_BY'; - } - if (!in_array('STRICT_TRANS_TABLES', $currentModes)) { - $currentModes = array_merge(['STRICT_TRANS_TABLES'], $currentModes); - } - CRM_Core_DAO::executeQuery("SET SESSION sql_mode = %1", [1 => [implode(',', $currentModes), 'String']]); - } CRM_Core_DAO::executeQuery('SET NAMES utf8mb4'); CRM_Core_DAO::executeQuery('SET @uniqueID = %1', [1 => [CRM_Utils_Request::id(), 'String']]); } diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index c196b3dd71..e4fb43b9cc 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -332,9 +332,6 @@ class CRM_Utils_File { if (PEAR::isError($db)) { die("Cannot open $dsn: " . $db->getMessage()); } - if (CRM_Utils_Constant::value('CIVICRM_MYSQL_STRICT', CRM_Utils_System::isDevelopment())) { - $db->query('SET SESSION sql_mode = STRICT_TRANS_TABLES'); - } $db->query('SET NAMES utf8mb4'); $transactionId = CRM_Utils_Type::escape(CRM_Utils_Request::id(), 'String'); $db->query('SET @uniqueID = ' . "'$transactionId'"); diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index 48abe7d393..98685df52b 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -1829,7 +1829,17 @@ class CRM_Utils_System { } /** - * Determine whether this is a developmental system. + * Determine whether this system is deployed using version control. + * + * Normally sites would tune their php error settings to prevent deprecation + * notices appearing on a live site. However, on some systems the user + * does not have control over this setting. Sites with version-controlled + * deployments are unlikely to be in a situation where they cannot alter their + * php error level reporting so we can trust that the are able to set them + * to suppress deprecation / php error level warnings if appropriate but + * in order to phase in deprecation warnings we originally chose not to + * show them on sites who might not be able to set their error_level in + * a way that is appropriate to their site. * * @return bool */ diff --git a/distmaker/utils/joomlaxml.php b/distmaker/utils/joomlaxml.php index fad1ceb9f9..087555ec64 100644 --- a/distmaker/utils/joomlaxml.php +++ b/distmaker/utils/joomlaxml.php @@ -1,5 +1,5 @@