[Bug 41073] New: Import users expiry date default does not apply
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Bug ID: 41073 Summary: Import users expiry date default does not apply Initiative type: --- Sponsorship --- status: Product: Koha Version: 24.11 Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: bernard.scaife@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com You can no longer set an expiry date into the past. Test file: userid,cardnumber,branchcode,categorycode,surname "12345","65432","LONDON","STANDARD","Smith" 1. User should exist and have expiry date in future (say 2099-12-31) 2. Save above as file 3. Tools > Import users 4. Choose file saved in 2 5. Field to use for record matching: cardnumber 6. In default values set expiration date to a date in past (say 2025-10-19) using date picker 7. Select overwrite the existing one with this 8. Leave renew existing patrons as "use the expiration date in the file if present" 9. Run 10. Observe user expiry date is still 2099-12-31 NB/ Tested in 23.11.10 where the date was correctly set to the default value chosen -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Bernard <bernard.scaife@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=34883 GIT URL| |https://github.com/Koha-Com | |munity/Koha/commit/f4f77357 | |f63013a21e700f14df82ca92614 | |03310 --- Comment #1 from Bernard <bernard.scaife@openfifth.co.uk> --- I think the problem occurs in Koha/Patrons/Import.pm at line 295-6 $borrower{$col} = $member->{$col} if $col eq 'dateexpiry' && ( !$csvkeycol{$col} || !$columns[ $csvkeycol{$col} ] ); The above evaluates to TRUE and resets the expiry date to its database value rather than the default that was set previously and has persisted until here. Hence it is not modified as requested. Note other default values (eg City) work fine. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 --- Comment #2 from Bernard <bernard.scaife@openfifth.co.uk> --- Created attachment 188976 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188976&action=edit Bug 41073 Brief Description: Fixes regression in which default expiry date is ignored due to regression fix in bug 34483 Test plan: 1. User should exist and have expiry date in future (say 2099-12-31) 2. Save above as file 3. Tools > Import users 4. Choose file saved in 2 5. Field to use for record matching: cardnumber 6. In default values set expiration date to a date in past (say 2025-10-19) using date picker 7. Select overwrite the existing one with this 8. Leave renew existing patrons as "use the expiration date in the file if present" 9. Run 10. Observe user expiry date is still 2099-12-31 11. Apply patch / restart_all 12. Repeat 4 - 9 above 13. Observe user expiry date is now 2025-10-19 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Bernard <bernard.scaife@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.blenkinsop@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 --- Comment #3 from Bernard <bernard.scaife@openfifth.co.uk> --- Created attachment 192148 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192148&action=edit Bug 41073: Fix default expiry date which is being ignored Fixes regression in which default expiry date is ignored due to regression introduced by fix for bug 34483. If default expiry date is completed in patron import tool, the value is ignored and expiry date unaltered. This patch fixes this error. Test plan: 1. User should exist and have expiry date in future (say 2099-12-31) 2. Save above as file 3. Tools > Import users 4. Choose file saved in 2 5. Field to use for record matching: cardnumber 6. In default values set expiration date to a date in past (say 2025-10-19) using date picker 7. Select overwrite the existing one with this 8. Leave renew existing patrons as "use the expiration date in the file if present" 9. Run 10. Observe user expiry date is still 2099-12-31 11. Apply patch / restart_all 12. Repeat 4 - 9 above 13. Observe user expiry date is now 2025-10-19 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ephetteplace@cca.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188976|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 --- Comment #4 from Eric Phetteplace <ephetteplace@cca.edu> --- Created attachment 193265 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193265&action=edit Bug 41073 Brief Description: Fixes regression in which default expiry date is ignored due to regression fix in bug 34483 Test plan: 1. User should exist and have expiry date in future (say 2099-12-31) 2. Save above as file 3. Tools > Import users 4. Choose file saved in 2 5. Field to use for record matching: cardnumber 6. In default values set expiration date to a date in past (say 2025-10-19) using date picker 7. Select overwrite the existing one with this 8. Leave renew existing patrons as "use the expiration date in the file if present" 9. Run 10. Observe user expiry date is still 2099-12-31 11. Apply patch / restart_all 12. Repeat 4 - 9 above 13. Observe user expiry date is now 2025-10-19 Signed-off-by: Eric Phetteplace <ephetteplace@cca.edu> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 --- Comment #5 from Eric Phetteplace <ephetteplace@cca.edu> --- There were duplicate patches and I signed off on the wrong one without the description. Fixing now. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193265|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192148|0 |1 is obsolete| | --- Comment #6 from Eric Phetteplace <ephetteplace@cca.edu> --- Created attachment 193266 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193266&action=edit Bug 41073: Fix default expiry date which is being ignored Fixes regression in which default expiry date is ignored due to regression introduced by fix for bug 34483. If default expiry date is completed in patron import tool, the value is ignored and expiry date unaltered. This patch fixes this error. Test plan: 1. User should exist and have expiry date in future (say 2099-12-31) 2. Save above as file 3. Tools > Import users 4. Choose file saved in 2 5. Field to use for record matching: cardnumber 6. In default values set expiration date to a date in past (say 2025-10-19) using date picker 7. Select overwrite the existing one with this 8. Leave renew existing patrons as "use the expiration date in the file if present" 9. Run 10. Observe user expiry date is still 2099-12-31 11. Apply patch / restart_all 12. Repeat 4 - 9 above 13. Observe user expiry date is now 2025-10-19 Signed-off-by: Eric Phetteplace <ephetteplace@cca.edu> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |bernard.scaife@openfifth.co |ity.org |.uk CC| |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- This code is not very trivial at the least ;) $borrower{$col} = $member->{$col} if $col eq 'dateexpiry' && ( !$csvkeycol{$col} || !$columns[ $csvkeycol{$col} ] ) && !$borrower{$col}; If there is no dateexpiry column in the csv or it is empty, in what case could borrower{dateexpiry} still have a value? Note that we are here in the situation that update_dateexpiry is false. $preserve_fields ?
From $defaults ? Right, and your test plan includes that one. It seems that preserve should be fine too.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- prove t/db_dependent/Koha/Patrons/Import.t t/db_dependent/Koha/Patrons/Import.t .. ok All tests successful. Files=1, Tests=181, 13 wallclock secs ( 0.07 usr 0.00 sys + 11.69 cusr 0.70 csys = 12.46 CPU) Result: PASS Thats still fine. Note that it also tells something about potential lack of coverage? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|nick@bywatersolutions.com |m.de.rooy@rijksmuseum.nl Patch complexity|--- |Small patch 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=41073 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193266|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 198152 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198152&action=edit Bug 41073: Fix default expiry date which is being ignored Fixes regression in which default expiry date is ignored due to regression introduced by fix for bug 34483. If default expiry date is completed in patron import tool, the value is ignored and expiry date unaltered. This patch fixes this error. Test plan: 1. User should exist and have expiry date in future (say 2099-12-31) 2. Save above as file 3. Tools > Import users 4. Choose file saved in 2 5. Field to use for record matching: cardnumber 6. In default values set expiration date to a date in past (say 2025-10-19) using date picker 7. Select overwrite the existing one with this 8. Leave renew existing patrons as "use the expiration date in the file if present" 9. Run 10. Observe user expiry date is still 2099-12-31 11. Apply patch / restart_all 12. Repeat 4 - 9 above 13. Observe user expiry date is now 2025-10-19 Signed-off-by: Eric Phetteplace <ephetteplace@cca.edu> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.05.00 |26.05.00,25.11.05 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41073 --- Comment #11 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org