[Koha-bugs] [Bug 33872] Duplicated patron's registration date is set to expiration date of template patron

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Jul 17 23:31:12 CEST 2023


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

Emily Lamancusa <emily.lamancusa at montgomerycountymd.gov> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |emily.lamancusa at montgomeryc
                   |                            |ountymd.gov

--- Comment #6 from Emily Lamancusa <emily.lamancusa at montgomerycountymd.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.

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


More information about the Koha-bugs mailing list