[Bug 34435] New: get_password_expiry_date should not modify its parameter
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 Bug ID: 34435 Summary: get_password_expiry_date should not modify its parameter Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Patrons Assignee: emily.lamancusa@montgomerycountymd.gov Reporter: emily.lamancusa@montgomerycountymd.gov QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Depends on: 34117 If get_password_expiry_date is passed a DateTime object as a parameter, it modifies and returns the original object. Bug 34117 removed this side effect from get_expiry_date, so we should remove this side effect from get_password_expiry_date as well. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34117 [Bug 34117] Duplicate patron sets dateenrolled incorrectly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 --- Comment #1 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- Created attachment 153998 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153998&action=edit Bug 34435: Add unit test To test: prove t/db_dependent/Koha/Patron/Category.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 --- Comment #2 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- Created attachment 153999 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153999&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153998|0 |1 is obsolete| | --- Comment #3 from Sam Lau <samalau@gmail.com> --- Created attachment 154100 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154100&action=edit Bug 34435: Add unit test To test: prove t/db_dependent/Koha/Patron/Category.t Signed-off-by: Sam Lau <samalau@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153999|0 |1 is obsolete| | --- Comment #4 from Sam Lau <samalau@gmail.com> --- Created attachment 154101 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154101&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154100|0 |1 is obsolete| | Attachment #154101|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 154278 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154278&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 154279 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154279&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #7 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Now that dependency bug 34117 is passed QA, this one can be too IIUC. Works (tests before implementation made it easy to check 👍), makes sense, QA script happy, code looks good, passing QA :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to master |Pushed to stable Version(s)|23.11.00 |23.11.00,23.05.03 released in| | --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.11.00,23.05.03 |23.11.00,23.05.03,22.11.09 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34435 --- Comment #10 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Nice work everyone! Pushed to 22.11.x for next release -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org