diff --git a/application/Espo/Core/SelectManagers/Base.php b/application/Espo/Core/SelectManagers/Base.php index 04c042f669..e51c635675 100644 --- a/application/Espo/Core/SelectManagers/Base.php +++ b/application/Espo/Core/SelectManagers/Base.php @@ -186,6 +186,12 @@ class Base $result['orderBy'] = 'LIST:' . $sortBy . ':' . implode(',', $list); return; } + } else { + if (strpos($sortBy, '.') === false && strpos($sortBy, ':') === false) { + if (!$this->getSeed()->hasAttribute($sortBy)) { + throw new Error("Order by non-existing field '{$sortBy}'."); + } + } } } if (!$desc) { diff --git a/package.json b/package.json index 6c04af1a02..7d36d3a2e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "espocrm", - "version": "5.7.6", + "version": "5.7.7", "description": "", "main": "index.php", "repository": {