From 9dbf469605a3e97e66cb079961da65f7240e0cef 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 Signed-off-by: Kyle M Hall (cherry picked from commit c3ef810a546ac35557484e12d7c2ff10c471b62d) Signed-off-by: Fridolin Somers --- Koha/EDI.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/EDI.pm b/Koha/EDI.pm index 2de2b8bf08..92461bdfc1 100644 --- a/Koha/EDI.pm +++ b/Koha/EDI.pm @@ -429,7 +429,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} = []; } @@ -526,7 +526,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