diff --git a/application/Espo/Core/SelectManagers/Base.php b/application/Espo/Core/SelectManagers/Base.php index c75d6f25a7..f79148c2ab 100644 --- a/application/Espo/Core/SelectManagers/Base.php +++ b/application/Espo/Core/SelectManagers/Base.php @@ -95,7 +95,7 @@ class Base if (!empty($params['where']) && is_array($params['where'])) { $where = array(); - foreach ($params['where'] as $item) { + foreach ($params['where'] as $item) { if ($item['type'] == 'boolFilters' && !empty($item['value']) && is_array($item['value'])) { foreach ($item['value'] as $filter) { $p = $this->getBoolFilterWhere($filter); @@ -183,7 +183,7 @@ class Base $d = array(); foreach ($fieldList as $field) { if ( - strlen($item['value']) >= self::MIN_LENGTH_FOR_CONTENT_SEARCH + strlen($value) >= self::MIN_LENGTH_FOR_CONTENT_SEARCH && !empty($fieldDefs[$field]['type']) && $fieldDefs[$field]['type'] == 'text' ) { diff --git a/application/Espo/Hooks/Common/Stream.php b/application/Espo/Hooks/Common/Stream.php index 9368ece447..f0bdfb12ae 100644 --- a/application/Espo/Hooks/Common/Stream.php +++ b/application/Espo/Hooks/Common/Stream.php @@ -84,6 +84,9 @@ class Stream extends \Espo\Core\Hooks\Base $scopeNotifiedList = array(); foreach ($linkDefs as $link => $defs) { if ($defs['type'] == 'belongsTo') { + if (empty($defs['foreign']) || empty($defs['entity'])) { + continue; + } $foreign = $defs['foreign']; $scope = $defs['entity']; $entityId = $entity->get($link . 'Id'); @@ -96,6 +99,9 @@ class Stream extends \Espo\Core\Hooks\Base } } else if ($defs['type'] == 'belongsToParent') { $foreign = $defs['foreign']; + if (empty($defs['foreign'])) { + continue; + } $scope = $entity->get($link . 'Type'); $entityId = $entity->get($link . 'Id'); if (!empty($scope) && !empty($entityId)) { @@ -107,6 +113,9 @@ class Stream extends \Espo\Core\Hooks\Base } } else if ($defs['type'] == 'hasMany') { + if (empty($defs['foreign']) || empty($defs['entity'])) { + continue; + } $foreign = $defs['foreign']; $scope = $defs['entity']; $entityIds = $entity->get($link . 'Ids'); diff --git a/application/Espo/Services/Stream.php b/application/Espo/Services/Stream.php index 1002b2fb70..55fd9caeb4 100644 --- a/application/Espo/Services/Stream.php +++ b/application/Espo/Services/Stream.php @@ -70,6 +70,8 @@ class Stream extends \Espo\Core\Services\Base 'container', ); + protected $auditedFieldsCache = array(); + protected function getServiceFactory() { return $this->injections['container']->get('serviceFactory');