View | Details | Raw Unified | Return to bug 31314
Collapse All | Expand All

(-)a/Koha/Item.pm (-4 / +5 lines)
Lines 361-369 sub effective_itemtype { Link Here
361
sub home_branch {
361
sub home_branch {
362
    my ($self) = @_;
362
    my ($self) = @_;
363
363
364
    $self->{_home_branch} ||= Koha::Libraries->find( $self->homebranch() );
364
    my $hb_rs = $self->_result->homebranch;
365
365
366
    return $self->{_home_branch};
366
    return Koha::Library->_new_from_dbic( $hb_rs );
367
}
367
}
368
368
369
=head3 holding_branch
369
=head3 holding_branch
Lines 373-381 sub home_branch { Link Here
373
sub holding_branch {
373
sub holding_branch {
374
    my ($self) = @_;
374
    my ($self) = @_;
375
375
376
    $self->{_holding_branch} ||= Koha::Libraries->find( $self->holdingbranch() );
376
    my $hb_rs = $self->_result->holdingbranch;
377
377
378
    return $self->{_holding_branch};
378
    return Koha::Library->_new_from_dbic( $hb_rs );
379
}
379
}
380
380
381
=head3 biblio
381
=head3 biblio
Lines 1415-1420 sub to_api_mapping { Link Here
1415
1415
1416
sub itemtype {
1416
sub itemtype {
1417
    my ( $self ) = @_;
1417
    my ( $self ) = @_;
1418
1418
    return Koha::ItemTypes->find( $self->effective_itemtype );
1419
    return Koha::ItemTypes->find( $self->effective_itemtype );
1419
}
1420
}
1420
1421
(-)a/opac/opac-reserve.pl (-2 / +2 lines)
Lines 155-166 foreach my $biblioNumber (@biblionumbers) { Link Here
155
    my $items = Koha::Items->search_ordered(
155
    my $items = Koha::Items->search_ordered(
156
        [
156
        [
157
            biblionumber => $biblioNumber,
157
            biblionumber => $biblioNumber,
158
            itemnumber => {
158
            'me.itemnumber' => {
159
                -in => [
159
                -in => [
160
                    $biblio->host_items->get_column('itemnumber')
160
                    $biblio->host_items->get_column('itemnumber')
161
                ]
161
                ]
162
            }
162
            }
163
        ],
163
        ],
164
        { prefetch => [ 'issue', 'homebranch', 'holdingbranch' ] }
164
    )->filter_by_visible_in_opac({ patron => $patron });
165
    )->filter_by_visible_in_opac({ patron => $patron });
165
166
166
    $biblioData->{items} = [$items->as_list]; # FIXME Potentially a lot in memory here!
167
    $biblioData->{items} = [$items->as_list]; # FIXME Potentially a lot in memory here!
167
- 

Return to bug 31314