From fcab62b450c6f0b4f07f60e72b0a8f5ca2ec9073 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 4 Nov 2013 16:28:11 -0800 Subject: [PATCH] CRM-13701 - Date settings - fix config->timeInputFormat --- CRM/Admin/Form/Setting.php | 11 ----------- CRM/Upgrade/Incremental/php/FourFour.php | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CRM/Admin/Form/Setting.php b/CRM/Admin/Form/Setting.php index 9344e6cd0c..d999f2a43f 100644 --- a/CRM/Admin/Form/Setting.php +++ b/CRM/Admin/Form/Setting.php @@ -108,15 +108,6 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form { $this->_defaults['enableSSL'] = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enableSSL', NULL, 0); $this->_defaults['verifySSL'] = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL', NULL, 1); - - $sql = " -SELECT time_format -FROM civicrm_preferences_date -WHERE time_format IS NOT NULL -AND time_format <> '' -LIMIT 1 -"; - $this->_defaults['timeInputFormat'] = CRM_Core_DAO::singleValueQuery($sql); } return $this->_defaults; @@ -247,8 +238,6 @@ AND time_format <> '' "; $sqlParams = array(1 => array($params['timeInputFormat'], 'String')); CRM_Core_DAO::executeQuery($query, $sqlParams); - - unset($params['timeInputFormat']); } // verify ssl peer option diff --git a/CRM/Upgrade/Incremental/php/FourFour.php b/CRM/Upgrade/Incremental/php/FourFour.php index 16d39f40db..fc5da6fbe7 100644 --- a/CRM/Upgrade/Incremental/php/FourFour.php +++ b/CRM/Upgrade/Incremental/php/FourFour.php @@ -148,6 +148,20 @@ class CRM_Upgrade_Incremental_php_FourFour { CRM_Core_BAO_Setting::setItem('1', CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'disable_core_css'); } + // CRM-13701 - Fix $config->timeInputFormat + $sql = " + SELECT time_format + FROM civicrm_preferences_date + WHERE time_format IS NOT NULL + AND time_format <> '' + LIMIT 1 + "; + $timeInputFormat = CRM_Core_DAO::singleValueQuery($sql); + if ($timeInputFormat && $timeInputFormat != $config->timeInputFormat) { + $params = array('timeInputFormat' => $timeInputFormat); + CRM_Core_BAO_ConfigSetting::add($params); + } + $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.4.1')), 'task_4_4_x_runSql', $rev); $this->addTask('Patch word-replacement schema', 'wordReplacements_patch', $rev); } -- 2.25.1