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

(-)a/Koha/Virtualshelves.pm (-17 lines)
Lines 191-213 sub get_shelves_containing_record { Link Here
191
    );
191
    );
192
}
192
}
193
193
194
=head3 get_shared_shelves
195
196
=cut
197
198
sub get_shared_shelves {
199
    my ( $self, $params ) = @_;
200
    my $borrowernumber = $params->{borrowernumber} || 0;
201
202
    $self->search(
203
        {
204
            'me.owner' => $borrowernumber,
205
            'me.shelfnumber' => { -ident => 'virtualshelfshares.shelfnumber' }
206
        },
207
        { prefetch => 'virtualshelfshares' }
208
    );
209
}
210
211
=head3 _type
194
=head3 _type
212
195
213
=cut
196
=cut
(-)a/t/db_dependent/Virtualshelves.t (-3 / +2 lines)
Lines 497-504 subtest 'Get shelves' => sub { Link Here
497
    is( $public_shelves->count, 2, 'get_public_shelves should return all public shelves, no matter who is the owner' );
497
    is( $public_shelves->count, 2, 'get_public_shelves should return all public shelves, no matter who is the owner' );
498
498
499
    my $shared_shelf = eval { $shelf_to_share->share("valid key") };
499
    my $shared_shelf = eval { $shelf_to_share->share("valid key") };
500
    my $shared_shelves = Koha::Virtualshelves->get_shared_shelves({ borrowernumber => $patron1->{borrowernumber} });
500
    my $shared_shelves = Koha::Virtualshelfshares->search({ borrowernumber => $patron1->{borrowernumber} });
501
    is( $shared_shelves->count, 1, 'get_shared_shelves should return shared shelves' );
501
    is( $shared_shelves->count, 1, 'Found the share for patron1' );
502
502
503
    teardown();
503
    teardown();
504
};
504
};
505
- 

Return to bug 11889