From be4fbeff29ebe35a1dddd72ae94736e9c73388e8 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 (cherry picked from commit 9dbf469605a3e97e66cb079961da65f7240e0cef) Signed-off-by: Victor Grousset/tuxayo --- Koha/EDI.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/EDI.pm b/Koha/EDI.pm index 7a49c22010..ca8f055bfc 100644 --- a/Koha/EDI.pm +++ b/Koha/EDI.pm @@ -411,7 +411,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} = []; } @@ -508,7 +508,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