diff options
author | Louis Chemineau <louis@chmn.me> | 2025-02-17 12:04:18 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2025-03-04 12:34:11 +0100 |
commit | c2f2f21673d5eabc496643c3c9b52b64223797ed (patch) | |
tree | 18139b84f975c6ec6ea8a732cd934205f0062477 /apps | |
parent | eab718a800f453ba63554d9dd3f09a8bc8c4f75b (diff) | |
download | nextcloud-server-c2f2f21673d5eabc496643c3c9b52b64223797ed.tar.gz nextcloud-server-c2f2f21673d5eabc496643c3c9b52b64223797ed.zip |
feat: Support deleting metadata from WebDAVartonge/feat/allow_deleting_metadata
The `$value` will be `null` if the update is wrapped inside a `<d:remove>...</d:remove>` block.
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesPlugin.php | 6 |
1 files changed, 6 insertions, 0 deletions
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); |