Bug 29844: Fix advanced editor
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 23 Feb 2022 10:02:24 +0000 (11:02 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 24 Feb 2022 08:05:32 +0000 (22:05 -1000)
The method Koha::Libraries->branchcode is not covered by tests!
Trace begun at /kohadevbox/koha/Koha/Objects.pm line 572                                                                                                                                                             Koha::Objects::AUTOLOAD('Koha::Libraries=HASH(0x563bf134b810)') called at /kohadevbox/koha/svc/cataloguing/framework line 33

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
svc/cataloguing/framework

index f745612..1014ea5 100755 (executable)
@@ -30,7 +30,7 @@ foreach my $tag ( sort keys %$tagslib ) {
 my $schema = Koha::Database->new->schema;
 my $authorised_values = {};
 
-my $branches = { map { $_->branchcode => $_->branchname } Koha::Libraries->search_filtered };
+my $branches = { map { $_->branchcode => $_->branchname } Koha::Libraries->search_filtered->as_list };
 $authorised_values->{branches} = [];
 foreach my $thisbranch ( sort keys %$branches ) {
     push @{ $authorised_values->{branches} }, { value => $thisbranch, lib => $branches->{$thisbranch} };