]> git.koha-community.org Git - koha.git/commit
Bug 29807: Make Branches plugin handle empty pickup locations list
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 6 Jan 2022 11:53:30 +0000 (08:53 -0300)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Wed, 16 Feb 2022 17:44:04 +0000 (17:44 +0000)
commitbb45bf79290c7a6a4f63b14f8fb9e8f63893c88f
tree9e5e08e316c0fffebca6c66e438b3ceb223c0cd0
parent77d67fccee7dee836adf7dcef603c51383928b7c
Bug 29807: Make Branches plugin handle empty pickup locations list

This patch makes the plugin handle empty Koha::Biblio->pickup_locations
and Koha::Item->pickup_locations correctly.

It does so by explicitly calling ->as_list. It also restores the logic
that was changed by 6cd1ffab4e491349c99769018a7df33dc8a8aabf so, now
that ->empty is handled correctly, it doesn't return ALL the pickup
locations when the item/biblio doesn't have valid pickup locations.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Template/Plugin/Branches.t
=> FAIL: Awful error
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d1ea769c7988e40425a7bf5c05cafb1c0e35344c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Koha/Template/Plugin/Branches.pm