Skip to content

Commit

Permalink
Merge branch '2024.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlabci committed Feb 18, 2025
2 parents 2b8d0df + 6b0f057 commit 7d39868
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions tine20/Tinebase/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,20 @@ protected static function getPrimaryGroupForUser(Tinebase_Model_FullUser $user):
try {
$group = Tinebase_Group::getInstance()->getGroupById($user->accountPrimaryGroup);
} catch (Tinebase_Exception_Record_NotDefined $tern) {
$group = self::_getPrimaryGroupFromSyncBackend($user);
try {
$group = self::_getPrimaryGroupFromSyncBackend($user);
} catch (Tinebase_Exception $te) {
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
. ' ' . $te->getMessage());
}
$group = Tinebase_Group::getInstance()->getDefaultGroup();
if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) {
Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
. ' Assign default user group: ' . $group->name);
}
$user->accountPrimaryGroup = $group;
}
}

return $group;
Expand Down Expand Up @@ -833,8 +846,10 @@ protected static function _getPrimaryGroupFromSyncBackend(Tinebase_Model_FullUse
throw new Tinebase_Exception('Group already exists but it has a different ID: ' . $group->name);

} catch (Tinebase_Exception_Record_NotDefined $tern) {
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
. " Adding group " . $group->name);
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
. " Adding group " . $group->name);
}

$transactionId = Tinebase_TransactionManager::getInstance()
->startTransaction(Tinebase_Core::getDb());
Expand Down

0 comments on commit 7d39868

Please sign in to comment.