Merge branch '2013.10' into 2014.11
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 27 Aug 2015 12:32:25 +0000 (14:32 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 27 Aug 2015 12:32:25 +0000 (14:32 +0200)
Conflicts:
tine20/Tinebase/User.php

Change-Id: I1f2ff4290ef3d027c911348ad24a0cdedff91ac1

1  2 
tine20/Tinebase/Container.php
tine20/Tinebase/User.php

Simple merge
@@@ -542,19 -536,22 +538,24 @@@ class Tinebase_Use
          try {
              $contact = $addressbook->getByUserId($syncedUser->getId());
              $originalContact = clone $contact;
-             
              Tinebase_User::getInstance()->updateContactFromSyncBackend($syncedUser, $contact);
              $contact = self::_user2Contact($syncedUser, $contact);
-             
-             // TODO allow to diff jpegphoto, too
+             if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
+                 . print_r($syncedUser->toArray(), true)
+                 . ' new: ' . print_r($contact->toArray(), true)
+                 . ' orig:' . print_r($originalContact->toArray(), true));
+             // TODO allow to diff jpegphoto, too / maybe this should only be done when called via CLI/cronjob
              $diff = $contact->diff($originalContact, array('jpegphoto'));
-             if (! $diff->isEmpty()) {
+             if (! $diff->isEmpty() || ($originalContact->jpegphoto == 0 && ! empty($contact->jpegphoto))) {
                  // add modlog info
                  Tinebase_Timemachine_ModificationLog::setRecordMetaData($contact, 'update');
 -                Tinebase_Container::getInstance()->increaseContentSequence($contact->container_id);
 -
 +                if ($contact->container_id !== null) {
 +                    Tinebase_Container::getInstance()->increaseContentSequence($contact->container_id);
 +                }
 +                
                  if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
                      . ' Updating contact data for user ' . $syncedUser->accountLoginName);
                  if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__