Skip to content

Commit

Permalink
Issue 83: Reorder statements in wopiPutFile().
Browse files Browse the repository at this point in the history
  • Loading branch information
donquixote committed Jan 9, 2025
1 parent 5473bbf commit 23836ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Controller/WopiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 23836ab

Please sign in to comment.