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

(-)a/Koha/REST/V1/Lists.pm (-2 / +4 lines)
Lines 36-43 sub list_public { Link Here
36
36
37
    my $user = $c->stash('koha.user');
37
    my $user = $c->stash('koha.user');
38
38
39
    my $only_mine   = delete $c->param('only_mine');
39
    my $only_mine   = $c->param('only_mine');
40
    my $only_public = delete $c->param('only_public');
40
    my $only_public = $c->param('only_public');
41
42
    $c->req->params->remove('only_mine')->remove('only_public');
41
43
42
    if ( !$user && $only_mine ) {
44
    if ( !$user && $only_mine ) {
43
        return $c->render(
45
        return $c->render(
(-)a/Koha/Virtualshelf.pm (-2 / +2 lines)
Lines 424-431 This method returns the list of publicly readable database fields for both API a Link Here
424
424
425
sub public_read_list {
425
sub public_read_list {
426
    return [
426
    return [
427
        'created_on',  'lastmodified', 'shelfname',
427
        'created_on',              'lastmodified', 'shelfname',
428
        'shelfnumber', 'public',       'sortfield',
428
        'shelfnumber',             'public',       'sortfield',
429
        'allow_change_from_owner', 'allow_change_from_others'
429
        'allow_change_from_owner', 'allow_change_from_others'
430
    ];
430
    ];
431
}
431
}
(-)a/Koha/Virtualshelves.pm (-2 / +2 lines)
Lines 257-263 Returns a resultset of lists marked as public. Link Here
257
sub filter_by_public {
257
sub filter_by_public {
258
    my ($self) = @_;
258
    my ($self) = @_;
259
259
260
    return $self->search({ public => 1 });
260
    return $self->search( { public => 1 } );
261
}
261
}
262
262
263
=head3 filter_by_readable
263
=head3 filter_by_readable
Lines 272-278 sub filter_by_readable { Link Here
272
    my ( $self, $params ) = @_;
272
    my ( $self, $params ) = @_;
273
273
274
    Koha::Exceptions::MissingParameter->throw("Mandatory patron_id parameter missing")
274
    Koha::Exceptions::MissingParameter->throw("Mandatory patron_id parameter missing")
275
      unless $params->{patron_id};
275
        unless $params->{patron_id};
276
276
277
    return $self->search( { '-or' => { public => 1, owner => $params->{patron_id} } } );
277
    return $self->search( { '-or' => { public => 1, owner => $params->{patron_id} } } );
278
}
278
}
(-)a/t/db_dependent/Virtualshelves.t (-2 / +1 lines)
Lines 16-22 Link Here
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
use Test::More tests => 7;
19
use Test::More tests => 9;
20
use Test::Exception;
20
use Test::Exception;
21
21
22
use DateTime::Duration;
22
use DateTime::Duration;
23
- 

Return to bug 28965