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 <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2021-09-07 12:14:03 +01:00 committed by Kyle M Hall
parent 45dd2737e5
commit c3ef810a54

View file

@ -430,7 +430,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} = [];
}
@ -527,7 +527,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 )
{