Bug 17375: Search by dateofbirth - handle invalid dates
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 4 Oct 2016 10:55:25 +0000 (11:55 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Thu, 27 Oct 2016 13:18:32 +0000 (13:18 +0000)
commit9b34b07d62588713405f31481cb363661b1a5d0c
tree6d3ae00a79b24e3a071f716ef1d451c3305ba279
parent12167c57d0608637504a011627a0256e28e515cd
Bug 17375: Search by dateofbirth - handle invalid dates

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: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Lucio Moraes <lmoraes@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Utils/DataTables/Members.pm
members/member.pl
svc/members/search