Bug 33949: Fix display of old checkouts if no checkouts exist

If we pass an empty array from the perl controller, we retrieve an empty
string from the template, and the merge does not work.

This patch fixes the following bug:
Pick a patron without checkout history
Check them an item out and check it in
=> The table is empty, whereas it should display the item that has been
checked in.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-09-18 11:41:36 +02:00 committed by Tomas Cohen Arazi
parent 891835895c
commit bee2b3d33e
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,8 @@
<div id="userreadingrecord" class="maincontent">
<h1>Checkout history</h1>
[% UNLESS checkouts %][% checkouts = [] %][% END %]
[% UNLESS old_checkouts %][% old_checkouts = [] %][% END %]
[% SET all_checkouts = checkouts.merge(old_checkouts) %]
[% IF all_checkouts.size == 0 %]
You have never borrowed anything from this library.