From f0401a44c0a46d6e905eb5a78eeb54df080dd181 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 31 Mar 2022 16:29:45 +1300 Subject: [PATCH] Avoid trailing spaces in trigger output --- Civi/Core/Container.php | 4 ++-- Civi/Core/SqlTrigger/TimestampTriggers.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php index c7573f0d09..e25df78393 100644 --- a/Civi/Core/Container.php +++ b/Civi/Core/Container.php @@ -314,14 +314,14 @@ class Container { 'table' => 'civicrm_case_activity', 'when' => 'AFTER', 'event' => ['INSERT'], - 'sql' => "\nUPDATE civicrm_case SET modified_date = CURRENT_TIMESTAMP WHERE id = NEW.case_id;\n", + 'sql' => "UPDATE civicrm_case SET modified_date = CURRENT_TIMESTAMP WHERE id = NEW.case_id;", ], [ 'upgrade_check' => ['table' => 'civicrm_case', 'column' => 'modified_date'], 'table' => 'civicrm_activity', 'when' => 'BEFORE', 'event' => ['UPDATE', 'DELETE'], - 'sql' => "\nUPDATE civicrm_case SET modified_date = CURRENT_TIMESTAMP WHERE id IN (SELECT ca.case_id FROM civicrm_case_activity ca WHERE ca.activity_id = OLD.id);\n", + 'sql' => "UPDATE civicrm_case SET modified_date = CURRENT_TIMESTAMP WHERE id IN (SELECT ca.case_id FROM civicrm_case_activity ca WHERE ca.activity_id = OLD.id);", ], ], ] diff --git a/Civi/Core/SqlTrigger/TimestampTriggers.php b/Civi/Core/SqlTrigger/TimestampTriggers.php index 606bf0c737..3e613cf45b 100644 --- a/Civi/Core/SqlTrigger/TimestampTriggers.php +++ b/Civi/Core/SqlTrigger/TimestampTriggers.php @@ -195,13 +195,13 @@ class TimestampTriggers { 'table' => $relatedTableNames, 'when' => 'AFTER', 'event' => ['INSERT', 'UPDATE'], - 'sql' => "\nUPDATE {$this->getTableName()} SET {$this->getModifiedDate()} = CURRENT_TIMESTAMP WHERE id = NEW.$contactRefColumn;\n", + 'sql' => "UPDATE {$this->getTableName()} SET {$this->getModifiedDate()} = CURRENT_TIMESTAMP WHERE id = NEW.$contactRefColumn;", ]; $info[] = [ 'table' => $relatedTableNames, 'when' => 'AFTER', 'event' => ['DELETE'], - 'sql' => "\nUPDATE {$this->getTableName()} SET {$this->getModifiedDate()} = CURRENT_TIMESTAMP WHERE id = OLD.$contactRefColumn;\n", + 'sql' => "UPDATE {$this->getTableName()} SET {$this->getModifiedDate()} = CURRENT_TIMESTAMP WHERE id = OLD.$contactRefColumn;", ]; } } -- 2.25.1