X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog/unreleased/39314
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bugfix: File version names for share recipients

With this fix, file version names now match with the actual
file name for share recipients. Before, the name has been the
timestamp of the version file.

https://github.com/owncloud/core/pull/39314
https://github.com/owncloud/core/issues/36228
13 changes: 9 additions & 4 deletions lib/private/Files/Meta/MetaFileVersionNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
use OCP\Files\ForbiddenException;
use OCP\Files\IProvidesAdditionalHeaders;
use OC\Preview;
use OCA\Files_Sharing\SharedStorage;
use OCP\Files\IRootFolder;
use OCP\Files\IPreviewNode;
use OCP\Files\Storage\IVersionedStorage;
use OCP\Files\Storage;
use OCP\Files\Storage\IStorage;
use OCP\IImage;

/**
Expand All @@ -45,7 +46,7 @@ class MetaFileVersionNode extends AbstractFile implements IPreviewNode, IProvide
private $versionId;
/** @var MetaVersionCollection */
private $parent;
/** @var IVersionedStorage */
/** @var IStorage|IVersionedStorage|SharedStorage */
private $storage;
/** @var string */
private $internalPath;
Expand All @@ -60,14 +61,14 @@ class MetaFileVersionNode extends AbstractFile implements IPreviewNode, IProvide
* @param MetaVersionCollection $parent
* @param IRootFolder $root
* @param array $version
* @param Storage $storage
* @param IStorage|IVersionedStorage|SharedStorage $storage
* @param string $internalPath
*/
public function __construct(
MetaVersionCollection $parent,
IRootFolder $root,
array $version,
Storage\IStorage $storage,
IStorage $storage,
$internalPath
) {
$this->parent = $parent;
Expand Down Expand Up @@ -146,6 +147,10 @@ public function getHeaders() {
* @inheritdoc
*/
public function getContentDispositionFileName() {
if ($this->storage->instanceOfStorage(SharedStorage::class)) {
$mountPoint = $this->storage->getMountPoint();
return \basename($mountPoint);
}
return \basename($this->internalPath);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ Feature: dav-versions
And the version folder of file "/Shares/sharefile.txt" for user "Brian" should contain "1" element
And the version folder of file "/sharefile.txt" for user "Alice" should contain "1" element

@issue-36228 @skipOnOcV10
@skipOnOcV10.6 @skipOnOcV10.7 @skipOnOcV10.8.0
Scenario: download old versions of a shared file as share receiver
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "uploaded content" to "textfile0.txt"
Expand Down

This file was deleted.

X Tutup