[Koha-bugs] [Bug 28960] EDI transfer_items uses a relationship where it's looking for a field

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Sep 9 14:51:14 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28960

--- Comment #4 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
(In reply to Jonathan Druart from comment #3)
> Isn't the correct fix to call $item->home_branch->branchcode?
> 
> From Koha::Item
> 
> sub home_branch {
>     my ($self) = @_;
> 
>     $self->{_home_branch} ||= Koha::Libraries->find( $self->homebranch() );
> 
>     return $self->{_home_branch};
> }

There are two things with that.

1) $item is a DBIx::Class::Result and not a Koha::Item in EDI (Yes, we should
certainly convert to Koha Objects here at some point)
2) if all we need is the code, why call through another DB hitting accessor
rather than use the field in the first set directly?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list