fix(files_sharing): bring back owner and ownerDisplayName initial state

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
skjnldsv 2025-04-29 16:25:02 +02:00 committed by John Molakvoæ
parent f26dc79480
commit bcc8de0c9d
2 changed files with 7 additions and 1 deletions

View file

@ -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);
}
}

View file

@ -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();