From f911907eee39cd34cfa5c2a20920832f7f0d19fd Mon Sep 17 00:00:00 2001 From: angelo Date: Mon, 9 Jul 2018 10:33:51 +0200 Subject: [PATCH] fix error in displaying a page beyond the last one with a custom QB --- Grid/Source/Entity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Grid/Source/Entity.php b/Grid/Source/Entity.php index d5a5c252..2960ee21 100644 --- a/Grid/Source/Entity.php +++ b/Grid/Source/Entity.php @@ -352,10 +352,10 @@ public function initQueryBuilder(QueryBuilder $queryBuilder) */ protected function getQueryBuilder() { - //If a custom QB has been provided, use that + //If a custom QB has been provided, use a copy of that one //Otherwise create our own basic one if ($this->queryBuilder instanceof QueryBuilder) { - $qb = $this->queryBuilder; + $qb = clone $this->queryBuilder; } else { $qb = $this->manager->createQueryBuilder($this->class); $qb->from($this->class, $this->getTableAlias());