From 6d1b37cacd25bfe255cfa1b7f93c5bdc965f97cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 1 Nov 2020 13:24:18 +0100 Subject: [PATCH] Add missing transaction to PlainCommand --- LICENSE | 2 +- files/lib/system/command/PlainCommand.class.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 7c62bb9..e6448a2 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ Additional Use Grant: You may use the Licensed Work when your application uses the Licensed Work for a purpose that does neither directly or indirectly generate revenue. -Change Date: 2024-10-31 +Change Date: 2024-11-01 Change License: Version 2 or later of the GNU General Public License as published by the Free Software Foundation. diff --git a/files/lib/system/command/PlainCommand.class.php b/files/lib/system/command/PlainCommand.class.php index 7af067d..39a63b4 100644 --- a/files/lib/system/command/PlainCommand.class.php +++ b/files/lib/system/command/PlainCommand.class.php @@ -1,11 +1,11 @@ getMessageObjectTypeID('be.bastelstu.chat.messageType.plain'); $this->setText($this->assertParameter($parameters, 'text')); + + WCF::getDB()->beginTransaction(); $message = (new MessageAction([ ], 'create', [ 'data' => [ 'roomID' => $room->roomID , 'userID' => $user->userID , 'username' => $user->username @@ -77,5 +80,6 @@ public function execute($parameters, Room $room, UserProfile $user = null) { 'hasEmbeddedObjects' => 1 ]); } + WCF::getDB()->commitTransaction(); } }