[Koha-bugs] [Bug 15822] STAFF Advanced search error date utils

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Feb 24 19:34:01 CET 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15822

--- Comment #14 from Galen Charlton <gmcharlt at gmail.com> ---
In haste: I ran into this today and have diagnosed at least one cause of it. 
Suppose that the search results contain an item where item.onloan is set to
'0000-00-00', not NULL.  In that case, the following line in C4/Search.pm

$onloan_items->{$key}->{due_date} = output_pref( { dt => dt_from_string(
$item->{onloan} ), dateonly => 1 } );

ends up calling output_pref with the following parameters:

{ dt => 'dateonly', 1 => undef }

Changing line 50 in Koha/DateUtils.pm from

    return if $date_string and $date_string =~ m|^0000-0|;

to

    return undef if $date_string and $date_string =~ m|^0000-0|;

works around that oddity.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list