From 51f978696eb6f9a5a1f76a952fe56d51d97e799a Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 7 Sep 2021 12:14:03 +0100 Subject: [PATCH] Bug 28960: Explicitly call get_column This patch adds get_column to ensure we are returning a string value of a field rather than accidentally triggering a relationship accessor. Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart --- Koha/EDI.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/EDI.pm b/Koha/EDI.pm index 7a09ee367b..e4e7478259 100644 --- a/Koha/EDI.pm +++ b/Koha/EDI.pm @@ -446,7 +446,7 @@ sub receipt_items { "Cannot find aqorder item for $i :Order:$ordernumber"); next; } - my $b = $item->homebranch->branchcode; + my $b = $item->get_column('homebranch'); if ( !exists $branch_map{$b} ) { $branch_map{$b} = []; } @@ -543,7 +543,7 @@ sub transfer_items { foreach my $ilink (@item_links) { my $ino = $ilink->itemnumber; my $item = $schema->resultset('Item')->find( $ilink->itemnumber ); - my $i_branch = $item->homebranch; + my $i_branch = $item->get_column('homebranch'); if ( exists $mapped_by_branch{$i_branch} && $mapped_by_branch{$i_branch} > 0 ) { -- 2.39.5