From 148f35963d5eae1f9eabc0c7cb0b69cd7056b020 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 27 Sep 2019 12:53:46 +0100 Subject: [PATCH] Bug 23272: (RM followup) Fix edit action This bug introduced a regression whereby if an authorized value has no branch limitations then the authorized value cannot be edited once it has been created. The edit page would display an error and not load. This is the second case of a simple ternary correcting the issue, but the logic of returning 'undef' from 'get_branch_limits' being called into question. 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 3e23426b18..34540e1e20 100755 --- a/admin/authorised_values.pl +++ b/admin/authorised_values.pl @@ -54,7 +54,7 @@ if ($op eq 'add_form') { my ( @selected_branches, $category, $av ); if ($id) { $av = Koha::AuthorisedValues->new->find( $id ); - @selected_branches = $av->library_limits->as_list; + @selected_branches = $av->library_limits ? $av->library_limits->as_list : (); } else { $category = $input->param('category'); } -- 2.39.5