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 8, 2025
1 parent 9e2048b commit fa01d4c
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 @@ -148,15 +148,16 @@ public function wopiPutFile(MediaInterface $media, FileInterface $file, UserInte
$new_file_content = $request->getContent();
$new_file = $this->createNewFileEntity($file, $new_file_content);

$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' => date('c', $new_file->getChangedTime()),
Expand Down

0 comments on commit fa01d4c

Please sign in to comment.