From c5eb6c560b64f1245c431998787ef4da3bf7ddcc Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 21 Mar 2022 15:52:30 +0200 Subject: [PATCH] type fixes --- application/Espo/Services/AdminNotifications.php | 5 +++++ application/Espo/Services/App.php | 1 + application/Espo/Services/Attachment.php | 5 +++-- 3 files changed, 9 insertions(+), 2 deletions(-) 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; }