Bugzilla – Attachment 173689 Details for
Bug 28965
Add public routes for lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28965: (QA follow-up) Fix misc qa issues
Bug-28965-QA-follow-up-Fix-misc-qa-issues.patch (text/plain), 2.80 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-10-29 19:22:19 UTC
(
hide
)
Description:
Bug 28965: (QA follow-up) Fix misc qa issues
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-10-29 19:22:19 UTC
Size:
2.80 KB
patch
obsolete
>From ef77b50f7076cf54629d01af08bd5e715a828723 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >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 >* Fix use of delete > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/REST/V1/Lists.pm | 6 ++++-- > Koha/Virtualshelf.pm | 4 ++-- > Koha/Virtualshelves.pm | 4 ++-- > t/db_dependent/Virtualshelves.t | 2 +- > 4 files changed, 9 insertions(+), 7 deletions(-) > >diff --git a/Koha/REST/V1/Lists.pm b/Koha/REST/V1/Lists.pm >index c6ea8594c0a..a557627e7e1 100644 >--- a/Koha/REST/V1/Lists.pm >+++ b/Koha/REST/V1/Lists.pm >@@ -36,8 +36,10 @@ 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'); >+ >+ $c->req->params->remove('only_mine')->remove('only_public'); > > if ( !$user && $only_mine ) { > return $c->render( >diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm >index fea70466f35..6cddd84fd34 100644 >--- a/Koha/Virtualshelf.pm >+++ b/Koha/Virtualshelf.pm >@@ -424,8 +424,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 <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 7; >+use Test::More tests => 9; > use Test::Exception; > > use DateTime::Duration; >-- >2.47.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28965
:
124635
|
124636
|
165976
|
165977
|
173624
|
173625
|
173626
|
173627
|
173687
|
173688
|
173689
|
173690
|
173780
|
173781
|
173782
|
173783