Skip to content

EspoCRM – Open Source CRM Application

forUpdate select only ID

Yurii4fc790342c66
diff --git a/application/Espo/Tools/Currency/SyncManager.php b/application/Espo/Tools/Currency/SyncManager.php
index dc9b21b92c..6442b90c9a 100644
--- a/application/Espo/Tools/Currency/SyncManager.php
+++ b/application/Espo/Tools/Currency/SyncManager.php
@@ -35,6 +35,7 @@ use Espo\Core\Utils\Config\SystemConfig;
use Espo\Core\Utils\DataCache;
use Espo\Entities\CurrencyRecord;
use Espo\ORM\EntityManager;
+use Espo\ORM\Name\Attribute;
use Espo\ORM\Query\UpdateBuilder;
use Espo\Tools\Currency\Exceptions\NotEnabled;
@@ -116,6 +117,7 @@ class SyncManager
->getRDBRepositoryByClass(CurrencyRecord::class)
->forUpdate()
->sth()
+ ->select(Attribute::ID)
->find();
}
diff --git a/application/Espo/Tools/OAuth/TokensProvider.php b/application/Espo/Tools/OAuth/TokensProvider.php
index 5ad7ffe85b..af9ae5a19f 100644
--- a/application/Espo/Tools/OAuth/TokensProvider.php
+++ b/application/Espo/Tools/OAuth/TokensProvider.php
@@ -159,6 +159,7 @@ class TokensProvider
->getRDBRepositoryByClass(OAuthAccount::class)
->forUpdate()
->sth()
+ ->select(Attribute::ID)
->where([Attribute::ID => $account->getId()])
->find();