Bug 8694

Summary: Show accurate subscription renewal warning for expired subscriptions
Product: Koha Reporter: Owen Leonard <oleonard>
Component: SerialsAssignee: Jonathan Druart <jonathan.druart>
Status: Failed QA --- QA Contact:
Severity: normal    
Priority: P5 - low CC: abl, caroline.cyr-la-rose, colin.campbell, jonathan.druart, katrin.fischer, kyle, marjorie.barry-vila, sally.healey
Version: master   
Hardware: All   
OS: All   
URL: /cgi-bin/koha/serials/subscription-detail.pl
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 8694 - Show accurate subscription renewal warning for expired subscriptions
Subscription that caused an error.
Bug 8694: Show accurate subscription renewal warning for expired subscriptions
Bug 8694: Show accurate subscription renewal warning for expired subscriptions
Bug 8694: Show accurate subscription renewal warning for expired subscriptions

Description Owen Leonard 2012-08-28 14:45:46 UTC
Currently if you have an expired subscription you see on the subscription detail page a message saying "Subscription will expire [ date in the past ]." It would be more accurate and helpful to say "Subscription expired on [ expiration date ]."
Comment 1 Owen Leonard 2012-08-28 15:06:08 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2012-08-31 12:14:57 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2020-12-16 13:44:02 UTC Comment hidden (obsolete)
Comment 4 PTFS Europe Sandboxes 2021-01-18 12:47:08 UTC Comment hidden (obsolete)
Comment 5 Sally 2021-01-18 12:47:45 UTC
Works as expected.
Comment 6 Katrin Fischer 2021-02-14 16:00:05 UTC
I have problems replicating this. May subscription end date is in the past, but the note doesn't show on the subscription detail page, while it does already show on the serial collection page.

I wonder if the reason I can't see the note is abouttoexpire, but I fail to understand how this one works.

Joubu, can you help?

Would it make sense to change the note on the serial subscription page as well? 
At least we should probably use the same logic in both places?
Comment 7 Jonathan Druart 2021-02-15 15:17:43 UTC
I cannot remember exactly but I know it was painful.

The "logic" is in C4::Serials::abouttoexpire, IIRC I tried to hit the first condition and hardcoded planneddate to be before then after today.
Comment 8 Caroline Cyr La Rose 2021-10-06 16:03:33 UTC
If I may, here's what I have with the current master...

My subscription A expired on September 1st 2021, we are Oct. 6, so it is currently expired. I have received all issues that were in the subscription (and more).

In subscription-detail.pl : "Subscription will expire 09/01/2021. Renew this subscription." In a blue message box. Renew this subscription is a link.

In serials-collection.pl : "Subscription expired" in bold, red and with an exclamation mark icon next to it


My subscription B expired on the same day. BUT I haven't received any issues (I only just created the subscription and didn't do anything else).

Nothing in subscription-detail.pl, nothing in serials-collection.pl.

Once I have received one issue with today's date, the messages appear in both subscription-detail.pl and serials-collection.pl

If I change the received issue and put a date in the past in "Expected on", the messages disappear.


I can't get just one message like Katrin.

But, what I understand is that it has nothing to do with the end of the subscription and more to do with the issues in the subscription?
Comment 9 Owen Leonard 2022-05-12 13:19:52 UTC
I'd love to see this get picked up again. It's a minor issue, but annoying.

When comparing dates in abouttoexpire, perhaps it could return a positive number if the expiration date is in the future and a negative one if it's in the past? Then the template logic could handle which message to display.
Comment 10 Jonathan Druart 2022-06-08 14:31:48 UTC
Did you test the patch, Owen?
Comment 11 Jonathan Druart 2022-06-09 12:11:08 UTC
Created attachment 135879 [details] [review]
Bug 8694: Show accurate subscription renewal warning for expired subscriptions

If a subscription is going to expired we should not phrase the warning
  "Subscription will expire [ date in the past ]."

Test plan:
Create a subscription with relevant expiration date.
The detail page of the subscription show correctly the warning about the
expiration date.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 12 Owen Leonard 2022-06-09 12:24:36 UTC
With the patch the page now says "Subscription expired on..." whether or not the date is in the past or in the future.