Skip to content

Commit e28b709

Browse files
committed
fix(TreeCacheManager): Fix hashFolder method
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent 88a35a4 commit e28b709

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/Service/TreeCacheManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ public function invalidateBookmark(int $bookmarkId): void {
181181
* @throws MultipleObjectsReturnedException|\JsonException
182182
* @throws UnsupportedOperation
183183
*/
184-
public function hashFolder($userId, int $folderId, array $fields = ['title', 'url'], string $hasFn = 'sha256') : string {
184+
public function hashFolder($userId, int $folderId, array $fields = ['title', 'url'], string $hashFn = 'sha256') : string {
185185
$hash = $this->get(self::CATEGORY_HASH, TreeMapper::TYPE_FOLDER, $folderId);
186-
$selector = $hasFn . ':' . $userId . ':' . implode(',', $fields);
186+
$selector = $hashFn . ':' . $userId . ':' . implode(',', $fields);
187187
if (isset($hash[$selector])) {
188188
return $hash[$selector];
189189
}
@@ -195,7 +195,7 @@ public function hashFolder($userId, int $folderId, array $fields = ['title', 'ur
195195
$entity = $this->folderMapper->find($folderId);
196196
$rootFolder = $this->folderMapper->findRootFolder($userId);
197197
$children = $this->getTreeMapper()->getChildrenOrder($folderId);
198-
$childHashes = array_map(function ($item) use ($fields, $entity) {
198+
$childHashes = array_map(function ($item) use ($fields, $entity, $hashFn) {
199199
switch ($item['type']) {
200200
case TreeMapper::TYPE_BOOKMARK:
201201
return $this->hashBookmark($item['id'], $fields, $hashFn);

0 commit comments

Comments
 (0)