Re: [Kolab-devel] caldav backend to calender plugin

Thomas Brüderli <[email protected]>
Newsgroups gmane.comp.kde.devel.kolab
Message-ID <[email protected]>
Daniel Morlock wrote:
>> * For CalDAV synchronizing, I had to change REPORT <c:calendar-query>
>> with a PROPFIND request because SabreDAV driven CalDAV servers don't
>> support queries with no query criteria.
> 
> Indeed there might be some issues with different servers. Would you mind
> to send me a patch or similar so I can add it to the caldav branch?

Please find it attached.

Kind regards,
Thomas

_______________________________________________
devel mailing list
[email protected]
https://lists.kolab.org/mailman/listinfo/devel
caldav-query-fix.diff (text/plain, 1.1 KB)
diff --git a/plugins/calendar/lib/caldav-client.php b/plugins/calendar/lib/caldav-client.php
index d39f71c..9670fba 100644
--- a/plugins/calendar/lib/caldav-client.php
+++ b/plugins/calendar/lib/caldav-client.php
@@ -192,7 +192,8 @@ class caldav_client extends Sabre\DAV\Client
      */
     public function prop_report($url, array $properties, array $event_urls = array(), $depth = 1)
     {
-        $parent_tag = sizeof($event_urls) > 0 ? "c:calendar-multiget" : "c:calendar-query";
+        $parent_tag = sizeof($event_urls) > 0 ? "c:calendar-multiget" : "d:propfind";
+        $method = sizeof($event_urls) > 0 ? 'REPORT' : 'PROPFIND';
 
         $body = '<?xml version="1.0"?>'."\n".'<'.$parent_tag.' xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">'."\n";
 
@@ -235,7 +236,7 @@ class caldav_client extends Sabre\DAV\Client
 
         $body .= '</'.$parent_tag.'>';
 
-        $response = $this->request('REPORT', $url, $body, array(
+        $response = $this->request($method, $url, $body, array(
             'Depth' => $depth,
             'Content-Type' => 'application/xml'
         ));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.