Merge pull request #52532 from nextcloud/fix/public-displayname-owner

This commit is contained in:
John Molakvoæ 2025-04-30 11:32:05 +02:00 committed by GitHub
commit 57e0ffcb27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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();