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>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
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 );
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";
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');