Koha/Koha/Patron
emlam dae5607fd1
Bug 34435: Remove side effect from get_password_expiry_date
If get_password_expiry_date is passed a DateTime object
as a parameter, it modifies and returns the original
object. This can create possible side effects.

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

To test:
prove t/db_dependent/Koha/Patron/Category.t

Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-08-15 12:17:04 +03:00
..
Attribute
Password
Restriction
Attribute.pm
Attributes.pm
Categories.pm
Category.pm Bug 34435: Remove side effect from get_password_expiry_date 2023-08-15 12:17:04 +03:00
Consent.pm
Consents.pm
Debarments.pm
Discharge.pm
Files.pm
HouseboundProfile.pm
HouseboundProfiles.pm
HouseboundRole.pm
HouseboundRoles.pm
HouseboundVisit.pm
HouseboundVisits.pm
Image.pm
Images.pm
Message.pm
Messages.pm
Modification.pm
Modifications.pm
Relationship.pm
Relationships.pm
Restriction.pm
Restrictions.pm