From c6f30e21c83eea829508940c0acd0991711d413b Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 29 Oct 2024 11:44:10 +0000 Subject: [PATCH] Bug 28965: (QA follow-up) Fix misc qa issues * Tidy code * Fix number of unit tests * Remove unecessary use of delete Signed-off-by: Kyle M Hall --- Koha/REST/V1/Lists.pm | 4 ++-- Koha/Virtualshelf.pm | 5 +++-- Koha/Virtualshelves.pm | 4 ++-- t/db_dependent/Virtualshelves.t | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Koha/REST/V1/Lists.pm b/Koha/REST/V1/Lists.pm index ffe3977a215..4ca597f4d8e 100644 --- a/Koha/REST/V1/Lists.pm +++ b/Koha/REST/V1/Lists.pm @@ -36,8 +36,8 @@ sub list_public { my $user = $c->stash('koha.user'); - my $only_mine = delete $c->param('only_mine'); - my $only_public = delete $c->param('only_public'); + my $only_mine = $c->param('only_mine'); + my $only_public = $c->param('only_public'); return $c->render( status => 400, diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm index fea70466f35..39bb92ca15f 100644 --- a/Koha/Virtualshelf.pm +++ b/Koha/Virtualshelf.pm @@ -398,6 +398,7 @@ sub transfer_ownership { return $self; } + =head3 to_api_mapping This method returns the mapping for representing a Koha::Virtualshelf object @@ -424,8 +425,8 @@ This method returns the list of publicly readable database fields for both API a sub public_read_list { return [ - 'created_on', 'lastmodified', 'shelfname', - 'shelfnumber', 'public', 'sortfield', + 'created_on', 'lastmodified', 'shelfname', + 'shelfnumber', 'public', 'sortfield', 'allow_change_from_owner', 'allow_change_from_others' ]; } diff --git a/Koha/Virtualshelves.pm b/Koha/Virtualshelves.pm index 384ed45ce64..58653130a44 100644 --- a/Koha/Virtualshelves.pm +++ b/Koha/Virtualshelves.pm @@ -257,7 +257,7 @@ Returns a resultset of lists marked as public. sub filter_by_public { my ($self) = @_; - return $self->search({ public => 1 }); + return $self->search( { public => 1 } ); } =head3 filter_by_readable @@ -272,7 +272,7 @@ sub filter_by_readable { my ( $self, $params ) = @_; Koha::Exceptions::MissingParameter->throw("Mandatory patron_id parameter missing") - unless $params->{patron_id}; + unless $params->{patron_id}; return $self->search( { '-or' => { public => 1, owner => $params->{patron_id} } } ); } diff --git a/t/db_dependent/Virtualshelves.t b/t/db_dependent/Virtualshelves.t index 5861e1dbb35..25eb2e4bdcb 100755 --- a/t/db_dependent/Virtualshelves.t +++ b/t/db_dependent/Virtualshelves.t @@ -16,7 +16,7 @@ # along with Koha; if not, see . use Modern::Perl; -use Test::More tests => 7; +use Test::More tests => 9; use Test::Exception; use DateTime::Duration; -- 2.39.5 (Apple Git-154)