Bugzilla – Attachment 86508 Details for
Bug 22222
Mana subscription search always returns all results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22222: Don't send empty params to mana service
Bug-22222-Dont-send-empty-params-to-mana-service.patch (text/plain), 2.28 KB, created by
Alex Arnaud
on 2019-03-12 09:43:38 UTC
(
hide
)
Description:
Bug 22222: Don't send empty params to mana service
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2019-03-12 09:43:38 UTC
Size:
2.28 KB
patch
obsolete
>From 8b2c4dfdfb6c6825414483f30466a00bb683cfe1 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Tue, 26 Feb 2019 15:05:50 +0000 >Subject: [PATCH] Bug 22222: Don't send empty params to mana service > >Test plan: >0) Do not apply the patch >1) Go to serials > Search on Mana >2) Insert some value into the form >3) Submit -> you get many (3000+) results >4) Apply the patch and restart_all >5) Repeat, now, you get only the subscription matching your query > >Signed-off-by: Michal Denar <black23@gmail.com> >Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> >--- > Koha/SharedContent.pm | 4 ++-- > t/db_dependent/Koha/SharedContent.t | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/SharedContent.pm b/Koha/SharedContent.pm >index 587285d..7145e95 100644 >--- a/Koha/SharedContent.pm >+++ b/Koha/SharedContent.pm >@@ -154,7 +154,7 @@ sub build_request { > if ( $type eq 'get' ) { > my $params = shift; > $params = join '&', >- map { defined $params->{$_} ? $_ . "=" . $params->{$_} : () } >+ map { defined $params->{$_} && $params->{$_} ne '' ? $_ . "=" . $params->{$_} : () } > keys %$params; > my $url = "$mana_url/$resource.json?$params"; > return HTTP::Request->new( GET => $url ); >@@ -164,7 +164,7 @@ sub build_request { > my $id = shift; > my $params = shift; > $params = join '&', >- map { defined $params->{$_} ? $_ . "=" . $params->{$_} : () } >+ map { defined $params->{$_} && $params->{$_} ne '' ? $_ . "=" . $params->{$_} : () } > keys %$params; > > my $url = "$mana_url/$resource/$id.json?$params"; >diff --git a/t/db_dependent/Koha/SharedContent.t b/t/db_dependent/Koha/SharedContent.t >index 2be0e1d..67be87e 100644 >--- a/t/db_dependent/Koha/SharedContent.t >+++ b/t/db_dependent/Koha/SharedContent.t >@@ -82,7 +82,7 @@ is($request->method, 'GET', 'Get subscription - Method is get'); > my %query = $request->uri->query_form; > is($query{title}, 'The English historical review', 'Check title'); > is($query{issn}, '0013-8266', 'Check issn'); >-is($query{ean}, '', 'Check ean'); >+is($query{ean}, undef, 'Check ean'); > is($query{publishercode}, 'Longman', 'Check publisher'); > > is($request->uri->path, '/subscription.json', 'Path is subscription'); >-- >2.7.4
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 22222
:
86043
|
86396
| 86508