Skip to content

EspoCRM – Open Source CRM Application

entity manager: rebuild on reset to default

Yuri Kuznetsov7c32b525a338
diff --git a/application/Espo/Tools/EntityManager/EntityManager.php b/application/Espo/Tools/EntityManager/EntityManager.php
index 41272023c0..58c7cf6c82 100644
--- a/application/Espo/Tools/EntityManager/EntityManager.php
+++ b/application/Espo/Tools/EntityManager/EntityManager.php
@@ -743,6 +743,13 @@ class EntityManager
$this->processUpdateHook($entityTypeParams, $previousEntityTypeParams);
$this->dataManager->clearCache();
+
+ if (
+ !$previousEntityTypeParams->get('optimisticConcurrencyControl') &&
+ $entityTypeParams->get('optimisticConcurrencyControl')
+ ) {
+ $this->dataManager->rebuild();
+ }
}
/**