Summary: | get_password_expiry_date should not modify its parameter | ||
---|---|---|---|
Product: | Koha | Reporter: | Emily Lamancusa (emlam) <emily.lamancusa> |
Component: | Patrons | Assignee: | Emily Lamancusa (emlam) <emily.lamancusa> |
Status: | RESOLVED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | fridolin.somers, gmcharlt, kyle.m.hall, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.11.00,23.05.03,22.11.09
|
|
Circulation function: | |||
Bug Depends on: | 34117 | ||
Bug Blocks: | |||
Attachments: |
Bug 34435: Add unit test
Bug 34435: Remove side effect from get_password_expiry_date Bug 34435: Add unit test Bug 34435: Remove side effect from get_password_expiry_date Bug 34435: Add unit test Bug 34435: Remove side effect from get_password_expiry_date |
Description
Emily Lamancusa (emlam)
2023-07-27 15:09:32 UTC
Created attachment 153998 [details] [review] Bug 34435: Add unit test To test: prove t/db_dependent/Koha/Patron/Category.t Created attachment 153999 [details] [review] 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 Created attachment 154100 [details] [review] Bug 34435: Add unit test To test: prove t/db_dependent/Koha/Patron/Category.t Signed-off-by: Sam Lau <samalau@gmail.com> Created attachment 154101 [details] [review] 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> Created attachment 154278 [details] [review] Bug 34435: Add unit test 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> Created attachment 154279 [details] [review] 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> Now that dependency bug 34117 is passed QA, this one can be too IIUC. Works (tests before implementation made it easy to check [U+1F44D]), makes sense, QA script happy, code looks good, passing QA :) Pushed to master for 23.11. Nice work everyone, thanks! Pushed to 23.05.x for 23.05.03 Nice work everyone! Pushed to 22.11.x for next release |