Summary: | Duplicated patron's registration date is set to expiration date of template patron | ||
---|---|---|---|
Product: | Koha | Reporter: | Catrina Berka <catrina> |
Component: | Patrons | Assignee: | Laura Escamilla <Laura.escamilla> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | emily.lamancusa, gmcharlt, kebliss, kyle.m.hall, Laura.escamilla, sally.healey |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34117 | ||
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
Bug 33872: Auto calc duplicated patron's registration date to today's date Bug 33872: Auto calc duplicated patron's registration date to today's date |
Description
Catrina Berka
2023-05-31 13:42:32 UTC
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. |