mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Merge pull request #52630 from nextcloud/fix/files/activity-rich-object-strings
This commit is contained in:
commit
0e0abcbdc4
2 changed files with 4 additions and 4 deletions
|
|
@ -319,7 +319,7 @@ class Provider implements IProvider {
|
|||
protected function getFile($parameter, ?IEvent $event = null): array {
|
||||
if (is_array($parameter)) {
|
||||
$path = reset($parameter);
|
||||
$id = (string)key($parameter);
|
||||
$id = (int)key($parameter);
|
||||
} elseif ($event !== null) {
|
||||
// Legacy from before ownCloud 8.2
|
||||
$path = $parameter;
|
||||
|
|
@ -341,7 +341,7 @@ class Provider implements IProvider {
|
|||
|
||||
return [
|
||||
'type' => 'file',
|
||||
'id' => $encryptionContainer->getId(),
|
||||
'id' => (string)$encryptionContainer->getId(),
|
||||
'name' => $encryptionContainer->getName(),
|
||||
'path' => $path,
|
||||
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $encryptionContainer->getId()]),
|
||||
|
|
@ -354,7 +354,7 @@ class Provider implements IProvider {
|
|||
|
||||
return [
|
||||
'type' => 'file',
|
||||
'id' => $id,
|
||||
'id' => (string)$id,
|
||||
'name' => basename($path),
|
||||
'path' => trim($path, '/'),
|
||||
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $id]),
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class ProviderTest extends TestCase {
|
|||
return [
|
||||
[[42 => '/FortyTwo.txt'], null, '42', 'FortyTwo.txt', 'FortyTwo.txt'],
|
||||
[['23' => '/Twenty/Three.txt'], null, '23', 'Three.txt', 'Twenty/Three.txt'],
|
||||
['/Foo/Bar.txt', 128, 128, 'Bar.txt', 'Foo/Bar.txt'], // Legacy from ownCloud 8.2 and before
|
||||
['/Foo/Bar.txt', 128, '128', 'Bar.txt', 'Foo/Bar.txt'], // Legacy from ownCloud 8.2 and before
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue