From 9882e6a0bc81ed1d63627f0d1522cb6fafad493d Mon Sep 17 00:00:00 2001
From: symac <web@geobib.fr>
Date: Thu, 31 Oct 2019 16:49:50 +0100
Subject: [PATCH] Fix an issue when trying to limit results to a specific set.

---
 src/OaiPmh/ResponseGenerator.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/OaiPmh/ResponseGenerator.php b/src/OaiPmh/ResponseGenerator.php
index 7886e4a..0aaeba4 100644
--- a/src/OaiPmh/ResponseGenerator.php
+++ b/src/OaiPmh/ResponseGenerator.php
@@ -622,8 +622,8 @@ class ResponseGenerator extends AbstractXmlGenerator
         $entityManager = $this->serviceLocator->get('Omeka\EntityManager');
 
         $itemRepository = $entityManager->getRepository('Omeka\Entity\Item');
-        $qb = $itemRepository->createQueryBuilder('Item');
-        $qb->select('Item');
+        $qb = $itemRepository->createQueryBuilder('omeka_root');
+        $qb->select('omeka_root');
 
         $query = new ArrayObject;
 
@@ -693,7 +693,7 @@ class ResponseGenerator extends AbstractXmlGenerator
             $qb->setParameter('until_2', $until);
         }
 
-        $qb->groupBy('Item.id');
+        $qb->groupBy('omeka_root.id');
 
         // This limit call will form the basis of the flow control
         $qb->setMaxResults($this->_listLimit);
-- 
GitLab