Bugzilla – Attachment 57849 Details for
Bug 15822
STAFF Advanced search error date utils
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15822: Fix 500 error when searching if items.onloan=0000-00-00
Bug-15822-Fix-500-error-when-searching-if-itemsonl.patch (text/plain), 1.70 KB, created by
Alex Buckley
on 2016-11-30 23:19:56 UTC
(
hide
)
Description:
Bug 15822: Fix 500 error when searching if items.onloan=0000-00-00
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2016-11-30 23:19:56 UTC
Size:
1.70 KB
patch
obsolete
>From 3206e2e249122bfeb39096fb130229f9640d6d54 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 23 Nov 2016 10:06:04 +0000 >Subject: [PATCH] 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> >--- > C4/Search.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index b1b9b0e..998e8e3 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -2093,7 +2093,7 @@ sub searchResults { > { > $onloan_count++; > my $key = $prefix . $item->{onloan} . $item->{barcode}; >- $onloan_items->{$key}->{due_date} = output_pref( { dt => dt_from_string( $item->{onloan} ), dateonly => 1 } ); >+ $onloan_items->{$key}->{due_date} = output_pref( { str => $item->{onloan}, dateonly => 1 } ); > $onloan_items->{$key}->{count}++ if $item->{$hbranch}; > $onloan_items->{$key}->{branchname} = $item->{branchname}; > $onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15822
:
48121
|
48153
|
57725
|
57849
|
57985