[Pkg-owncloud-commits] [php-sabredav] 252/275: Don't trigger scheduling operations when an object is moved to a new calendar.

David Prévot taffit at moszumanska.debian.org
Thu Sep 25 14:56:16 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 6362eead9d880dc2e6c8bfe50b8bc946f1e89992
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Fri Sep 19 19:38:04 2014 +0100

    Don't trigger scheduling operations when an object is moved to a new calendar.
    
    Fixes #526.
---
 lib/CalDAV/Schedule/Plugin.php                     |  4 +++
 .../Sabre/CalDAV/Schedule/ScheduleDeliverTest.php  | 34 ++++++++++++++++++++--
 2 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/lib/CalDAV/Schedule/Plugin.php b/lib/CalDAV/Schedule/Plugin.php
index 229dcb4..9f623ce 100644
--- a/lib/CalDAV/Schedule/Plugin.php
+++ b/lib/CalDAV/Schedule/Plugin.php
@@ -382,6 +382,10 @@ class Plugin extends ServerPlugin {
      */
     function beforeUnbind($path) {
 
+        // FIXME: We shouldn't trigger this functionality when we're issuing a
+        // MOVE. This is a hack.
+        if ($this->server->httpRequest->getMethod()==='MOVE') return;
+
         $node = $this->server->tree->getNodeForPath($path);
 
         if (!$node instanceof ICalendarObject || $node instanceof ISchedulingObject) {
diff --git a/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php b/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php
index 8348c20..5535c1f 100644
--- a/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php
+++ b/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php
@@ -238,6 +238,34 @@ ICS;
 
     }
 
+    /**
+     * A MOVE request will trigger an unbind on a scheduling resource.
+     *
+     * However, we must not treat it as a cancellation, it just got moved to a
+     * different calendar.
+     */
+    function testUnbindIgnoredOnMove() {
+
+        $newObject = null;
+
+        $oldObject = <<<ICS
+BEGIN:VCALENDAR
+BEGIN:VEVENT
+UID:foo
+DTSTART:20140811T230000Z
+ORGANIZER:mailto:user1.sabredav at sabredav.org
+ATTENDEE:mailto:user2.sabredav at sabredav.org
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+
+        $this->server->httpRequest->setMethod('MOVE');
+        $this->deliver($oldObject, $newObject);
+        $this->assertItemsInInbox('user2', 0);
+
+    }
+
     function testDeletedInviteWrongUrl() {
 
         $newObject = null;
@@ -362,7 +390,7 @@ END:VCALENDAR
 ICS;
 
         $this->server->on('propFind', function($propFind) {
-            $propFind->set('{' . Plugin::NS_CALDAV . '}schedule-inbox-URL', null, 403); 
+            $propFind->set('{' . Plugin::NS_CALDAV . '}schedule-inbox-URL', null, 403);
         });
         $this->deliver(null, $newObject);
 
@@ -398,7 +426,7 @@ END:VCALENDAR
 ICS;
 
         $this->server->on('propFind', function($propFind) {
-            $propFind->set('{' . Plugin::NS_CALDAV . '}calendar-home-set', null, 403); 
+            $propFind->set('{' . Plugin::NS_CALDAV . '}calendar-home-set', null, 403);
         });
         $this->deliver(null, $newObject);
 
@@ -433,7 +461,7 @@ END:VCALENDAR
 ICS;
 
         $this->server->on('propFind', function($propFind) {
-            $propFind->set('{' . Plugin::NS_CALDAV . '}schedule-default-calendar-URL', null, 403); 
+            $propFind->set('{' . Plugin::NS_CALDAV . '}schedule-default-calendar-URL', null, 403);
         });
         $this->deliver(null, $newObject);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list