Skip to content

Commit

Permalink
Issue 83: Inline $old_file_uri.
Browse files Browse the repository at this point in the history
  • Loading branch information
donquixote committed Jan 9, 2025
1 parent 8af94db commit 5473bbf
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 @@ -182,11 +182,12 @@ public function wopiPutFile(MediaInterface $media, FileInterface $file, UserInte
* This may have a different uri, but will have the same filename.
*/
protected function createNewFileEntity(FileInterface $file, string $new_file_content): FileInterface {
$old_file_uri = $file->getFileUri();

// Attempt to reuse the old file uri for the new file.
// This will trigger a rename with number suffix, because the old file still
// exists in the filesystem.
$new_file_uri = $this->fileSystem->saveData(
$new_file_content,
$old_file_uri,
$file->getFileUri(),
FileExists::Rename,
);

Expand Down

0 comments on commit 5473bbf

Please sign in to comment.