From c2f2f21673d5eabc496643c3c9b52b64223797ed Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Mon, 17 Feb 2025 12:04:18 +0100 Subject: feat: Support deleting metadata from WebDAV The `$value` will be `null` if the update is wrapped inside a `...` block. Signed-off-by: Louis Chemineau --- apps/dav/lib/Connector/Sabre/FilesPlugin.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'apps') diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index dff71cbfaaf..ec84486b556 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -599,6 +599,12 @@ class FilesPlugin extends ServerPlugin { throw new FilesMetadataException('you do not have enough rights to update \'' . $metadataKey . '\' on this node'); } + if ($value === null) { + $metadata->unset($metadataKey); + $filesMetadataManager->saveMetadata($metadata); + return true; + } + // If the metadata is unknown, it defaults to string. try { $type = $knownMetadata->getType($metadataKey); -- cgit v1.2.3