Bugzilla – Attachment 38459 Details for
Bug 14036
"Date::Calc::Add_Delta_YM(): not a valid date" error when accessing subscription detail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14036: "Date::Calc::Add_Delta_YM(): not a valid date" error when accessing subscription detail
Bug-14036-DateCalcAddDeltaYM-not-a-valid-date-erro.patch (text/plain), 2.87 KB, created by
Mark Tompsett
on 2015-04-23 19:30:20 UTC
(
hide
)
Description:
Bug 14036: "Date::Calc::Add_Delta_YM(): not a valid date" error when accessing subscription detail
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-04-23 19:30:20 UTC
Size:
2.87 KB
patch
obsolete
>From 86d8cf14c85a86e9eae2abaf197a9b98cc674752 Mon Sep 17 00:00:00 2001 >From: Rolando Isidoro <rolando.isidoro@gmail.com> >Date: Tue, 21 Apr 2015 21:35:05 -0400 >Subject: [PATCH] Bug 14036: "Date::Calc::Add_Delta_YM(): not a valid date" > error when accessing subscription detail > >When accessing the subscription detail page for a serial with unknown "Planned date" and/or "Published date" the following error occurs: > >subscription-detail.pl: Date::Calc::PP::Add_Delta_YM(): Date::Calc::Add_Delta_YM(): not a valid date at /usr/share/koha/lib/C4/Serials.pm line 2607 > at /usr/share/perl/5.14/CGI/Carp.pm line 379 > CGI::Carp::realdie('[Tue Apr 21 14:43:06 2015] subscription-detail.pl: Date::Calc...') called at /usr/share/perl/5.14/CGI/Carp.pm line 475 > CGI::Carp::die('Date::Calc::PP::Add_Delta_YM(): Date::Calc::Add_Delta_YM(): n...') called at /usr/share/perl5/Carp/Clan.pm line 225 > Carp::Clan::__ANON__('Date::Calc::Add_Delta_YM(): not a valid date') called at /usr/share/perl5/Date/Calc/PP.pm line 408 > Date::Calc::PP::DATECALC_DATE_ERROR('Add_Delta_YM') called at /usr/share/perl5/Date/Calc/PP.pm line 817 > Date::Calc::PP::Add_Delta_YM(0000, 00, 00, 0, 1) called at /usr/share/koha/lib/C4/Serials.pm line 2607 > C4::Serials::GetNextDate('HASH(0x6244de0)', '0000-00-00') called at /usr/share/koha/lib/C4/Serials.pm line 2382 > C4::Serials::abouttoexpire(525) called at /usr/share/koha/intranet/cgi-bin/serials/subscription-detail.pl line 104 > >This patch adds validation to prevent the error from occurring. > >Test plan > >Before applying the patch > >1 - In the intranet interface pick a serial biblio record with a subscription with empty "Planned date" and/or "Published date"; >2 - Click the "Subscription(s)" tab on the left side; >3 - Click the subscription title link to view it's detail; > >The error should occur at this point. > >Apply the patch, follow the 3 steps from the test plan and the error shouldn't show up anymore. >--- > C4/Serials.pm | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index c3f7fbc..ec937d3 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -2246,6 +2246,9 @@ sub abouttoexpire { > my $expirationdate = GetExpirationDate($subscriptionid); > my ($res) = $dbh->selectrow_array('select max(planneddate) from serial where subscriptionid = ?', undef, $subscriptionid); > my $nextdate = GetNextDate($subscription, $res); >+ >+ return unless ($nextdate and $expirationdate); >+ > if(Date::Calc::Delta_Days( > split( /-/, $nextdate ), > split( /-/, $expirationdate ) >@@ -2383,6 +2386,8 @@ sub GetNextDate { > if ($freqdata->{'unit'}) { > my ( $year, $month, $day ) = split /-/, $publisheddate; > >+ return unless check_date($year, $month, $day); >+ > # Process an irregularity Hash > # Suppose that irregularities are stored in a string with this structure > # irreg1;irreg2;irreg3 >-- >1.9.1
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 14036
:
38399
|
38459
|
38461
|
38464
|
38465
|
38466
|
38467
|
38468