From 097c681ec866b3654acdb245ce0790481719112a Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Mon, 8 Jun 2015 11:05:54 -0400 Subject: [PATCH] CRM-13283 misc sp acing problems ---------------------------------------- * CRM-13283: Number of terms does not update the end date of membership https://issues.civicrm.org/jira/browse/CRM-13283 --- CRM/Core/Invoke.php | 20 ++++++++++---------- CRM/Utils/Check/Env.php | 13 ++++--------- CRM/Utils/Check/Message.php | 2 +- CRM/Utils/VersionCheck.php | 4 ++-- api/v3/System.php | 8 ++++---- tests/phpunit/CRM/Utils/versionCheckTest.php | 1 - 6 files changed, 21 insertions(+), 27 deletions(-) diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index 17076553e1..1d7e413f1b 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -348,16 +348,16 @@ class CRM_Core_Invoke { * * @param CRM_Core_Smarty $template */ - public static function statusCheck($template) { - if (CRM_Core_Config::isUpgradeMode()) { - return; - } - $statusSeverity = 0; - $statusMessage = ts('System status OK'); - // TODO: get status from CRM_Utils_Check, if cached - $template->assign('footer_status_severity', $statusSeverity); - $template->assign('footer_status_message', $statusMessage); - } + public static function statusCheck($template) { + if (CRM_Core_Config::isUpgradeMode()) { + return; + } + $statusSeverity = 0; + $statusMessage = ts('System status OK'); + // TODO: get status from CRM_Utils_Check, if cached + $template->assign('footer_status_severity', $statusSeverity); + $template->assign('footer_status_message', $statusMessage); + } /** * @param bool $triggerRebuild diff --git a/CRM/Utils/Check/Env.php b/CRM/Utils/Check/Env.php index 538d631daf..1640c583f0 100644 --- a/CRM/Utils/Check/Env.php +++ b/CRM/Utils/Check/Env.php @@ -130,7 +130,6 @@ class CRM_Utils_Check_Env { * Check that domain email and org name are set * @return array */ - public function checkDomainNameEmail() { $messages = array(); @@ -170,7 +169,6 @@ class CRM_Utils_Check_Env { * Checks if a default bounce handling mailbox is set up * @return array */ - public function checkDefaultMailbox() { $messages = array(); $config = CRM_Core_Config::singleton(); @@ -196,7 +194,6 @@ class CRM_Utils_Check_Env { * Checks if cron has run in a reasonable amount of time * @return array */ - public function checkLastCron() { $messages = array(); @@ -249,12 +246,11 @@ class CRM_Utils_Check_Env { * Checks if new versions are available * @return array */ - public function checkVersion() { $messages = array(); if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'versionAlert', NULL, 1)) { - $vc = CRM_Utils_VersionCheck::singleton(); + $vc = CRM_Utils_VersionCheck::singleton(); $newerVersion = $vc->isNewerVersionAvailable(); if ($newerVersion['version']) { @@ -315,7 +311,6 @@ class CRM_Utils_Check_Env { * Checks if extensions are set up properly * @return array */ - public function checkExtensions() { $messages = array(); $extensionSystem = CRM_Extension_System::singleton(); @@ -419,7 +414,9 @@ class CRM_Utils_Check_Env { elseif (!empty($okextensions)) { $msg .= ' ' . ts('Other extensions are up-to-date:') . ' ' . implode(', ', $okextensions); } - $returnValues = array( // OK, return several data rows + + // OK, return several data rows + $returnValues = array( array('status' => $return, 'message' => $msg), ); @@ -457,7 +454,6 @@ class CRM_Utils_Check_Env { * Checks if CiviCRM database version is up-to-date * @return array */ - public function checkDbVersion() { $messages = array(); $dbVersion = CRM_Core_BAO_Domain::version(); @@ -524,7 +520,6 @@ class CRM_Utils_Check_Env { * ensure that all CiviCRM tables are InnoDB * @return array */ - public function checkDbEngine() { $messages = array(); diff --git a/CRM/Utils/Check/Message.php b/CRM/Utils/Check/Message.php index db6804dd12..df72433f92 100644 --- a/CRM/Utils/Check/Message.php +++ b/CRM/Utils/Check/Message.php @@ -122,7 +122,7 @@ class CRM_Utils_Check_Message { /** * Set optional additional help text - * @param string help + * @param string $help */ public function addHelp($help) { $this->help = $help; diff --git a/CRM/Utils/VersionCheck.php b/CRM/Utils/VersionCheck.php index 57685e7b20..a2a56337fb 100644 --- a/CRM/Utils/VersionCheck.php +++ b/CRM/Utils/VersionCheck.php @@ -191,7 +191,7 @@ class CRM_Utils_VersionCheck { if ($this->versionInfo && $this->localVersion) { if (isset($this->versionInfo[$this->localMajorVersion])) { - switch(CRM_Utils_Array::value('status', $this->versionInfo[$this->localMajorVersion])) { + switch (CRM_Utils_Array::value('status', $this->versionInfo[$this->localMajorVersion])) { case 'stable': case 'lts': case 'testing': @@ -261,7 +261,7 @@ class CRM_Utils_VersionCheck { if (version_compare($this->localVersion, $release['version']) < 0) { if (!$this->ignoreDate || $this->ignoreDate < $release['date']) { $newerVersion['newest'] = $release['version']; - if (CRM_Utils_Array::value('security',$release)) { + if (CRM_Utils_Array::value('security', $release)) { $newerVersion['security'] = $release['version']; } } diff --git a/api/v3/System.php b/api/v3/System.php index 81a7a597ae..89d3cb8b7c 100644 --- a/api/v3/System.php +++ b/api/v3/System.php @@ -85,10 +85,10 @@ function _civicrm_api3_system_flush_spec(&$params) { function _civicrm_api3_system_check_spec(&$spec) { // $spec['magicword']['api.required'] = 1; $spec['show_hushed'] = array( - 'api.default' => false, - 'title' => 'show hushed', + 'api.default' => FALSE, + 'title' => 'Show hushed', 'type' => CRM_Utils_Type::T_BOOLEAN, - ); + ); } /** @@ -105,7 +105,7 @@ function _civicrm_api3_system_check_spec(&$spec) { function civicrm_api3_system_check($params) { $returnValues = array(); $messages = CRM_Utils_Check::singleton()->checkAll(CRM_Utils_Array::value('show_hushed', $params)); - foreach ( $messages as $msg) { + foreach ($messages as $msg) { $returnValues[] = $msg->toArray(); } diff --git a/tests/phpunit/CRM/Utils/versionCheckTest.php b/tests/phpunit/CRM/Utils/versionCheckTest.php index 486c139f39..f65faffe4e 100644 --- a/tests/phpunit/CRM/Utils/versionCheckTest.php +++ b/tests/phpunit/CRM/Utils/versionCheckTest.php @@ -144,7 +144,6 @@ class CRM_Utils_versionCheckTest extends CiviUnitTestCase { // notice on site running EOL version that doesn't have a security release $data[] = array('4.2.19', $this->sampleVersionInfo, '4.5.5'); - return $data; } -- 2.25.1