Bugzilla – Attachment 119376 Details for
Bug 28015
Inventory tool fails when timeformat=12h
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28015: Fix inventory for timeformat=12h
Bug-28015-Fix-inventory-for-timeformat12h.patch (text/plain), 2.93 KB, created by
Owen Leonard
on 2021-04-09 12:47:53 UTC
(
hide
)
Description:
Bug 28015: Fix inventory for timeformat=12h
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-04-09 12:47:53 UTC
Size:
2.93 KB
patch
obsolete
>From 9084487c2ba1ec5e8865c783cb3c4f51586665b0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 9 Apr 2021 11:22:11 +0200 >Subject: [PATCH] Bug 28015: Fix inventory for timeformat=12h > >Inventory explodes with the following stacktrace if timeformat is set to 12h > >Invalid value passed, datelastseen=2021-04-09 12:00 AM expected type is date at /usr/share/perl5/Exception/Class/Base.pm line 88 > Exception::Class::Base::throw('Koha::Exceptions::Object::BadValue', 'type', 'date', 'value', '2021-04-09 12:00 AM', 'property', 'datelastseen') called at /kohadevbox/koha/Koha/Object.pm line 196 > Koha::Object::catch {...} ('DBIx::Class::Exception=HASH(0x557a052baeb0)') called at /usr/share/perl5/Try/Tiny.pm line 124 > Try::Tiny::try('CODE(0x557a051931d8)', 'Try::Tiny::Catch=REF(0x557a052bfc30)') called at /kohadevbox/koha/Koha/Object.pm line 206 > Koha::Object::store('Koha::Item=HASH(0x557a0521a048)') called at /kohadevbox/koha/Koha/Item.pm line 202 > Koha::Item::store('Koha::Item=HASH(0x557a0521a048)') called at /kohadevbox/koha/tools/inventory.pl line 220 > >Test plan: >Set TimeFormat to 12h >Use the inventory >=> Confirm that it's working with this patch applied > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > tools/inventory.pl | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/tools/inventory.pl b/tools/inventory.pl >index e82e77fe99..7503e8ce5d 100755 >--- a/tools/inventory.pl >+++ b/tools/inventory.pl >@@ -159,8 +159,8 @@ my @errorloop; > my $moddatecount = 0; > if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length($barcodelist) > 0) ) { > my $dbh = C4::Context->dbh; >- my $date = dt_from_string( scalar $input->param('setdate') ); >- $date = output_pref ( { dt => $date, dateformat => 'iso' } ); >+ my $date = $input->param('setdate'); >+ my $date_dt = dt_from_string($date); > > my $strsth = "select * from issues, items where items.itemnumber=issues.itemnumber and items.barcode =?"; > my $qonloan = $dbh->prepare($strsth); >@@ -217,7 +217,7 @@ if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length > my $item = Koha::Items->find({barcode => $barcode}); > if ( $item ) { > # Modify date last seen for scanned items, remove lost status >- $item->set({ itemlost => 0, datelastseen => $date })->store; >+ $item->set({ itemlost => 0, datelastseen => $date_dt })->store; > my $item_unblessed = $item->unblessed; > $moddatecount++; > unless ( $dont_checkin ) { >@@ -239,7 +239,7 @@ if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length > } > } > } >- $template->param( date => $date ); >+ $template->param( date => output_pref ( { str => $date, dateformat => 'iso' } ) ); > $template->param( errorloop => \@errorloop ) if (@errorloop); > } > >-- >2.11.0
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 28015
:
118617
|
119364
|
119376
|
119672