From a8d437720b704862b318db6f80c36f9ba4660c2c Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sat, 3 Apr 2021 13:04:45 +0300 Subject: [PATCH] stream fix --- application/Espo/Services/Stream.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/Espo/Services/Stream.php b/application/Espo/Services/Stream.php index 7f737ceabd..c26b32d65c 100644 --- a/application/Espo/Services/Stream.php +++ b/application/Espo/Services/Stream.php @@ -1146,12 +1146,6 @@ class Stream $builder->where($where); - $countBuilder = clone $builder; - - $builder - ->limit($params['offset'], $params['maxSize']) - ->order('number', 'DESC'); - if (!empty($params['after'])) { $where['createdAt>'] = $params['after']; @@ -1160,6 +1154,12 @@ class Stream ]); } + $countBuilder = clone $builder; + + $builder + ->limit($params['offset'], $params['maxSize']) + ->order('number', 'DESC'); + $collection = $this->entityManager ->getRepository('Note') ->clone($builder->build())