fix group attendee resolving for pgsql
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 28 Sep 2016 14:06:47 +0000 (16:06 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 29 Sep 2016 06:04:17 +0000 (08:04 +0200)
... and use break instead of continue in switch()

0012220: creating event exceptions with group attendee lose group

Change-Id: Id0a2a92edee39fb054cf393163b5fb632d505c0c
Reviewed-on: http://gerrit.tine20.com/customers/3625
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Calendar/Frontend/ActiveSyncTest.php
tine20/Calendar/Frontend/ActiveSync.php

index 5bed457..409bd66 100644 (file)
@@ -1310,7 +1310,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAMA
 
         // assert created group & groupmembers
         $syncrotonEventtoUpdate = $controller->getEntry(new Syncroton_Model_SyncCollection(array('collectionId' => $syncrotonFolder->serverId)), $serverId);
-        $this->assertCount(count($defaultUserGroupMembers) + 1, $syncrotonEventtoUpdate->attendees, 'groupmembers not resolved');
+        $this->assertCount(count($defaultUserGroupMembers) + 1, $syncrotonEventtoUpdate->attendees, 'groupmembers not resolved: ' . print_r($syncrotonEventtoUpdate->attendees, true));
         $this->assertCount(count($defaultUserGroupMembers) + 1, $syncrotonEventtoUpdate->exceptions[0]->attendees, 'groupmembers not resolved');
 
         // update event
index 6a7fac0..009a994 100644 (file)
@@ -284,9 +284,9 @@ class Calendar_Frontend_ActiveSync extends ActiveSync_Frontend_Abstract implemen
                     
                 case 'attendee':
                     if ($this->_device->devicetype === Syncroton_Model_Device::TYPE_IPHONE &&
-                        $this->_syncFolderId       !== $this->_getDefaultContainerId()) {
+                        $this->_syncFolderId       != $this->_getDefaultContainerId()) {
                         
-                        continue;
+                        break;
                     }
                     
                     // fill attendee cache
@@ -556,7 +556,7 @@ class Calendar_Frontend_ActiveSync extends ActiveSync_Frontend_Abstract implemen
                 } else {
                     if ($tine20Property === 'attendee' && $entry &&
                         $this->_device->devicetype === Syncroton_Model_Device::TYPE_IPHONE &&
-                        $this->_syncFolderId       !== $this->_getDefaultContainerId()) {
+                        $this->_syncFolderId       != $this->_getDefaultContainerId()) {
                             // keep attendees as the are / they were not sent to the device before
                     } else {
                         if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(
@@ -570,18 +570,17 @@ class Calendar_Frontend_ActiveSync extends ActiveSync_Frontend_Abstract implemen
             switch ($tine20Property) {
                 case 'alarms':
                     // handled after switch statement
-                    
                     break;
                     
                 case 'attendee':
                     if ($entry && 
                         $this->_device->devicetype === Syncroton_Model_Device::TYPE_IPHONE &&
-                        $this->_syncFolderId       !== $this->_getDefaultContainerId()) {
+                        $this->_syncFolderId       != $this->_getDefaultContainerId()) {
 
                         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(
                             __METHOD__ . '::' . __LINE__ . " keep attendees as the are / they were not sent to the device before ");
 
-                        continue;
+                        break;
                     }
 
                     $newAttendees = array();