From 1eb3ee980d350453a68ef3d9cadbfee6bbcd24ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Mon, 2 Mar 2020 12:52:58 +0100 Subject: [PATCH] Fixes #36920 - custom properties are now properly set on REPORT with depth !== 0 --- apps/dav/lib/DAV/FileCustomPropertiesBackend.php | 2 +- changelog/unreleased/37058 | 4 ++++ .../features/apiWebdavProperties/getFileProperties.feature | 4 +--- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/37058 diff --git a/apps/dav/lib/DAV/FileCustomPropertiesBackend.php b/apps/dav/lib/DAV/FileCustomPropertiesBackend.php index 5b61b7368876..96d34ff8215b 100644 --- a/apps/dav/lib/DAV/FileCustomPropertiesBackend.php +++ b/apps/dav/lib/DAV/FileCustomPropertiesBackend.php @@ -248,7 +248,6 @@ protected function loadChildrenProperties(INode $node, $requestedProperties) { $sql .= ' AND `propertyname` in (?) ORDER BY `propertyname`'; $fileIdChunks = $this->getChunks($childrenIds, \count($requestedProperties)); - $props = []; foreach ($fileIdChunks as $chunk) { $result = $this->connection->executeQuery( $sql, @@ -256,6 +255,7 @@ protected function loadChildrenProperties(INode $node, $requestedProperties) { [Connection::PARAM_STR_ARRAY, Connection::PARAM_STR_ARRAY] ); while ($row = $result->fetch()) { + $props = $this->offsetGet($row['fileid']) ?? []; $props[$row['propertyname']] = $row['propertyvalue']; $this->offsetSet($row['fileid'], $props); } diff --git a/changelog/unreleased/37058 b/changelog/unreleased/37058 new file mode 100644 index 000000000000..2be4e2889eb5 --- /dev/null +++ b/changelog/unreleased/37058 @@ -0,0 +1,4 @@ +Change: Return correct custom dav properties for folder contents + +https://github.com/owncloud/core/pull/37058 +https://github.com/owncloud/core/issues/36920 diff --git a/tests/acceptance/features/apiWebdavProperties/getFileProperties.feature b/tests/acceptance/features/apiWebdavProperties/getFileProperties.feature index 80aafa691ea3..07f346d6dac8 100644 --- a/tests/acceptance/features/apiWebdavProperties/getFileProperties.feature +++ b/tests/acceptance/features/apiWebdavProperties/getFileProperties.feature @@ -231,10 +231,8 @@ Feature: get file properties Then the HTTP status code should be success And as user "user0" the last response should have the following properties | resource | property | value | - | /TestFolder/test1.txt | testprop1 | CCCCC | - #| /TestFolder/test1.txt | testprop1 | AAAAA | + | /TestFolder/test1.txt | testprop1 | AAAAA | | /TestFolder/test1.txt | testprop2 | BBBBB | | /TestFolder/test2.txt | testprop1 | CCCCC | | /TestFolder/test2.txt | testprop2 | DDDDD | | /TestFolder/ | status | HTTP/1.1 404 Not Found | - #| /TestFolder/ | status | HTTP/1.1 200 OK |