diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2024-10-24 15:35:19 +0200 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2024-10-29 09:08:31 +0100 |
commit | d51cf4536c665ea208ca9bb452ec8841c15a5f35 (patch) | |
tree | 674a9a29a6a671f26b120d9b28da40bfdeca644f /apps/dav/lib | |
parent | db546e1f55814c4eee8df792a66922bf8d9c926f (diff) | |
download | nextcloud-server-d51cf4536c665ea208ca9bb452ec8841c15a5f35.tar.gz nextcloud-server-d51cf4536c665ea208ca9bb452ec8841c15a5f35.zip |
feat(systemtags): add cypress tests and fix a few logic issues
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/SystemTag/SystemTagPlugin.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php index c88a69f1154..00585953b29 100644 --- a/apps/dav/lib/SystemTag/SystemTagPlugin.php +++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php @@ -21,7 +21,6 @@ use OCP\Util; use Sabre\DAV\Exception\BadRequest; use Sabre\DAV\Exception\Conflict; use Sabre\DAV\Exception\Forbidden; -use Sabre\DAV\Exception\PreconditionFailed; use Sabre\DAV\Exception\UnsupportedMediaType; use Sabre\DAV\PropFind; use Sabre\DAV\PropPatch; @@ -218,8 +217,8 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { $propFind->setPath(str_replace('systemtags-assigned/', 'systemtags/', $propFind->getPath())); } - $propFind->handle(FilesPlugin::GETETAG_PROPERTYNAME, function () use ($node): string|null { - return $node->getSystemTag()->getETag(); + $propFind->handle(FilesPlugin::GETETAG_PROPERTYNAME, function () use ($node): string { + return '"' . ($node->getSystemTag()->getETag() ?? '') . '"'; }); $propFind->handle(self::ID_PROPERTYNAME, function () use ($node) { @@ -379,7 +378,7 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { if (isset($props[self::OBJECTIDS_PROPERTYNAME])) { $propValue = $props[self::OBJECTIDS_PROPERTYNAME]; - if (!($propValue instanceof SystemTagsObjectList) || count($propValue?->getObjects() ?: []) === 0) { + if (!($propValue instanceof SystemTagsObjectList) || count($propValue->getObjects()) === 0) { throw new BadRequest('Invalid object-ids property'); } |