From 536345c3b84ac91540b9f20f6e090a7e91343ec6 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 18 Mar 2014 11:44:42 -0400 Subject: [PATCH] Bug 11253: tools/inventory.pl: fix handling of inventory date This patch fixes a stray call to output_pref() that had not been updated by the patch for 10380, which caused a crash when uploading a barcode file when the dd/mm/yyyy dateformat is in use. TEST PLAN --------- Set I18N/L10N system preference of dateformat to dd/mm/yyyy. Go to inventory/stocktaking tool. Browse for the barcode file. Select the branch (i.e. not All libraries) to match. Click submit KABOOM! Apply patch Go to inventory/stocktaking tool. Browse for the barcode file. Select the branch (i.e. not All libraries) to match. Click submit Table displays dates in "Unseen since" column. Signed-off-by: Marcel de Rooy Before the patch, I had this error when using dateformat=ddmmyy: Template process failed: undef error - The 'day' parameter ("2014") to DateTime::new did not pass the 'an integer which is a possible valid day of month' callback at /usr/local/share/perl5/Params/Validate/PP.pm line 633. This patch corrects the problem. Signed-off-by: Katrin Fischer Passes all tests and QA script. Confirmed problem before applying the patch. Tested with the patch all dateformat setting still work correctly. Signed-off-by: Galen Charlton --- koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt | 2 +- tools/inventory.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt index 9e2df519f2..cab07edf39 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt @@ -249,7 +249,7 @@ $(document).ready(function(){ [% result.damaged | html %] - [% result.datelastseen | html | $KohaDates%] + [% result.datelastseen | $KohaDates | html %] [% IF result.problem == 'wrongplace' %] diff --git a/tools/inventory.pl b/tools/inventory.pl index 3d8939e090..3db63afbc8 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -151,7 +151,7 @@ my @errorloop; if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) { my $dbh = C4::Context->dbh; my $date = dt_from_string( $input->param('setdate') ); - $date = output_pref( $date, 'iso' ); + $date = output_pref ( { dt => $date, dateformat => 'iso' } ); my $strsth = "select * from issues, items where items.itemnumber=issues.itemnumber and items.barcode =?"; my $qonloan = $dbh->prepare($strsth); -- 2.39.5