fix: [sync] better logging of error messages and handle the user ID not being set by background processes

pull/6378/head
iglocska 2020-09-30 09:43:12 +02:00
parent 6255f631cb
commit 14400a932d
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 5 additions and 1 deletions

View File

@ -1169,8 +1169,10 @@ class Event extends AppModel
$newTextBody = $response->body();
return 404;
case '405':
$newTextBody = $response->body();
return 405;
case '403': // Not authorised
$newTextBody = $response->body();
return 403;
}
}
@ -2153,7 +2155,9 @@ class Event extends AppModel
$this->Feed = ClassRegistry::init('Feed');
}
// Precache current user email
$userEmails = array($user['id'] => $user['email']);
if (!empty($user['id'])) {
$userEmails = array($user['id'] => $user['email']);
}
// Do some refactoring with the event
$fields = array(
'common' => array('distribution', 'sharing_group_id', 'uuid'),