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.
Confirmed on master. Didn't spot the problem.
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!
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>
Works as described, thanks for the patch.
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>
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.
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 ***