diff --git a/application/Espo/Services/AdminNotifications.php b/application/Espo/Services/AdminNotifications.php index 984e52ac75..66778f9f9f 100644 --- a/application/Espo/Services/AdminNotifications.php +++ b/application/Espo/Services/AdminNotifications.php @@ -64,7 +64,12 @@ class AdminNotifications implements $latestRelease = $this->getLatestRelease(); + if ($latestRelease === null) { + return; + } + if (empty($latestRelease['version'])) { + // @todo Check the logic. WTF? $this->configWriter->set('latestVersion', $latestRelease['version']); $this->configWriter->save(); diff --git a/application/Espo/Services/App.php b/application/Espo/Services/App.php index 6ca8f5864c..e2f8a12626 100644 --- a/application/Espo/Services/App.php +++ b/application/Espo/Services/App.php @@ -294,6 +294,7 @@ class App $entityManager = $this->entityManager; + /** @var string[] */ $teamIdList = $user->getLinkMultipleIdList('teams'); $groupEmailAccountPermission = $this->acl->get('groupEmailAccountPermission'); diff --git a/application/Espo/Services/Attachment.php b/application/Espo/Services/Attachment.php index b426c60419..59d87d3344 100644 --- a/application/Espo/Services/Attachment.php +++ b/application/Espo/Services/Attachment.php @@ -98,10 +98,11 @@ class Attachment extends Record $contents = ''; } - $attachment = $this->getEntityManager()->getEntity('Attachment'); + $attachment = $this->entityManager->getNewEntity('Attachment'); + $attachment->set('contents', $contents); - $this->getEntityManager()->saveEntity($attachment); + $this->entityManager->saveEntity($attachment); return $attachment; }