From 5b3b382f5814c2d30234e80d00f238547871d3e5 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 9 Feb 2018 08:51:02 -0500 Subject: [PATCH] Bug 18403: Fix error triggered by subgroups being added to group With one root group and two child groups and it works fine. But if I create any groups under *those* groups, not only does it not work, I get the following error: Template process failed: undef error - SQL::Abstract::puke(): [SQL::Abstract::__ANON__] Fatal: SQL::Abstract before v1.75 used to generate incorrect SQL when the -IN operator was given an undef-containing list: !!!AUDIT YOUR CODE AND DATA!!! (the upcoming Data::Query-based version of SQL::Abstract will emit the logically correct SQL instead of raising this exception) at /home/vagrant/kohaclone/Koha/Objects.pm line 269 Signed-off-by: Jonathan Druart --- Koha/Patron.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 0d7cca43c2..b5506e4dab 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -791,7 +791,9 @@ sub libraries_where_can_see_patrons { } } - return sort(uniq(@restricted_branchcodes)); + @restricted_branchcodes = grep { defined $_ } @restricted_branchcodes; + @restricted_branchcodes = uniq(@restricted_branchcodes); + return sort (@restricted_branchcodes); } sub can { -- 2.39.5