[Bug 34883] New: Regression in Patron Import dateexpiry function
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 Bug ID: 34883 Summary: Regression in Patron Import dateexpiry function Change sponsored?: --- Product: Koha Version: 22.11 Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: jake.deery@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Hello all, We are seeing issues in our import_patrons.pl which is causing issue for our academic customer base. In versions prior to 22.11, running import_patrons.pl would cause the dateexpiry to either: — get set based on the contents of the dateexpiry in the CSV file; or — get left as the value already in Koha This worked well for our academics, because they could opt when to update the dateexpiry rather than sending them over every night (e.g. if a student exited a course early, they could be expired in the LMS to prevent them from accessing the services). In 22.11, the update-expiration and expiration-from-today flags have been added to the script. I believe the logic behind these flags is to update the dateexpiry based on enrolment plus user category duration, or today plus user category duration. This probably works great for most libraries, but it isn't necessarily desirable for Colleges. The option still exists to set dateexpiry from the CSV, by not passing the aforementioned flags. However, the dateexpiry now gets set to the following, when using this: — get set based on the contents of the dateexpiry in the CSV file; or — get left as the value already in Koha As you can see, this is a clear regression. Could we please look to remediate this, so I can pass on some good news to our affected customers? Many thanks, Jake Deery PTFS Europe -- 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=34883 --- Comment #1 from Jake Deery <jake.deery@ptfs-europe.com> ---
The option still exists to set dateexpiry from the CSV, by not passing the aforementioned flags. However, the dateexpiry now gets set to the following, when using this: — get set based on the contents of the dateexpiry in the CSV file; or — get left as the value already in Koha
Apologies, I meant to say that the regressed behaviour is as follows: — get set based on the contents of the dateexpiry in the CSV file; or — gets nulled out, essentially setting a patron as never expired -- 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=34883 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27920 CC| |martin.renvoize@ptfs-europe | |.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27920 [Bug 27920] Add ability to update patron expiration dates when importing patrons -- 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=34883 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This will undoubtedly be a side effect of bug 27920. -- 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=34883 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |matt.blenkinsop@ptfs-europe |ity.org |.com CC| |matt.blenkinsop@ptfs-europe | |.com -- 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=34883 --- Comment #3 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 156149 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156149&action=edit Bug 34883: Stop patron expiry date being set to NULL during import A regression has been identified whereby an empty field in the dateexpiry field in a patron import file will cause the patron's expiry date to be set to NULL. This patch addresses this by checking for an empty field and using the existing expiry date if one is found. Test plan: 1) Setup a csv with column headers: surname firstname branchcode categorycode cardnumber dateenrolled dateexpiry 2) Add values: Acosta Edna CPL PT 23529001000463 02/01/2013 3) Leave the dateexpiry column blank 4) Check Edna and make a note of her patron expiry date 5) Run the import_patrons.pl script with the following flags: a) --file <filepath_for_your_csv_file> b) --matchpoint cardnumber c) --confirm d) --overwrite 6) Check Edna, note her expiry date is now set to NULL 7) Manually edit Edna's expiry date to be reset to what it was before you ran the script 8) Apply the patch and restart_all 9) Repeat step 5 10) Check Edna, this time her expiry date should be the same as the value you set it to in step 7 11) Sign off! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 David Nind <david@davidnind.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=34883 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156149|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 156196 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156196&action=edit Bug 34883: Stop patron expiry date being set to NULL during import A regression has been identified whereby an empty field in the dateexpiry field in a patron import file will cause the patron's expiry date to be set to NULL. This patch addresses this by checking for an empty field and using the existing expiry date if one is found. Test plan: 1) Setup a csv with column headers: surname firstname branchcode categorycode cardnumber dateenrolled dateexpiry 2) Add values: Acosta Edna CPL PT 23529001000463 02/01/2013 3) Leave the dateexpiry column blank 4) Check Edna and make a note of her patron expiry date 5) Run the import_patrons.pl script with the following flags: a) --file <filepath_for_your_csv_file> b) --matchpoint cardnumber c) --confirm d) --overwrite 6) Check Edna, note her expiry date is now set to NULL 7) Manually edit Edna's expiry date to be reset to what it was before you ran the script 8) Apply the patch and restart_all 9) Repeat step 5 10) Check Edna, this time her expiry date should be the same as the value you set it to in step 7 11) Sign off! Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 156197 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156197&action=edit Sample patron import file - Bug 34883 Testing notes (using KTD): 1. I've added the CSV file I used for testing (rename and save into /kohadevbox/koha using whatever file name you want). 2. Command: misc/import_patrons.pl --file /kohadevbox/koha/whatever-you-called-me.csv --matchpoint cardnumber --confirm --overwrite -v -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |m.de.rooy@rijksmuseum.nl --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Looks good to me. But could you add a small test that will stop future regressions on this topic? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 --- Comment #7 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 156368 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156368&action=edit Bug 34883: Add unit test prove -v t/db_dependent/Koha/Patrons/Import.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 --- Comment #8 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Good call, have added a new test to try and prevent regressions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=34883 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156196|0 |1 is obsolete| | Attachment #156368|0 |1 is obsolete| | --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 156369 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156369&action=edit Bug 34883: Stop patron expiry date being set to NULL during import A regression has been identified whereby an empty field in the dateexpiry field in a patron import file will cause the patron's expiry date to be set to NULL. This patch addresses this by checking for an empty field and using the existing expiry date if one is found. Test plan: 1) Setup a csv with column headers: surname firstname branchcode categorycode cardnumber dateenrolled dateexpiry 2) Add values: Acosta Edna CPL PT 23529001000463 02/01/2013 3) Leave the dateexpiry column blank 4) Check Edna and make a note of her patron expiry date 5) Run the import_patrons.pl script with the following flags: a) --file <filepath_for_your_csv_file> b) --matchpoint cardnumber c) --confirm d) --overwrite 6) Check Edna, note her expiry date is now set to NULL 7) Manually edit Edna's expiry date to be reset to what it was before you ran the script 8) Apply the patch and restart_all 9) Repeat step 5 10) Check Edna, this time her expiry date should be the same as the value you set it to in step 7 11) Sign off! Signed-off-by: David Nind <david@davidnind.com> 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=34883 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 156370 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156370&action=edit Bug 34883: Add unit test prove -v t/db_dependent/Koha/Patrons/Import.t 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=34883 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=34883 --- Comment #11 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=34883 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|23.11.00 |23.11.00,23.05.05 released in| | --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00,23.05.05 |23.11.00,23.05.05,22.11.11 released in| | Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 --- Comment #13 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=34621 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34883 Bernard <bernard.scaife@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=41073 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org