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 For the reason see: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14874#c33
Same problem with datatables. To reproduce: - 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'
Created attachment 55923 [details] [review] 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"
Created attachment 55986 [details] [review] [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
Created attachment 56021 [details] [review] Bug 17375: Search by dateofbirth - Add tests
Created attachment 56022 [details] [review] 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"
Hi Marc, Could you have a look at these 2 patches? I think they provide a more robust and durable solution.
Created attachment 56024 [details] [review] Bug 17375: Search by dateofbirth - Add tests Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 56025 [details] [review] 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>
Created attachment 56685 [details] [review] 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>
Created attachment 56918 [details] [review] Bug 17375: Search by dateofbirth - Add tests Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 56919 [details] [review] 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>
Pushed to master for 16.11, thanks Jonathan!
Pushed in 16.05. Will be in 16.05.06.
Pushed to 3.22.x, will be in 3.22.13