From f71283bad5517757ee6b670c0edb5257d0a1bedc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 24 Mar 2014 15:25:05 +0100 Subject: [PATCH] Bug 11995: restore ability of serialsUpdate.pl to calculate next serial issue dates Bug 7688 changed the prototype for GetNextDate, but the serialsUpdate.pl cronjob script had not been updated. This patch fixes the problem. Test plan: Before applying the patch: 1/ Check that the following SQL query returns something: SELECT serial.* FROM serial LEFT JOIN subscription ON (subscription.subscriptionid = serial.subscriptionid) WHERE serial.status = 1 AND DATE_ADD(planneddate, INTERVAL CAST(graceperiod AS SIGNED) DAY) < NOW() AND subscription.closed = 0; 2/ Run misc/cronjobs/serialsUpdate.pl -v It should die with an error message like this: Can't use string ("2011-03-05") as a HASH ref while "strict refs" in use 3/ Apply the patch 4/ Run misc/cronjobs/serialsUpdate.pl -v It should exit normally and print messages like this: Serial issue with id=XX updated 5/ Run the Koha QA test tools. Signed-off-by: Mark Tompsett Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton --- misc/cronjobs/serialsUpdate.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/cronjobs/serialsUpdate.pl b/misc/cronjobs/serialsUpdate.pl index 07d418a509..813ef21270 100755 --- a/misc/cronjobs/serialsUpdate.pl +++ b/misc/cronjobs/serialsUpdate.pl @@ -110,10 +110,10 @@ $sth->execute(); while ( my $issue = $sth->fetchrow_hashref ) { my $subscription = &GetSubscription( $issue->{subscriptionid} ); - my $planneddate = $issue->{planneddate}; + my $publisheddate = $issue->{publisheddate}; - if ( $subscription && $planneddate && $planneddate ne "0000-00-00" ) { - my $nextpublisheddate = GetNextDate( $planneddate, $subscription ); + if ( $subscription && $publisheddate && $publisheddate ne "0000-00-00" ) { + my $nextpublisheddate = GetNextDate( $subscription, $publisheddate ); my $today = format_date_in_iso( C4::Dates->new()->output() ); if ( $nextpublisheddate && $today ) { -- 2.39.5