https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27970

            Bug ID: 27970
           Summary: Koha::Template::Plugin::Branches->pickup_location is
                    failing due to unexpected behavior of
                    Koha::Libraries->new->empty
 Change sponsored?: ---
           Product: Koha
           Version: 20.05
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Circulation
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected]

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.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to