From f9e205c1443b6e27ad587821422cabbb90724623 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Wed, 26 Jun 2019 15:52:53 -0400
Subject: [PATCH] Add $reuseMatchedParams support to Url helper.

---
 .../src/VuFind/View/Helper/Root/Url.php       | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Url.php b/module/VuFind/src/VuFind/View/Helper/Root/Url.php
index 691aa6df74e..1e49dd92480 100644
--- a/module/VuFind/src/VuFind/View/Helper/Root/Url.php
+++ b/module/VuFind/src/VuFind/View/Helper/Root/Url.php
@@ -64,18 +64,17 @@ class Url extends \Zend\View\Helper\Url
      * @param array             $params             Parameters for the link
      * @param array|Traversable $options            Options for the route
      * @param bool              $reuseMatchedParams Whether to reuse matched
-     *                                              parameters
+     * parameters
      *
      * @see Zend\Mvc\Router\RouteInterface::assemble()
      * @see Zend\Router\RouteInterface::assemble()
      *
-     * @throws Exception\RuntimeException If no RouteStackInterface was
-     *                                    provided
+     * @throws Exception\RuntimeException If no RouteStackInterface was provided
      * @throws Exception\RuntimeException If no RouteMatch was provided
-     * @throws Exception\RuntimeException If RouteMatch didn't contain a
-     *                                    matched route name
-     * @throws Exception\InvalidArgumentException If the params object was not
-     *                                            an array or Traversable object.
+     * @throws Exception\RuntimeException If RouteMatch didn't contain a matched
+     * route name
+     * @throws Exception\InvalidArgumentException If the params object was not an
+     * array or Traversable object.
      *
      * @return string Url For the link href attribute
      */
@@ -89,14 +88,15 @@ class Url extends \Zend\View\Helper\Url
     /**
      * Get URL with current GET parameters and add one
      *
-     * @param array $params Key-paired parameters
+     * @param array $params             Key-paired parameters
+     * @param bool  $reuseMatchedParams Whether to reuse matched parameters
      *
      * @return string
      */
-    public function addQueryParameters($params)
+    public function addQueryParameters($params, $reuseMatchedParams = true)
     {
         $requestQuery = $this->request->getQuery()->toArray();
         $options = ['query' => array_merge($requestQuery, $params)];
-        return $this->__invoke(null, [], $options);
+        return $this->__invoke(null, [], $options, $reuseMatchedParams);
     }
 }
-- 
GitLab