From eb42b181c1827d88535440c4eaeedf2ab351e8b9 Mon Sep 17 00:00:00 2001
From: Ere Maijala <ere.maijala@helsinki.fi>
Date: Tue, 30 Mar 2021 08:20:09 +0300
Subject: [PATCH] Initialize id array even if there are no more records.

---
 module/VuFind/src/VuFind/Sitemap/Generator.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/module/VuFind/src/VuFind/Sitemap/Generator.php b/module/VuFind/src/VuFind/Sitemap/Generator.php
index 5949133cb7c..fdddcf0294c 100644
--- a/module/VuFind/src/VuFind/Sitemap/Generator.php
+++ b/module/VuFind/src/VuFind/Sitemap/Generator.php
@@ -459,6 +459,7 @@ class Generator
             $this->countPerPage,
             $params
         );
+        $ids = [];
         foreach ($results->getRecords() as $doc) {
             $ids[] = $doc->get($key);
         }
-- 
GitLab