Bug 31319: (QA follow-up) Search items directly (biblio not used yet)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

JD amended patch: add 'me' prefix to prevent failure if biblio is linked
with a subscription
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'biblionumber' in where clause is ambiguous at /kohadevbox/koha/Koha/Objects.pm line 394

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2022-08-09 13:21:05 +00:00 committed by Tomas Cohen Arazi
parent 998fb79cb3
commit 9b1c397bee
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -60,8 +60,7 @@ else {
for ( @{$taglist} ) {
# FIXME We should use Koha::Biblio here
my $dat = &GetBiblioData( $_->{biblionumber} );
my $biblio = Koha::Biblios->find($dat->{biblionumber});
my $items = $biblio->items->search_ordered;
my $items = Koha::Items->search_ordered({ 'me.biblionumber' => $dat->{biblionumber} });
$dat->{biblionumber} = $_->{biblionumber};
$dat->{tag_id} = $_->{tag_id};
$dat->{items} = $items;