Bug 13109 - Serial failure for received and general viewing
Summary: Serial failure for received and general viewing
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: master
Hardware: All All
: P3 major (vote)
Assignee: Mason James
QA Contact: Testopia
URL:
Whiteboard:
Keywords: rel_3_18_candidate
Depends on:
Blocks: 14036
  Show dependency treegraph
 
Reported: 2014-10-17 17:07 UTC by Aliza
Modified: 2016-12-05 21:23 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13109 - Serial failure for received and general viewing. (2.07 KB, patch)
2015-03-30 06:41 UTC, Mason James
Details | Diff | Splinter Review
Bug 13109 - Serial failure for received and general viewing. (2.51 KB, patch)
2015-03-30 06:51 UTC, Mason James
Details | Diff | Splinter Review
Bug 13109 - Serial failure for received and general viewing. (2.71 KB, patch)
2015-04-13 09:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 13109 - Serial failure for received and general viewing. (2.78 KB, patch)
2015-04-15 20:07 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aliza 2014-10-17 17:07:48 UTC
For Log Magazine, also still an issue for Sports Business Journal

Received the following message

Software error:

Usage: Date::Calc::Delta_Days(year1, month1, day1, year2, month2, day2) at /usr/share/koha/lib/C4/Serials.pm line 2379.
For help, please send mail to the webmaster (staff@bywatersolutions.com), giving this error message and the time and date of the error.
Comment 1 Mason James 2015-03-10 01:23:55 UTC
(In reply to Aliza from comment #0)
> For Log Magazine, also still an issue for Sports Business Journal
> 
> Received the following message
> 
> Software error:
> 
> Usage: Date::Calc::Delta_Days(year1, month1, day1, year2, month2, day2) at
> /usr/share/koha/lib/C4/Serials.pm line 2379.
> For help, please send mail to the webmaster (staff@bywatersolutions.com),
> giving this error message and the time and date of the error.


hmm, we just hit this bug on 3.16.7

i'll do a little more digging on this one
Comment 2 Mason James 2015-03-30 06:37:55 UTC
(In reply to Aliza from comment #0)
> For Log Magazine, also still an issue for Sports Business Journal
> 
> Received the following message
> 
> Software error:
> 
> Usage: Date::Calc::Delta_Days(year1, month1, day1, year2, month2, day2) at
> /usr/share/koha/lib/C4/Serials.pm line 2379.
> For help, please send mail to the webmaster (staff@bywatersolutions.com),
> giving this error message and the time and date of the error.

aah, i see the problem here...

the abouttoexpire() sub tries to compare 2 dates, but doesnt check that both dates actually exist

i'll send a patch for this
Comment 3 Mason James 2015-03-30 06:41:09 UTC Comment hidden (obsolete)
Comment 4 Mason James 2015-03-30 06:51:31 UTC Comment hidden (obsolete)
Comment 5 Mason James 2015-03-30 06:59:01 UTC
..bug confirmed on master, and 3.18.5 too
Comment 6 M. Tompsett 2015-04-10 06:22:39 UTC
(In reply to Mason James from comment #4)
> 1/ attempt to view a subscription-detail that has a NULL value for either
> it's 'startdate' or 'enddate'

The date picker forces it or a length to be entered. How do you get this situation without messing with data in the back end?


>   an example url would be...
>  
> http://koha-admin.foo.org/cgi-bin/koha/serials/subscription-detail.
> pl?subscriptionid=1
> 
>   observe error...
>   'Date::Calc::PP::Delta_Days(): Usage:
> Date::Calc::Delta_Days($year1,$month1,$day1,$year2,$month2,$day2) at
> /your/koha/C4/Serials.pm line 2325'
> 
> 2/ apply patch
> 3/ repeat step 1/
>    observe that detail page displays OK

Could you just confirm test steps more explicitly, assuming fresh install with one superlibrarian created and defaults all installed?
Comment 7 Jonathan Druart 2015-04-13 09:38:02 UTC Comment hidden (obsolete)
Comment 8 Mason James 2015-04-14 09:18:42 UTC
(In reply to M. Tompsett from comment #6)
> (In reply to Mason James from comment #4)
> > 1/ attempt to view a subscription-detail that has a NULL value for either
> > it's 'startdate' or 'enddate'
> 
> The date picker forces it or a length to be entered. How do you get this
> situation without messing with data in the back end?

hmm, i'm really not sure

but, we hit this bug in a prod koha, with no messing of data
Comment 9 Katrin Fischer 2015-04-15 20:07:44 UTC
Created attachment 37915 [details] [review]
[PASSED QA] Bug 13109 - Serial failure for received and general viewing.

to test...

1/ attempt to view a subscription-detail that has a NULL value for either it's 'startdate' or 'enddate'

  an example url would be...
  http://koha-admin.foo.org/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=1

  observe error...
  'Date::Calc::PP::Delta_Days(): Usage: Date::Calc::Delta_Days($year1,$month1,$day1,$year2,$month2,$day2) at /your/koha/C4/Serials.pm line 2325'

2/ apply patch
3/ repeat step 1/
   observe that detail page displays OK

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I confirm the issue if startdate is null (can exist with old data,
before the js check on the form).
Amended patch: Remove trailing space char and the link to the bz number
(can be found using git log).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 M. Tompsett 2015-04-23 12:06:55 UTC
*** Bug 14036 has been marked as a duplicate of this bug. ***
Comment 11 M. Tompsett 2015-04-28 01:19:21 UTC
(In reply to M. Tompsett from comment #10)
> *** Bug 14036 has been marked as a duplicate of this bug. ***

Correction, it isn't. :)
Comment 12 Tomás Cohen Arazi 2015-04-29 02:22:00 UTC
Patch pushed to master.

Thanks Mason!
Comment 13 Chris Cormack 2015-05-17 04:27:00 UTC
Pushed to 3.18.x will be in 3.18.7
Comment 14 Mason James 2015-05-29 07:48:38 UTC
Pushed to 3.16.x, will be in 3.16.11
Comment 15 Danielle Elder 2015-07-13 21:33:20 UTC
(In reply to Mason James from comment #14)
> Pushed to 3.16.x, will be in 3.16.11

I just wanted to say THANK YOU for adding the version that this is pushed to in the post! So helpful.