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

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jul 18 17:20:58 CEST 2023


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

--- Comment #8 from Emily Lamancusa <emily.lamancusa at montgomerycountymd.gov> ---
(In reply to Jonathan Druart from comment #7)
> Sorry, I haven't seen Emily's comment!
> 
> There is something weird here as well:
> 105 sub get_expiry_date {
> 109         $date = dt_from_string( $date ) unless ref $date;
> 
> Which means get_expiry_date should deal with DateTime object correctly.

Line 109 keeps the original object if one was passed, and creates a new object
if a string was passed, right? And then in the next line...

110 return $date->add( months => $self->enrolmentperiod, end_of_month =>
'limit' );

According to https://metacpan.org/pod/DateTime#Math-Methods:
"Like the set methods, math related methods always return the object itself, to
allow for chaining"

So unless I'm misunderstanding the Perl from line 109, if get_expiry_date is
passed an object, it updates and returns that same object, which memberentry.pl
doesn't take into account in line 725:
$data{dateexpiry} = $category->get_expiry_date( $data{dateenrolled} );

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


More information about the Koha-bugs mailing list