Skip to content

Commit 0682797

Browse files
committed
fix(cache): Handle groupfolder specific entries in cacheEntryFromData
Signed-off-by: Carl Schwan <carlschwan@kde.org>
1 parent 0b8eae7 commit 0682797

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

lib/private/Files/Cache/Cache.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function get($file) {
150150
* Create a CacheEntry from database row
151151
*/
152152
public static function cacheEntryFromData(array $data, IMimeTypeLoader $mimetypeLoader): CacheEntry {
153-
return new CacheEntry([
153+
$normalized = [
154154
'name' => (string)$data['name'],
155155
'etag' => (string)$data['etag'],
156156
'path' => (string)$data['path'],
@@ -177,7 +177,21 @@ public static function cacheEntryFromData(array $data, IMimeTypeLoader $mimetype
177177
'metadata' => $data['metadata'] ?? null,
178178
'meta_json' => $data['meta_json'] ?? null,
179179
'meta_sync_token' => $data['meta_sync_token'] ?? null,
180-
]);
180+
];
181+
182+
if (isset($data['folder_id'])) {
183+
// groupfolders specific fields
184+
$normalized['folder_id'] = (int)$data['folder_id'];
185+
$normalized['mount_point'] = (string)$data['mount_point'];
186+
$normalized['quota'] = $data['quota'];
187+
$normalized['acl'] = (int)$data['acl'];
188+
$normalized['acl_default_no_permission'] = (int)$data['acl_default_no_permission'];
189+
$normalized['storage_id'] = (int)$data['storage_id'];
190+
$normalized['root_id'] = (int)$data['root_id'];
191+
$normalized['options'] = (string)$data['options'];
192+
}
193+
194+
return new CacheEntry($normalized);
181195
}
182196

183197
/**

0 commit comments

Comments
 (0)