]> git.koha-community.org Git - koha.git/commit
Bug 15822: Fix 500 error when searching if items.onloan=0000-00-00
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 23 Nov 2016 10:06:04 +0000 (10:06 +0000)
committerMason James <mtj@kohaaloha.com>
Tue, 3 Jan 2017 01:22:10 +0000 (14:22 +1300)
commit094ef820d9ea713d02f04bcaad4021f5f1292915
tree30a64330112c0345e7ba362ee372b0ca6a5e4b5b
parent9ec91c5c24460144428c1ba74526b99bcdd072f5
Bug 15822: Fix 500 error when searching if items.onloan=0000-00-00

The calls
  output_pref({ dt => dt_from_string( $date ) })
are wrong and should be replaced with
  output_pref({ str => $date })
For better error handling.

Here we fix the problem of items.onloan when searching

Test plan:
- Set items.onloan=0000-00-00 (UPDATE items SET onloan='0000-00-00')
This can come from old data or bad migration
- Execute a search
=> Without this patch you get
Can't locate object method "ymd" via package "dateonly" (perhaps you forgot to load "dateonly"?) at /home/vagrant/kohaclone/Koha/DateUtils.pm line 225.
=> With this patch you won't get the error

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 167c74bfd386287783e101989b804077b1020369)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit a5ce343c9d7d8790a8dbd98b3833ea6cf155c180)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
C4/Search.pm