From e0e35d4f9c66bd5a7265bc93778adb7879e57a2b Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Mon, 30 Mar 2020 13:06:43 -0400
Subject: [PATCH] Do not un-encode encoded IDs in URL. - Resolves VUFIND-1392

---
 module/VuFind/src/VuFind/View/Helper/Root/Url.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Url.php b/module/VuFind/src/VuFind/View/Helper/Root/Url.php
index a838eaa404e..12f8b45efaa 100644
--- a/module/VuFind/src/VuFind/View/Helper/Root/Url.php
+++ b/module/VuFind/src/VuFind/View/Helper/Root/Url.php
@@ -95,7 +95,8 @@ class Url extends \Laminas\View\Helper\Url
      */
     public function addQueryParameters($params, $reuseMatchedParams = true)
     {
-        $requestQuery = $this->request->getQuery()->toArray();
+        $requestQuery = (null !== $this->request)
+            ? $this->request->getQuery()->toArray() : [];
         $options = [
             'query' => array_merge($requestQuery, $params),
             'normalize_path' => false, // fix for VUFIND-1392
-- 
GitLab