From 4684eb1c0e545d17e16a7e499347bf17d5173ed5 Mon Sep 17 00:00:00 2001
From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Date: Wed, 24 Apr 2019 14:58:41 +0100
Subject: [PATCH] But 21460: (follow-up) Fix bugs found in QA

Fix silly bugs mentioned in comment #29
---
 Koha/REST/V1/Illrequests.pm                                 | 2 +-
 ill/ill-requests.pl                                         | 2 +-
 koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Koha/REST/V1/Illrequests.pm b/Koha/REST/V1/Illrequests.pm
index f747390792..907dc5ce80 100644
--- a/Koha/REST/V1/Illrequests.pm
+++ b/Koha/REST/V1/Illrequests.pm
@@ -57,7 +57,7 @@ sub list {
     # Get all requests
     # If necessary, only get those from a specified patron
     my @requests = Koha::Illrequests->search({
-        args->{borrowernumber}
+        $args->{borrowernumber}
         ? ( borrowernumber => $args->{borrowernumber} )
         : ()
     })->as_list;
diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl
index 57b0692dd4..010c61e618 100755
--- a/ill/ill-requests.pl
+++ b/ill/ill-requests.pl
@@ -280,8 +280,8 @@ if ( $backends_available ) {
                     uri_escape_utf8(scalar $params->{$filter});
             }
         }
+        my @tpl_arr = ();
         if (keys %{$active_filters}) {
-            my @tpl_arr;
             foreach my $key (keys %{$active_filters}) {
                 push @tpl_arr, $key . "=" . $active_filters->{$key};
             }
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
index 8feeccbc65..88ee777a09 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
@@ -527,7 +527,7 @@
     [% INCLUDE 'calendar.inc' %]
     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
     <script>
-        var prefilters = '[% prefilters %]';
+        var prefilters = '[% prefilters | $raw %]';
         // Set column settings
         var columns_settings = [% ColumnsSettings.GetColumns( 'illrequests', 'ill-requests', 'ill-requests', 'json' ) %];
     </script>
-- 
2.11.0