Bug 34462

Summary: Bug 25299 seems to have been reintroduced in more recent versions.
Product: Koha Reporter: David Roberts <david.roberts>
Component: PatronsAssignee: Emily-Rose Francoeur <emily-rose.francoeur>
Status: CLOSED FIXED QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: caroline.cyr-la-rose, david, emily-rose.francoeur, fridolin.somers, gmcharlt, kyle.m.hall, marie-luce.laflamme, martin.renvoize, philippe.blouin
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25299
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the display of the card expiration message on a patron's page so that it now includes the date that their card will expire.
Version(s) released in:
23.11.00,23.05.05,22.11.12
Circulation function:
Bug Depends on: 27873    
Bug Blocks:    
Attachments: Bug 34462 : Display the patron's expiration date
Bug 34462: Display the patron's expiration date
Bug 34462: (follow-up) Shorten card experiation message
Bug 34462: Display the patron's expiration date
Bug 34462: (follow-up) Shorten card experiation message

Description David Roberts 2023-08-03 01:36:55 UTC
On the details screen of a patron record, if the patron is due to expire the alert at the top of the screen reads:

Expiration: Patron's card will expire soon. Patron's card expires on 

The date is missing from this alert. This was originally fixed in Bug 25299, but seems to have been reintroduced. I can replicate this at 21.11 and 22.11.
Comment 1 David Roberts 2023-08-03 01:46:30 UTC
 See https://snipboard.io/t5034G.jpg for a screenshot
Comment 2 Marie-Luce Laflamme 2023-09-27 19:58:16 UTC
We do have this issue too in 23.05 and in earlier version 22.05.


Test plan

1. Add a new patron with a date expiry less < than 30 days in the future.
2. Go to the "details" tab of this account
3. Check the expiration message:
--> notice the date is missing after "expires on":
"Expiration: Patron's card will expire soon. Patron's card expires on Renew or Edit details"

4. Then, compare with the "check out" tab warning
--> this one is showing the expiration date correctly
"Expiration: Patron's card will expire soon. Patron's card expires on 2023-10-15 Renew or Edit details"
Comment 3 Emily-Rose Francoeur 2023-09-28 14:17:12 UTC
Created attachment 156337 [details] [review]
Bug 34462 : Display the patron's expiration date

The problem is in the patron_messages.inc file on line 25. The variable "expiry" is used, but it should be "patron.dateexpiry" because the patron's card isn't expired yet.

TEST PLAN
1) Go to “Patrons > + New patron”
2) Create a patron with an expiry date that is less than 30 days in the future
3) Go to the "details" tab of this account
4) Notice that the date is missing after "expires on":
"Expiration: Patron's card will expire soon. Patron's card expires on Renew or Edit details"
5) Apply the patch
6) Reload the page; the expiry date should now be displayed
Comment 4 David Nind 2023-09-28 22:16:30 UTC
Created attachment 156359 [details] [review]
Bug 34462: Display the patron's expiration date

The problem is in the patron_messages.inc file on line 25. The variable "expiry" is used, but it should be "patron.dateexpiry" because the patron's card isn't expired yet.

TEST PLAN
1) Go to “Patrons > + New patron”
2) Create a patron with an expiry date that is less than 30 days in the future
3) Go to the "details" tab of this account
4) Notice that the date is missing after "expires on":
"Expiration: Patron's card will expire soon. Patron's card expires on Renew or Edit details"
5) Apply the patch
6) Reload the page; the expiry date should now be displayed

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2023-09-28 22:16:33 UTC
Created attachment 156360 [details] [review]
Bug 34462: (follow-up) Shorten card experiation message

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2023-09-28 22:17:43 UTC
Comment on attachment 156337 [details] [review]
Bug 34462 : Display the patron's expiration date

Not sure what I did when signing off, obsoleting patch.
Comment 7 David Nind 2023-09-28 22:30:27 UTC
Hi Émily-Rose.

I amended your patch (I perhaps should have done this as a follow-up):

1. Removed the extra space in the commit message bug title, so that it now reads as "Bug 34462: Display..." instead of "Bug 34462 :  Display...".
  
2. I added a full stop after the date, so the message displays as "... Patron's card expires on 10/18/2023. Renew or Edit details".

I also added a follow-up patch to shorten the message to make it more succinct, as there is a bit of duplication.

So the expiration message now reads as "Expiration: Patron's card expires on 10/18/2023. Renew or Edit details".

Feel free to obsolete this patch if you disagree 8-).

David
Comment 8 Martin Renvoize (ashimema) 2023-10-17 12:42:53 UTC
Created attachment 157239 [details] [review]
Bug 34462: Display the patron's expiration date

The problem is in the patron_messages.inc file on line 25. The variable "expiry" is used, but it should be "patron.dateexpiry" because the patron's card isn't expired yet.

TEST PLAN
1) Go to “Patrons > + New patron”
2) Create a patron with an expiry date that is less than 30 days in the future
3) Go to the "details" tab of this account
4) Notice that the date is missing after "expires on":
"Expiration: Patron's card will expire soon. Patron's card expires on Renew or Edit details"
5) Apply the patch
6) Reload the page; the expiry date should now be displayed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize (ashimema) 2023-10-17 12:42:56 UTC
Created attachment 157240 [details] [review]
Bug 34462: (follow-up) Shorten card experiation message

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2023-10-17 12:43:46 UTC
Thanks for the fix.. all working as expected and I like the follow-up too.

Passing QA
Comment 11 Tomás Cohen Arazi (tcohen) 2023-10-18 18:44:09 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 12 Fridolin Somers 2023-10-25 07:36:59 UTC
Looks its dates back to Bug 27873
Comment 13 Fridolin Somers 2023-10-25 07:38:10 UTC
Pushed to 23.05.x for 23.05.05
Comment 14 Matt Blenkinsop 2023-11-13 14:03:22 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x