From 8fa36ac14c10c8b7158a160c4e09a9cd86e9e340 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 4 Aug 2017 17:45:46 +0300 Subject: [PATCH] fix next number unlock table --- application/Espo/Hooks/Common/NextNumber.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/Espo/Hooks/Common/NextNumber.php b/application/Espo/Hooks/Common/NextNumber.php index e509a79154..c9e48e5ceb 100644 --- a/application/Espo/Hooks/Common/NextNumber.php +++ b/application/Espo/Hooks/Common/NextNumber.php @@ -75,7 +75,10 @@ class NextNumber extends \Espo\Core\Hooks\Base 'fieldName' => $fieldName, 'entityType' => $entity->getEntityType() ))->findOne(); - if (!$nextNumber) continue; + if (!$nextNumber) { + $this->getEntityManager()->getPdo()->query('UNLOCK TABLES'); + continue; + } $entity->set($fieldName, $this->composeNumberAttribute($nextNumber)); $value = $nextNumber->get('value');