Bug 4286 - Subscription expired at its creation
Summary: Subscription expired at its creation
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: rel_3_2
Hardware: PC All
: PATCH-Sent (DO NOT USE) major (vote)
Assignee: Galen Charlton
QA Contact: Bugs List
: 4280 (view as bug list)
Depends on:
Reported: 2010-03-01 08:27 UTC by Chris Cormack
Modified: 2012-10-25 22:52 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:

bugfix (2.70 KB, patch)
2010-03-01 08:30 UTC, Chris Cormack
Details | Diff | Splinter Review
duplicates cause of renewal (51.05 KB, image/png)
2010-05-29 01:03 UTC, Nicole C. Engard
signed off patch (1.14 KB, patch)
2010-12-17 18:13 UTC, Nicole C. Engard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:25:23 UTC

---- Reported by jeanandre.santoni@biblibre.com 2010-03-01 08:27:59 ----


---- Additional Comments From jeanandre.santoni@biblibre.com 2010-03-01 08:30:11 ----

Created an attachment

---- Additional Comments From nengard@gmail.com 2010-03-01 11:03:09 ----

*** http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4280 has been marked as a duplicate of this bug. ***

--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:25 UTC  ---

This bug was previously known as _bug_ 4286 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4286
Imported an attachment (id=1978)

Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was jeanandre.santoni@biblibre.com.
The original assignee of this bug does not have
   an account here. Reassigning to the default assignee
   for the component, gmcharlt@gmail.com.
   Previous assignee was jeanandre.santoni@biblibre.com.
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.
The original submitter of attachment 1978 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.

Comment 1 Nicole C. Engard 2010-05-26 00:06:12 UTC
Reopening since this bug has reappeared in the latest HEAD -
Comment 2 Nicole C. Engard 2010-05-29 01:03:19 UTC
Created attachment 2189 [details]
duplicates cause of renewal

Also, if you renew the subscription to be able to accept it duplicates everything on the screen making it hard to read
Comment 3 Koustubha Kale 2010-06-03 12:11:10 UTC
The patch fails with the following..

git apply ../patches/0001-MT-3035-subscription-created-expired.patch
../patches/0001-MT-3035-subscription-created-expired.patch:42: trailing whitespace.
error: patch failed: C4/Serials.pm:987
error: C4/Serials.pm: patch does not apply
Comment 4 Nicole C. Engard 2010-07-07 22:37:31 UTC
This is still an issue and kind of a big one if you're cataloging a lot of serials and have to renew each one to add items.  Upping severity.
Comment 5 Nicole C. Engard 2010-08-24 20:01:32 UTC
*** Bug 4280 has been marked as a duplicate of this bug. ***
Comment 6 Colin Campbell 2010-10-05 11:32:53 UTC
Have just tried to replicate this on current HEAD and its not reproduceable. The bug whereby subscriptions were expiring immediately was caused by a problem with the generation of expiry dates from a start date. Is the system logging an error when the subscription is created
Comment 7 Nicole C. Engard 2010-10-05 11:35:25 UTC
I still have this issue in my install of HEAD and in new installs.  Can you tell me how to get the log you're looking for so I can get you any errors that the system is generating.  

Every new subscription I create is expired at creation - or at least it requires a renewal before I can receive any issues.
Comment 8 Colin Campbell 2010-10-05 11:56:24 UTC
Located the problem if I switch my date format to mm/dd/yyyy then new subscriptions are getting expired and subscription detail shows some odd dates like 00/02/0 

Errors appear in the apache error_log or koha-dev/var/log/koha-error.log depending on how install is set up.

I'll try and post a patch today
Comment 9 Colin Campbell 2010-12-13 12:34:14 UTC
Can people retest this bug. I cannot reproduce it using the steps I previously used to generate it.
Comment 10 Nicole C. Engard 2010-12-16 17:08:42 UTC
This is still an issue.


1. New Subscription
2. Fill in all data
3. Save Subscription
4. Click 'Receive' and see that the status is grayed out and not changeable
5. Click 'Back'
6. Click 'Renew' (change nothing) just save
7. Click 'Receive' and now you can change from expected to arrived
Comment 11 Colin Campbell 2010-12-17 10:50:19 UTC
The bug is now specific to some frequencies. There is a specific problem in serials-edit which was checking HasSubscriptionExpired as if it was a boolean. In fact that subroutine can return three values (Not expired, expired, no enddate set) I've sent a patch which explictly checks for expiration, as the third response was stopping receipting despite it being valid for some frequencies and we cannot guarantee the enddate being set on new subscriptions. 

I think that patch should resolve the case I managed to reproduce. Other recently added patches mean that enddate is now being correctly set rather than left as NULL on some common cases. There are some horrible semantics in some of the expiry/prediction interface that need clearing up though.
Comment 12 Nicole C. Engard 2010-12-17 18:13:23 UTC
I have signed off on the patch, it appears to solve the problem.
Comment 13 Nicole C. Engard 2010-12-17 18:13:54 UTC
Created attachment 2879 [details] [review]
signed off patch
Comment 14 Chris Cormack 2010-12-19 08:20:28 UTC
Patch pushed, please test