From 55f7977c79178778fa76a5d9a04ec594f176d32b Mon Sep 17 00:00:00 2001 From: Marc Michalsky forumZFD Date: Thu, 18 Mar 2021 15:54:49 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20code=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CRM/TwingleCampaign/BAO/TwingleCampaign.php | 5 ++- CRM/TwingleCampaign/Upgrader.php | 38 ++++++++++----------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/CRM/TwingleCampaign/BAO/TwingleCampaign.php b/CRM/TwingleCampaign/BAO/TwingleCampaign.php index 74411cc..3bc15e9 100644 --- a/CRM/TwingleCampaign/BAO/TwingleCampaign.php +++ b/CRM/TwingleCampaign/BAO/TwingleCampaign.php @@ -163,10 +163,9 @@ class CRM_TwingleCampaign_BAO_TwingleCampaign { // UI, log an error and delete this TwingleCampaign else { CRM_Core_Session::setStatus( - ts("Could not determine parent TwingleProject URL. This URL is - needed to create the TwingleEvent URL. Please check the logs."), + ts("Could not determine parent TwingleProject URL. This URL is needed to create the TwingleEvent URL. Please check the logs."), ts('Parent project URL missing'), - 'alert' + 'error' ); Civi::log()->error( E::LONG_NAME . diff --git a/CRM/TwingleCampaign/Upgrader.php b/CRM/TwingleCampaign/Upgrader.php index f17783e..dea29ab 100644 --- a/CRM/TwingleCampaign/Upgrader.php +++ b/CRM/TwingleCampaign/Upgrader.php @@ -147,13 +147,13 @@ class CRM_TwingleCampaign_Upgrader extends CRM_TwingleCampaign_Upgrader_Base { public function enable() { // Enable cron job try { - $jobId = civicrm_api3('Job', 'getsingle', [ - 'name' => "TwingleSync", - ])['id']; - civicrm_api3('Job', 'create', [ - 'id' => $jobId, - 'is_active' => 1, - ]); + $jobId = civicrm_api3('Job', 'getsingle', [ + 'name' => "TwingleSync", + ])['id']; + civicrm_api3('Job', 'create', [ + 'id' => $jobId, + 'is_active' => 1, + ]); } catch (CiviCRM_API3_Exception $e) { Civi::log()->error( E::LONG_NAME . @@ -200,18 +200,18 @@ class CRM_TwingleCampaign_Upgrader extends CRM_TwingleCampaign_Upgrader_Base { } - /** - * Example: Run a couple simple queries. - * - * @return TRUE on success - * @throws Exception - * - * public function upgrade_4200() { - * $this->ctx->log->info('Applying update 4200'); - * CRM_Core_DAO::executeQuery('UPDATE foo SET bar = "whiz"'); - * CRM_Core_DAO::executeQuery('DELETE FROM bang WHERE willy = wonka(2)'); - * return TRUE; - * } // */ + /** + * Example: Run a couple simple queries. + * + * @return TRUE on success + * @throws Exception + * + * public function upgrade_4200() { + * $this->ctx->log->info('Applying update 4200'); + * CRM_Core_DAO::executeQuery('UPDATE foo SET bar = "whiz"'); + * CRM_Core_DAO::executeQuery('DELETE FROM bang WHERE willy = wonka(2)'); + * return TRUE; + * } // */ /**