| Summary: | Koha::Template::Plugin::Branches->pickup_location is failing due to unexpected behavior of Koha::Libraries->new->empty | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Andreas Jonsson <andreas.jonsson> | 
| Component: | Circulation | Assignee: | Bugs List <koha-bugs> | 
| Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> | 
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | gmcharlt, kyle, tomascohen | 
| Version: | 20.05 | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 | 
| Patch complexity: | --- | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: | Circulation function: | ||
*** This bug has been marked as a duplicate of bug 29807 ***  | 
This test-script: #!/usr/bin/perl -w # use strict; use Koha::Libraries; use Data::Dumper; my @empty = map {$_->unblessed} Koha::Libraries->new->empty; print Dumper(\@empty); yields this output: $VAR1 = [ [] ]; In other words, we get an array with a reference to an empty array. This is unexpected in two different ways: * The array should contain hash references (whenever it contains anything). * The array should be empty. The problem is that this will cause Template::Plugin::Branches->pickup_location to crash in some circumstances. A workaround is to add something like this to the loop: next if is_arrayref($l); I'm guessing the actual error is in DBIx.