Bugzilla – Attachment 55986 Details for
Bug 17375
Prevent internal software error when searching patron with invalid birth date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF]Bug 17375: Prevent internal software error when searching patron with invalid birth date
SIGNED-OFFBug-17375-Prevent-internal-software-erro.patch (text/plain), 2.43 KB, created by
Héctor Eduardo Castro Avalos
on 2016-10-03 19:29:41 UTC
(
hide
)
Description:
[SIGNED-OFF]Bug 17375: Prevent internal software error when searching patron with invalid birth date
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-10-03 19:29:41 UTC
Size:
2.43 KB
patch
obsolete
>From 56b50e5b0f180efc1460e96a35b09303ab6d7ac3 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Thu, 29 Sep 2016 14:47:28 +0200 >Subject: [PATCH] [SIGNED-OFF]Bug 17375: Prevent internal software error when > searching patron with invalid birth date > >To reproduce: > >- Go to Home > Patron >- Expand patron search (click on + at the left of the search button) >- In drop down 'Search fields', select 'Date of birth' >- Enter a valid date (e.g. 11.02.1995 if syspref 'dateformat' is set to dmydot) >Result: Search works OK >- Enter an invalid date, e.g. 11.02 or abcd... >Result: Internal server error > >- Do a patron search with many results >- Use filter on results screen, select 'Date of birth' as search field and > enter an invalid date to search (e.g. 'a') >Result: Endless message 'Processing' > >To test: >- Apply patch >- Repeat steps above >- In both cases, you should get "No results" > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >Both cases works as advertised >--- > members/member.pl | 2 +- > svc/members/search | 6 +++++- > 2 files changed, 6 insertions(+), 2 deletions(-) > >diff --git a/members/member.pl b/members/member.pl >index 5a8639d..4f0ea22 100755 >--- a/members/member.pl >+++ b/members/member.pl >@@ -65,7 +65,7 @@ if ( $quicksearch and $searchmember ) { > my $searchfieldstype = $input->param('searchfieldstype') || 'standard'; > > if ( $searchfieldstype eq "dateofbirth" ) { >- $searchmember = output_pref({dt => dt_from_string($searchmember), dateformat => 'iso', dateonly => 1}); >+ $searchmember = eval { output_pref({dt => dt_from_string($searchmember), dateformat => 'iso', dateonly => 1}); }; > } > > $template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ); >diff --git a/svc/members/search b/svc/members/search >index 2599519..9980263 100755 >--- a/svc/members/search >+++ b/svc/members/search >@@ -48,7 +48,11 @@ my $has_permission = $input->param('has_permission'); > my $selection_type = $input->param('selection_type'); > > if ( $searchfieldstype eq "dateofbirth" ) { >- $searchmember = output_pref({dt => dt_from_string($searchmember), dateformat => 'iso', dateonly => 1}); >+ $searchmember = eval { output_pref({dt => dt_from_string($searchmember), dateformat => 'iso', dateonly => 1}); }; >+ # Prevent display of all dates if date was not valid >+ unless ($searchmember ) { >+ $searchmember = "1000-01-01"; >+ } > } > > # variable information for DataTables (id) >-- >1.7.10.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 17375
:
55923
|
55986
|
56021
|
56022
|
56024
|
56025
|
56685
|
56918
|
56919