Bug 17933 - Internal software error when searching patron without birth date
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 18 Jan 2017 16:12:30 +0000 (17:12 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 17 Feb 2017 11:22:09 +0000 (11:22 +0000)
commit083a8f7b7274bdf9e9547bee60366259374c1c20
treeb5d3371e78bc8ba294dd8ef1d878e1e3ee9b6f48
parent7698f6453c6c14b4986d573c33f0e49cd73652c6
Bug 17933 - Internal software error when searching patron without birth date

When patrons don't have date of birth (which is not required) patron
search results on moremember page produce internal server error since we
can't convert MySQL invalid date 0000-00-00 to datetime object and
call strfdate on it.

Additionally, since we assign dates to template variables and after
than assign whole $data hash to template, later assigment overrides
previous one, so we see birth date field even for patrons which don't
have one.

This patch fixes both of those problems.

Test:
1. edit patron and remove it's birth date
2. try to search for it, and verify server error
3. apply patch
4. repeat search for patron and verify that it works and doesn't
   have enpty birth date field

Signed-off-by: Grace McKenzie <grace.mcky@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/Patron.pm
members/moremember.pl