fix next number unlock table

This commit is contained in:
yuri
2017-08-04 17:45:46 +03:00
parent e557782c64
commit 8fa36ac14c
+4 -1
View File
@@ -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');