0011986: Default Calender in Preferences reset to personal
authorCornelius Weiß <c.weiss@metaways.de>
Wed, 23 Nov 2016 07:07:12 +0000 (08:07 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 23 Nov 2016 13:25:59 +0000 (14:25 +0100)
https://forge.tine20.org/view.php?id=11986

Change-Id: Ib638ea09b00956938a8a020e2e811dd74ade4585
Reviewed-on: http://gerrit.tine20.com/customers/3857
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/Frontend/Json.php

index 4733ef1..8a62f95 100644 (file)
@@ -111,7 +111,9 @@ class Calendar_Frontend_Json extends Tinebase_Frontend_Json_Abstract
         try {
             $defaultCalendarArray = Tinebase_Container::getInstance()->getContainerById($defaultCalendarId)->toArray();
             $defaultCalendarArray['account_grants'] = Tinebase_Container::getInstance()->getGrantsOfAccount(Tinebase_Core::getUser(), $defaultCalendarId)->toArray();
-            $defaultCalendarArray['ownerContact'] = Addressbook_Controller_Contact::getInstance()->getContactByUserId($defaultCalendarArray['owner_id'])->toArray();
+            if ($defaultCalendarArray['type'] != Tinebase_Model_Container::TYPE_SHARED) {
+                $defaultCalendarArray['ownerContact'] = Addressbook_Controller_Contact::getInstance()->getContactByUserId($defaultCalendarArray['owner_id'])->toArray();
+            }
         } catch (Exception $e) {
             // remove default cal pref
             Tinebase_Core::getPreference('Calendar')->deleteUserPref(Calendar_Preference::DEFAULTCALENDAR);