Bug 33872 - Duplicated patron's registration date is set to expiration date of template patron
Summary: Duplicated patron's registration date is set to expiration date of template p...
Status: RESOLVED DUPLICATE of bug 34117
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Laura Escamilla
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-31 13:42 UTC by Catrina Berka
Modified: 2023-07-18 12:47 UTC (History)
6 users (show)

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


Attachments
Bug 33872: Auto calc duplicated patron's registration date to today's date (1.87 KB, patch)
2023-06-09 19:18 UTC, Laura Escamilla
Details | Diff | Splinter Review
Bug 33872: Auto calc duplicated patron's registration date to today's date (1.94 KB, patch)
2023-06-14 13:54 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 33872: Auto calc duplicated patron's registration date to today's date (1.99 KB, patch)
2023-06-28 14:16 UTC, ByWater Sandboxes
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Catrina Berka 2023-05-31 13:42:32 UTC
When duplicating a patron, the duplicated patron’s registration date automatically populates with the expiration date of the patron being duplicated. So, the registration date for the new patron is the expiration date of the original patron. This appears to be new behavior in 22.11 - I cannot replicate on 22.05.
Comment 1 Katrin Fischer 2023-06-09 10:03:51 UTC
Confirmed on master. Didn't spot the problem.
Comment 2 Laura Escamilla 2023-06-09 19:18:46 UTC
Created attachment 152265 [details] [review]
Bug 33872: Auto calc duplicated patron's registration date to today's date

Test Plan:
1. Create a duplicate patron and save the record. Notice that the registration date is set incorrectly. 
2. Apply patch
3. Restart all
4. Repeat step 1. Notice that the registration date is now set to today’s date. 
5. Sign off!
Comment 3 PTFS Europe Sandboxes 2023-06-14 13:54:57 UTC
Created attachment 152331 [details] [review]
Bug 33872: Auto calc duplicated patron's registration date to today's date

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 4 Sally 2023-06-14 13:55:34 UTC
Works as described, thanks for the patch.
Comment 5 ByWater Sandboxes 2023-06-28 14:16:30 UTC
Created attachment 152806 [details] [review]
Bug 33872: Auto calc duplicated patron's registration date to today's date

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Rhonda Kuiper <rkuiper@roundrocktexas.gov>
Comment 6 Emily Lamancusa (emlam) 2023-07-17 21:31:12 UTC
Thanks for submitting a patch, Laura!

From what I can tell, this issue occurs when memberentry.pl calls get_expiry_date( $data{dateenrolled} ) on line 724, because $data{dateenrolled} is a DateTime object, and get_expiry_date uses the DateTime add method, which edits the original object rather than returning a copy, according to the docs (https://metacpan.org/pod/DateTime#Math-Methods). This causes $data{dateenrolled} to be incorrect, which is why it populates an incorrect value into the template.

The patch on bug 34117 fixes the underlying data inconsistency by setting $data{dateenrolled} to a string instead of an object (thus causing get_expiry_date to create its own object), so that might be the better solution in this case.
Comment 7 Laura Escamilla 2023-07-18 12:47:00 UTC
Thanks for the feedback, Emily. I'll mark this one as a duplicate of 34117.

*** This bug has been marked as a duplicate of bug 34117 ***