Added logging

This commit is contained in:
Michael 2020-07-21 18:30:45 +00:00
parent 186bc46721
commit e2826a98d3

View file

@ -2199,9 +2199,11 @@ class Item
$item['contact-id'] = $contact['id'];
} else {
// Shouldn't happen at all
Logger::warning('contact-id could not be fetched', ['uid' => $uid, 'item' => $item]);
$self = DBA::selectFirst('contact', ['id'], ['self' => true, 'uid' => $uid]);
if (!DBA::isResult($self)) {
// Shouldn't happen even less
Logger::warning('self contact could not be fetched', ['uid' => $uid, 'item' => $item]);
return 0;
}
$item['contact-id'] = $self['id'];