[Koha-bugs] [Bug 34117] Duplicate patron sets dateenrolled incorrectly

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jul 27 15:43:16 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34117

--- Comment #13 from Emily Lamancusa <emily.lamancusa at montgomerycountymd.gov> ---
Created attachment 153977
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153977&action=edit
Bug 34117: Remove side effect from get_expiry_date

If get_expiry_date is passed a DateTime object as a parameter,
it modifies and returns the original object. When memberentry.pl
prefills the input fields for duplicating a patron, it passes the
enrollment date object to get_expiry_date. This causes the enrollment
date object to be modified with the expiry date value.

This patch modifies get_expiry_date to clone the DateTime object that it
receives as a parameter and return the clone, so that references to an
enrollment date object can be passed in safely.

To test:
1. Have or make a patron
2. Duplicate that patron
3. Before saving the new patron, scroll down to Registration Date and
   see that it's defaulting to a date in the future.
4. Apply patch and restart_all
5. Try duplicating a patron again
6. Registration Date should correctly set to today

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list