From 23836abaecae31ab8424ff454adc698a88f9b74f Mon Sep 17 00:00:00 2001 From: Andreas Hennings Date: Thu, 9 Jan 2025 00:52:38 +0100 Subject: [PATCH] Issue 83: Reorder statements in wopiPutFile(). --- src/Controller/WopiController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Controller/WopiController.php b/src/Controller/WopiController.php index b58feaf9..826526ec 100644 --- a/src/Controller/WopiController.php +++ b/src/Controller/WopiController.php @@ -151,15 +151,16 @@ public function wopiPutFile(MediaInterface $media, FileInterface $file, UserInte $new_file = $this->createNewFileEntity($file, $new_file_content); $mtime = date_create_immutable_from_format('U', $new_file->getChangedTime()); + $save_reason = $this->buildSaveReason($request); + $this->mediaHelper->setMediaSource($media, $new_file); $media->setRevisionUser($user); $media->setRevisionCreationTime($this->time->getRequestTime()); - - $save_reason = $this->buildSaveReason($request); - $this->logger->error('Save reason: ' . $save_reason); $media->setRevisionLogMessage($save_reason); $media->save(); + $this->logger->error('Save reason: ' . $save_reason); + return new JsonResponse( [ 'LastModifiedTime' => $mtime->format('c'),