Skip to content

EspoCRM – Open Source CRM Application

skip order if no filed

Yuri Kuznetsovf69667a5644e
diff --git a/application/Espo/Core/Repositories/CategoryTree.php b/application/Espo/Core/Repositories/CategoryTree.php
index 242d5d7f4c..c38e93b2ba 100644
--- a/application/Espo/Core/Repositories/CategoryTree.php
+++ b/application/Espo/Core/Repositories/CategoryTree.php
@@ -45,7 +45,7 @@ class CategoryTree extends Database
protected function beforeSave(Entity $entity, array $options = [])
{
- if ($entity->get(self::ATTR_ORDER) === null) {
+ if ($entity->get(self::ATTR_ORDER) === null && $entity->hasAttribute(self::ATTR_ORDER)) {
$this->setOrderToEnd($entity);
}