Avoid trailing spaces in trigger output
authorEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 31 Mar 2022 03:29:45 +0000 (16:29 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 31 Mar 2022 03:39:04 +0000 (16:39 +1300)
Civi/Core/Container.php
Civi/Core/SqlTrigger/TimestampTriggers.php

index c7573f0d0934b074592b14b274963ae4d73cf08e..e25df78393da9891752448ee41d2bd9e3b370524 100644 (file)
@@ -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);",
           ],
         ],
       ]
index 606bf0c737885ae6ba5c3faacb5100e9601ebfd6..3e613cf45be04d822b4d8ade89202509e7f2b91a 100644 (file)
@@ -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;",
       ];
     }
   }