diff --git a/application/Espo/Core/Formula/Functions/EntityGroup/AddLinkMultipleIdType.php b/application/Espo/Core/Formula/Functions/EntityGroup/AddLinkMultipleIdType.php index 82c70a6913..1016894bdc 100644 --- a/application/Espo/Core/Formula/Functions/EntityGroup/AddLinkMultipleIdType.php +++ b/application/Espo/Core/Formula/Functions/EntityGroup/AddLinkMultipleIdType.php @@ -65,7 +65,7 @@ class AddLinkMultipleIdType extends \Espo\Core\Formula\Functions\Base } } else { if (!is_string($id)) { - throw new Error(); + return; } $this->getEntity()->addLinkMultipleId($link, $id); } diff --git a/application/Espo/Core/Mail/Sender.php b/application/Espo/Core/Mail/Sender.php index 540b8c862d..50b61570c8 100644 --- a/application/Espo/Core/Mail/Sender.php +++ b/application/Espo/Core/Mail/Sender.php @@ -177,7 +177,7 @@ class Sender return $this; } - public function send(Email $email, $params = [], &$message = null, $attachmentList = []) + public function send(Email $email, $params = [], $message = null, $attachmentList = []) { if (!$message) { $message = new Message(); diff --git a/application/Espo/Modules/Crm/Services/Activities.php b/application/Espo/Modules/Crm/Services/Activities.php index f51b35a702..87a99cc85e 100644 --- a/application/Espo/Modules/Crm/Services/Activities.php +++ b/application/Espo/Modules/Crm/Services/Activities.php @@ -739,7 +739,7 @@ class Activities extends \Espo\Core\Services\Base $orderBy = null; $order = null; if (!empty($selectParams['orderBy'])) { - $order = $selectParams['order']; + $order = $selectParams['order'] ?? null; $orderBy = $selectParams['orderBy']; } diff --git a/application/Espo/ORM/DB/Query/Base.php b/application/Espo/ORM/DB/Query/Base.php index 217b47cc74..e2553b06c5 100644 --- a/application/Espo/ORM/DB/Query/Base.php +++ b/application/Espo/ORM/DB/Query/Base.php @@ -1083,7 +1083,7 @@ abstract class Base if (!empty($item[1])) { $orderInternal = $item[1]; } - $arr[] = $this->getOrderPart($entity, $orderByInternal, $orderInternal, false, $params); + $arr[] = $this->getOrderPart($entity, $orderByInternal, $orderInternal, $useColumnAlias, $params); } } return implode(", ", $arr); @@ -1091,7 +1091,11 @@ abstract class Base if (strpos($orderBy, 'LIST:') === 0) { list($l, $field, $list) = explode(':', $orderBy); - $fieldPath = $this->getFieldPathForOrderBy($entity, $field, $params); + if ($useColumnAlias) { + $fieldPath = '`'. $this->sanitizeSelectAlias($field) . '`'; + } else { + $fieldPath = $this->getFieldPathForOrderBy($entity, $field, $params); + } $listQuoted = []; $list = array_reverse(explode(',', $list)); foreach ($list as $i => $listItem) { diff --git a/application/Espo/Resources/i18n/en_US/ActionHistoryRecord.json b/application/Espo/Resources/i18n/en_US/ActionHistoryRecord.json index ebbee7af45..b3f18c2ce1 100644 --- a/application/Espo/Resources/i18n/en_US/ActionHistoryRecord.json +++ b/application/Espo/Resources/i18n/en_US/ActionHistoryRecord.json @@ -4,6 +4,7 @@ "action": "Action", "createdAt": "Date", "user": "User", + "userType": "User Type", "target": "Target", "targetType": "Target Type", "authToken": "Auth Token", diff --git a/application/Espo/Resources/layouts/ActionHistoryRecord/filters.json b/application/Espo/Resources/layouts/ActionHistoryRecord/filters.json index f89f25f5eb..61ccd8025b 100644 --- a/application/Espo/Resources/layouts/ActionHistoryRecord/filters.json +++ b/application/Espo/Resources/layouts/ActionHistoryRecord/filters.json @@ -3,5 +3,6 @@ "target", "createdAt", "ipAddress", - "user" + "user", + "userType" ] \ No newline at end of file diff --git a/application/Espo/Resources/metadata/entityDefs/ActionHistoryRecord.json b/application/Espo/Resources/metadata/entityDefs/ActionHistoryRecord.json index 31f023bf6b..ff38d0ca16 100644 --- a/application/Espo/Resources/metadata/entityDefs/ActionHistoryRecord.json +++ b/application/Espo/Resources/metadata/entityDefs/ActionHistoryRecord.json @@ -26,6 +26,13 @@ "user": { "type": "link" }, + "userType": { + "type": "foreign", + "link": "user", + "field": "type", + "view": "views/fields/foreign-enum", + "notStorable": true + }, "ipAddress": { "type": "varchar", "maxLength": "39" diff --git a/client/res/templates/record/detail.tpl b/client/res/templates/record/detail.tpl index 6e4cf39df6..420df48534 100644 --- a/client/res/templates/record/detail.tpl +++ b/client/res/templates/record/detail.tpl @@ -10,7 +10,7 @@