[open-ils-commits] [GIT] Evergreen ILS branch rel_2_7 updated. ce1b5aaf0aedd46b29fc923616e8f354a8890100
Evergreen Git
git at git.evergreen-ils.org
Thu Sep 3 15:49:31 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_2_7 has been updated
via ce1b5aaf0aedd46b29fc923616e8f354a8890100 (commit)
from 4312cd1abd17e132cd6dee0beab6862c4fbd6ccf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ce1b5aaf0aedd46b29fc923616e8f354a8890100
Author: Bill Erickson <berickxx at gmail.com>
Date: Mon Jun 22 12:01:19 2015 -0400
LP#1465847 Empty patron search exits early
If no search parameters or invalid search parameters are sent to the
patron search API, the API call exits early with zero results. This
avoids cases where empty searches can lead to heavy DB calls, querying
and sorting he entire patron data set.
Signed-off-by: Bill Erickson <berickxx at gmail.com>
Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
index 26b86d4..16b0c82 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
@@ -1348,6 +1348,19 @@ sub patron_adv_search {
my( $self, $client, $auth, $search_hash, $search_limit,
$search_sort, $include_inactive, $search_ou, $flesh_fields, $offset) = @_;
+ # API params sanity checks.
+ # Exit early with empty result if no filter exists.
+ # .fleshed call is streaming. Non-fleshed is effectively atomic.
+ my $fleshed = ($self->api_name =~ /fleshed/);
+ return ($fleshed ? undef : []) unless (ref $search_hash ||'') eq 'HASH';
+ my $search_ok = 0;
+ for my $key (keys %$search_hash) {
+ next if $search_hash->{$key}{value} =~ /^\s*$/; # empty filter
+ $search_ok = 1;
+ last;
+ }
+ return ($fleshed ? undef : []) unless $search_ok;
+
my $e = new_editor(authtoken=>$auth);
return $e->event unless $e->checkauth;
return $e->event unless $e->allowed('VIEW_USER');
-----------------------------------------------------------------------
Summary of changes:
.../src/perlmods/lib/OpenILS/Application/Actor.pm | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list