]> source.dussan.org Git - nextcloud-server.git/commitdiff
only triger metadata preload logic when at least one metadata is requested 40473/head
authorRobin Appelman <robin@icewind.nl>
Mon, 14 Aug 2023 11:01:14 +0000 (13:01 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Mon, 18 Sep 2023 09:31:06 +0000 (09:31 +0000)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/dav/lib/Connector/Sabre/FilesPlugin.php

index 7d7b27df890ace5c14a0ab5a72b000e682a8aae0..709a4cd68ed8f0ba736ece63d4160d5f4a00d8e1 100644 (file)
@@ -465,13 +465,17 @@ class FilesPlugin extends ServerPlugin {
 
                        $requestProperties = $propFind->getRequestedProperties();
 
-                       if ($this->config->getSystemValueBool('enable_file_metadata', true) && $propFind->getDepth() === 1) {
-                               $requestedMetaData = [];
-                               foreach ($requestProperties as $requestProperty) {
-                                       if (isset(self::ALL_METADATA_PROPS[$requestProperty])) {
-                                               $requestedMetaData[] = self::ALL_METADATA_PROPS[$requestProperty];
-                                       }
+                       $requestedMetaData = [];
+                       foreach ($requestProperties as $requestProperty) {
+                               if (isset(self::ALL_METADATA_PROPS[$requestProperty])) {
+                                       $requestedMetaData[] = self::ALL_METADATA_PROPS[$requestProperty];
                                }
+                       }
+                       if (
+                               $this->config->getSystemValueBool('enable_file_metadata', true) &&
+                               $propFind->getDepth() === 1 &&
+                               $requestedMetaData
+                       ) {
                                $children = $node->getChildren();
                                // Preloading of the metadata