sabre-io / Baikal

Baïkal is a Calendar+Contacts server
https://sabre.io/baikal/
GNU General Public License v3.0
2.46k stars 284 forks source link

TypeError: HTTP error 500 while deleting calendar entry #1147

Open lebonMIA opened 1 year ago

lebonMIA commented 1 year ago

Baikal version: 0.9.3

Expected behaviour: deleting a calendar entry should delete the entry and return with HTTP status 200

Current behaviour: the request ends up with error 500 and the following PHP error (the entry is not deleted) :

PHP message: TypeError: Argument 1 passed to Sabre\Uri\parse() must be of the type string, null given, called in /usr/share/nginx/baikal-0.9.3/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/PDO.php on line 299 and defined in /usr/share/nginx/baikal-0.9.3/vendor/sabre/uri/lib/functions.php:184
Stack trace:
#0 /usr/share/nginx/baikal-0.9.3/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/PDO.php(299): Sabre\Uri\parse()
#1 /usr/share/nginx/baikal-0.9.3/vendor/sabre/dav/lib/DAVACL/AbstractPrincipalCollection.php(176): Sabre\DAVACL\PrincipalBackend\PDO->findByUri()
#2 /usr/share/nginx/baikal-0.9.3/vendor/sabre/dav/lib/DAVACL/Plugin.php(697): Sabre\DAVACL\AbstractPrincipalCollection->findByUri()
#3 /usr/share/nginx/baikal-0.9.3/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php(417): Sabre\DAVACL\Plugin->getPrincipalByUri()
#4 /usr/share/nginx/baikal-0.9.3/vendor/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\CalDAV\Schedule\Plugin->scheduleLocalDelivery()
#5 /usr/share/nginx/baikal-0.9.3/vendor/sabre/dav/l

Steps to reproduce:

I attached the ICS file (slightly modified to hide personal data).

a5adbe37-de59-4026-9c5a-0ffeb57386b1.ics.txt

Then, try do delete the entry (eg: DELETE /cal.php/calendars/XXX/YYY/a5adbe37-de59-4026-9c5a-0ffeb57386b1.ics) and this should trigger the error.