Browse Source

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 <martin.renvoize@ptfs-europe.com>
remotes/origin/19.11.x
Martin Renvoize 5 years ago
parent
commit
9515677afa
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 2
      admin/authorised_values.pl

2
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);
}

Loading…
Cancel
Save