Bugzilla – Attachment 175171 Details for
Bug 38605
t/db_dependent/Koha/OAIHarvester.t fails with wrong date format
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38605: Fix Harvester.pm use of days parameter
Bug-38605-Fix-Harvesterpm-use-of-days-parameter.patch (text/plain), 1.53 KB, created by
David Nind
on 2024-12-04 12:02:38 UTC
(
hide
)
Description:
Bug 38605: Fix Harvester.pm use of days parameter
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-12-04 12:02:38 UTC
Size:
1.53 KB
patch
obsolete
>From 049b4785f9f1ad95627b48ea5c01255c86865096 Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Wed, 4 Dec 2024 10:13:07 +0000 >Subject: [PATCH] Bug 38605: Fix Harvester.pm use of days parameter > >Dates were incorrectly handled during the first days of the month because of >the use of non-zero-padded days values. > >(t/db_dependent/Koha/OAIHarvester.t failed) > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/OAI/Client/Harvester.pm | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > >diff --git a/Koha/OAI/Client/Harvester.pm b/Koha/OAI/Client/Harvester.pm >index ed83d3d36d..0b3d02467f 100644 >--- a/Koha/OAI/Client/Harvester.pm >+++ b/Koha/OAI/Client/Harvester.pm >@@ -46,11 +46,7 @@ use MARC::Record; > use Modern::Perl; > use DateTime; > use DateTime::Format::Strptime; >-use Try::Tiny qw( catch try ); >-use Date::Calc qw( >- Add_Delta_Days >- Today >-); >+use Try::Tiny qw( catch try ); > > our $xslt_engine = Koha::XSLT::Base->new; > >@@ -129,9 +125,7 @@ sub init { > if ($days) { > > # Change this to yyyy-mm-dd >- my ( $nowyear, $nowmonth, $nowday ) = Today(); >- my @date = Add_Delta_Days( $nowyear, $nowmonth, $nowday, -$days ); >- my $dt_start = dt_from_string( $date[0] . '-' . $date[1] . '-' . $date[2] ); >+ my $dt_start = dt_from_string->subtract( days => $days ); > $start_date = $dt_start->ymd(); > $self->printlog("Harvesting from $start_date"); > } >-- >2.39.5
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 38605
:
175154
|
175164
| 175171