From 9515677afa2d6823016b3351fddbc45930c21667 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 13 Sep 2019 11:19:28 +0100 Subject: [PATCH] Bug 23272: (RM followup) Fix failing tests This bug introduced a regression whereby if any authorized value has no branch limitations then the authorized value administration page would fail to display at all. A simple ternary corrects the issue, but I'm now wondering about the logic of returning 'undef' from 'get_branch_limits'.. perhaps an empty (or full) resultset might be a better option to prevent us from requireing ternaries before calling chained methods on such objects. Signed-off-by: Martin Renvoize --- admin/authorised_values.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl index 6080dbb640..3e23426b18 100755 --- a/admin/authorised_values.pl +++ b/admin/authorised_values.pl @@ -231,7 +231,7 @@ if ( $op eq 'list' ) { $row_data{lib} = $av->lib; $row_data{lib_opac} = $av->lib_opac; $row_data{imageurl} = getitemtypeimagelocation( 'intranet', $av->imageurl ); - $row_data{branches} = $av->library_limits->as_list; + $row_data{branches} = $av->library_limits ? $av->library_limits->as_list : []; $row_data{id} = $av->id; push(@loop_data, \%row_data); } -- 2.20.1