From bcc8de0c9ddfa9d16f1941ab8b53db581de7702b Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Tue, 29 Apr 2025 16:25:02 +0200 Subject: fix(files_sharing): bring back owner and ownerDisplayName initial state Signed-off-by: skjnldsv --- apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php | 4 +++- apps/files_sharing/tests/Controller/ShareControllerTest.php | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'apps/files_sharing') diff --git a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php index caadd89b46c..686ba32fd49 100644 --- a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php +++ b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php @@ -70,8 +70,10 @@ class DefaultPublicShareTemplateProvider implements IPublicShareTemplateProvider $ownerNameProperty = $ownerAccount->getProperty(IAccountManager::PROPERTY_DISPLAYNAME); if ($ownerNameProperty->getScope() === IAccountManager::SCOPE_PUBLISHED) { - $ownerName = $owner->getDisplayName(); $ownerId = $owner->getUID(); + $ownerName = $owner->getDisplayName(); + $this->initialState->provideInitialState('owner', $ownerId); + $this->initialState->provideInitialState('ownerDisplayName', $ownerName); } } diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php index 0ed43da52cd..58cbb4e0b82 100644 --- a/apps/files_sharing/tests/Controller/ShareControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php @@ -330,6 +330,8 @@ class ShareControllerTest extends \Test\TestCase { 'filename' => $filename, 'view' => $view, 'fileId' => 111, + 'owner' => 'ownerUID', + 'ownerDisplayName' => 'ownerDisplay', ]; $response = $this->shareController->showShare(); @@ -470,6 +472,8 @@ class ShareControllerTest extends \Test\TestCase { 'filename' => $filename, 'view' => 'public-file-drop', 'disclaimer' => 'My disclaimer text', + 'owner' => 'ownerUID', + 'ownerDisplayName' => 'ownerDisplay', ]; $response = $this->shareController->showShare(); -- cgit v1.2.3