[Bug 23260] New: Anonymize (remove) patron data from items_last_borrower
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Bug ID: 23260 Summary: Anonymize (remove) patron data from items_last_borrower Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: joy@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz Increase level of patron privacy by removing patron information from the items_last_borrower table after a set period of time. Adjust the batch_anonymize cronjob to also remove data from the items_last_borrower table when the data is more than x days old (runtime option) but not if the item is lost, damaged, or withdrawn. -- 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=23260 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |agustinmoyano@theke.io |ity.org | -- 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=23260 Lisette Scheer <lisetteslatah@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cbrannon@cdalibrary.org --- Comment #1 from Lisette Scheer <lisetteslatah@gmail.com> --- *** Bug 23500 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #2 from Christopher Brannon <cbrannon@cdalibrary.org> --- +1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch 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=23260 --- Comment #3 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 92863 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92863&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #4 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 92864 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92864&action=edit Bug 23260: Add anonymize items_last_borrower feature This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a cron job. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 5) In mysql, update created_on date to one day earlier. 6) set AnonymousPatron preference to a valid patron id 7) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 4 and 5 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |liz@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Maryse Simard <maryse.simard@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #92864|0 |1 is obsolete| | --- Comment #5 from Maryse Simard <maryse.simard@inlibro.com> --- Created attachment 93052 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93052&action=edit Bug 23260: Add anonymize items_last_borrower feature This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a cron job. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 5) In mysql, update created_on date to one day earlier. 6) set AnonymousPatron preference to a valid patron id 7) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 4 and 5 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Maryse Simard <maryse.simard@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |maryse.simard@inlibro.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Comment on attachment 93052 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93052 Bug 23260: Add anonymize items_last_borrower feature Review of attachment 93052: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=23260&attachment=93052) ----------------------------------------------------------------- Minor typo, otherwise this looks reasonable. ::: misc/cronjobs/batch_anonymise.pl @@ +73,4 @@
my ($year,$month,$day) = Today(); my ($newyear,$newmonth,$newday) = Add_Delta_Days ($year,$month,$day,(-1)*$days); my $formatdate = sprintf "%4d-%02d-%02d",$newyear,$newmonth,$newday; +$verbose and print "Checkouts and items las borrowers before $formatdate will be anonymised.\n";
las -> last -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #92863|0 |1 is obsolete| | Attachment #93052|0 |1 is obsolete| | --- Comment #7 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 94858 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94858&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #8 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 94859 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94859&action=edit Bug 23260: Add anonymize items_last_borrower feature This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a cron job. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 5) In mysql, update created_on date to one day earlier. 6) set AnonymousPatron preference to a valid patron id 7) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 4 and 5 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #9 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Martin Renvoize from comment #6)
Comment on attachment 93052 [details] [review] Bug 23260: Add anonymize items_last_borrower feature
Review of attachment 93052 [details] [review]: -----------------------------------------------------------------
Minor typo, otherwise this looks reasonable.
::: misc/cronjobs/batch_anonymise.pl @@ +73,4 @@
my ($year,$month,$day) = Today(); my ($newyear,$newmonth,$newday) = Add_Delta_Days ($year,$month,$day,(-1)*$days); my $formatdate = sprintf "%4d-%02d-%02d",$newyear,$newmonth,$newday; +$verbose and print "Checkouts and items las borrowers before $formatdate will be anonymised.\n";
las -> last
Fixed typo, and rebased -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |BLOCKED --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QAing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Failed QA --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Hi Augustin, I would like to see you optimize a bit. for => $table_to_anonymize Both anonymize and anonymise are correct and in use, but you mix them on this report (no blocker, just seeing it). The z spelling is American. But I do not really understand why you put the patron select in search_patrons_to_anonymise. Why not leave this sub alone? We could directly call anonymise_items_last_borrower, since you are not really interested in the patrons here. And optimize it rightaway. Make the query in the new sub, and run update on that result set without looping with next? Thanks. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 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=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #12 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 95033 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95033&action=edit Bug 23260: (follow-up) optimize anonymise_items_last_borrower -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Thx for continuing here, Augustin. Just wondering what happens here: - subtest 'Logged in librarian is not superlibrarian & IndependentBranches' => sub { Why remove another subtest?? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #14 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Marcel de Rooy from comment #13)
Thx for continuing here, Augustin.
Just wondering what happens here: - subtest 'Logged in librarian is not superlibrarian & IndependentBranches' => sub {
Why remove another subtest??
Hi Marcel, now that we don't search the patron to anonymise, this test has no sense.. We can no longer check the library of the borrower in case IndependentBranches preference is set on. Thanks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #94858|0 |1 is obsolete| | Attachment #94859|0 |1 is obsolete| | Attachment #95033|0 |1 is obsolete| | --- Comment #15 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 95457 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95457&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable Sponsored-by: Northeast Kansas Library System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #16 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 95458 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95458&action=edit Bug 23260: Add anonymize items_last_borrower feature This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a cron job. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 5) In mysql, update created_on date to one day earlier. 6) set AnonymousPatron preference to a valid patron id 7) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 4 and 5 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Sponsored-by: Northeast Kansas Library System Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #17 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 95459 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95459&action=edit Bug 23260: (follow-up) optimize anonymise_items_last_borrower Sponsored-by: Northeast Kansas Library System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #18 from Christopher Brannon <cbrannon@cdalibrary.org> --- (In reply to Maryse Simard from comment #5)
Created attachment 93052 [details] [review] Bug 23260: Add anonymize items_last_borrower feature
This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a cron job.
To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 5) In mysql, update created_on date to one day earlier. 6) set AnonymousPatron preference to a valid patron id 7) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 4 and 5 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Your test plan has me concerned. If you must first set the feature to allow (#3), which is what Koha currently does without this feature, it sounds like this feature is not on by default. Is that true? It should retain the current behavior of Koha by default. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #19 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Christopher Brannon from comment #18)
(In reply to Maryse Simard from comment #5)
Created attachment 93052 [details] [review] [review] Bug 23260: Add anonymize items_last_borrower feature
This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a cron job.
To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 5) In mysql, update created_on date to one day earlier. 6) set AnonymousPatron preference to a valid patron id 7) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 4 and 5 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Your test plan has me concerned. If you must first set the feature to allow (#3), which is what Koha currently does without this feature, it sounds like this feature is not on by default. Is that true? It should retain the current behavior of Koha by default.
Hi Christopher, thanks for checking this out. This bug does not touch the StoreLastBorrower's default value (I had to change it in my koha-testing-docker, so I asumed it came off by default).. It's just to make sure that preference is set to Allow for the test to succeed. Sorry if I didn't make this test plan clear. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Maryse Simard <maryse.simard@inlibro.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=23260 Maryse Simard <maryse.simard@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95459|0 |1 is obsolete| | --- Comment #20 from Maryse Simard <maryse.simard@inlibro.com> --- Created attachment 95460 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95460&action=edit Bug 23260: (follow-up) optimize anonymise_items_last_borrower Sponsored-by: Northeast Kansas Library System Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |BLOCKED --- Comment #21 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- ReQAing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #22 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 95651 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95651&action=edit Bug 23260: (QA follow-up) Use ->update instead of ->next Also moves initialization of $anonymous_patron closer to associated comment lines. And removes the unneeded changes from Koha::Patrons. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Failed QA --- Comment #23 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Two things left, after the follow-up: We need an adjusted dbrev: `created_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), That is an updated_on ! So we should remove the ON UPDATE. This made me add the nb_rows comment. A count after the update would be affected by the updated timestamp. my $before = $now + DateTime::Duration->new( days => 1 ); That does not look good. Use add_days or something like that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #24 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Hmm sub last_returned_by { my ( $self, $borrower ) = @_; my $items_last_returned_by_rs = Koha::Database->new()->schema()->resultset('ItemsLastBorrower'); Not so nice in Koha::Item. (Possibly out of scope though) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #25 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- $items_last_returned_by_rs->update_or_create( { borrowernumber => $borrower->borrowernumber, itemnumber => $self->id } ); So it might be better to KEEP the UPDATE clause but RENAME the field. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95457|0 |1 is obsolete| | Attachment #95458|0 |1 is obsolete| | Attachment #95460|0 |1 is obsolete| | Attachment #95651|0 |1 is obsolete| | --- Comment #26 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 95698 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95698&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable Sponsored-by: Northeast Kansas Library System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #27 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 95699 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95699&action=edit Bug 23260: Add anonymize items_last_borrower feature This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a cron job. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 5) In mysql, update created_on date to one day earlier. 6) set AnonymousPatron preference to a valid patron id 7) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 4 and 5 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Sponsored-by: Northeast Kansas Library System Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #28 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 95700 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95700&action=edit Bug 23260: (follow-up) optimize anonymise_items_last_borrower Sponsored-by: Northeast Kansas Library System Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #29 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 95701 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95701&action=edit Bug 23260: (QA follow-up) Use ->update instead of ->next Also moves initialization of $anonymous_patron closer to associated comment lines. And removes the unneeded changes from Koha::Patrons. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #30 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Marcel de Rooy from comment #23)
my $before = $now + DateTime::Duration->new( days => 1 ); That does not look good. Use add_days or something like that.
Hi Marcel, I've updated the test code to use my $before = DateTime->now->add( days => 1 ); It certainly looks nicer now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #31 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Marcel de Rooy from comment #24)
Hmm
sub last_returned_by { my ( $self, $borrower ) = @_;
my $items_last_returned_by_rs = Koha::Database->new()->schema()->resultset('ItemsLastBorrower');
Not so nice in Koha::Item. (Possibly out of scope though)
This was introduced in Bug 14945. Do you want me to change it to use Items::LastPatrons class? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #32 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Marcel de Rooy from comment #25)
$items_last_returned_by_rs->update_or_create( { borrowernumber => $borrower->borrowernumber, itemnumber => $self->id } );
So it might be better to KEEP the UPDATE clause but RENAME the field.
I agree that the created_on column should be renamed to updated_on, or maybe we should have both columns, but I believe this should be done in a separate bug.. we have to analyze the impact of such a change Thanks for QAing! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #33 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Marcel, your patch introduces the use of ->update. Given the problems about it raised on bug 21761, could you resubmit it without using ->update? Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #34 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #33)
Marcel, your patch introduces the use of ->update. Given the problems about it raised on bug 21761, could you resubmit it without using ->update? Thanks!
Ah, you are right about that ;) In this case it is a bit theoretical argument, since LastBorrower only contains three fields and has no individual store sub. So replacing the while..next was just regular optimization. I do not mind setting back the while loop, although personally I would be inclined to wait on the outcome of the discussion before removing all updates. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #35 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Agustín Moyano from comment #31)
(In reply to Marcel de Rooy from comment #24)
Hmm
sub last_returned_by { my ( $self, $borrower ) = @_;
my $items_last_returned_by_rs = Koha::Database->new()->schema()->resultset('ItemsLastBorrower');
Not so nice in Koha::Item. (Possibly out of scope though)
This was introduced in Bug 14945.
Do you want me to change it to use Items::LastPatrons class?
Another report? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24092 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24092 [Bug 24092] Change Koha::Item to use Items::LastPatrons instead of ItemLastBorrower resultset -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #36 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Marcel de Rooy from comment #35)
(In reply to Agustín Moyano from comment #31)
(In reply to Marcel de Rooy from comment #24)
Hmm
sub last_returned_by { my ( $self, $borrower ) = @_;
my $items_last_returned_by_rs = Koha::Database->new()->schema()->resultset('ItemsLastBorrower');
Not so nice in Koha::Item. (Possibly out of scope though)
This was introduced in Bug 14945.
Do you want me to change it to use Items::LastPatrons class?
Another report?
Agreed, I created bug 24092 to address this issue. Changing this bug to SO again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #37 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #34)
(In reply to Tomás Cohen Arazi from comment #33)
Marcel, your patch introduces the use of ->update. Given the problems about it raised on bug 21761, could you resubmit it without using ->update? Thanks!
Ah, you are right about that ;) In this case it is a bit theoretical argument, since LastBorrower only contains three fields and has no individual store sub. So replacing the while..next was just regular optimization. I do not mind setting back the while loop, although personally I would be inclined to wait on the outcome of the discussion before removing all updates.
Fair enough. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #38 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Agustín Moyano from comment #32)
I agree that the created_on column should be renamed to updated_on, or maybe we should have both columns, but I believe this should be done in a separate bug.. we have to analyze the impact of such a change
OK Separate bug. Please open it too. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=23260 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95698|0 |1 is obsolete| | --- Comment #39 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 95769 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95769&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable Sponsored-by: Northeast Kansas Library System 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=23260 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95699|0 |1 is obsolete| | --- Comment #40 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 95770 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95770&action=edit Bug 23260: Add anonymize items_last_borrower feature This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a cron job. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 5) In mysql, update created_on date to one day earlier. 6) set AnonymousPatron preference to a valid patron id 7) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 4 and 5 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Sponsored-by: Northeast Kansas Library System Signed-off-by: Maryse Simard <maryse.simard@inlibro.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=23260 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95700|0 |1 is obsolete| | --- Comment #41 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 95771 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95771&action=edit Bug 23260: (follow-up) optimize anonymise_items_last_borrower Sponsored-by: Northeast Kansas Library System Signed-off-by: Maryse Simard <maryse.simard@inlibro.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=23260 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95701|0 |1 is obsolete| | --- Comment #42 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 95772 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95772&action=edit Bug 23260: (QA follow-up) Use ->update instead of ->next Also moves initialization of $anonymous_patron closer to associated comment lines. And removes the unneeded changes from Koha::Patrons. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Please see comment34 on use of update method. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #43 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Why $class->_resultset->search instead of $self->search? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #44 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Also, I find Koha::Item::LastPatrons->anonymise_items_last_borrower quite hard to read (its name, not its content) and guess what is suppose to do the method. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #45 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Basically I do not think this table deserves its own modules. We could handle that from Koha::Patron I'd say. I guess it's late now as it's PQA. Letting RM decide. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #46 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Jonathan Druart from comment #43)
Why $class->_resultset->search instead of $self->search?
I believe that's a question only you can reply (bug 16966 - https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60705&action=diff#a/Koha/Patrons.pm_sec1) ;P on a firt attempt, I copied what search_patron_to_anonymize does, but then in follow-up removed it from Patrons and placed it in LastPatrons without $class->_resultset->search. Cheers. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #47 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Agustín Moyano from comment #46)
(In reply to Jonathan Druart from comment #43)
Why $class->_resultset->search instead of $self->search?
I believe that's a question only you can reply (bug 16966 - https://bugs.koha-community.org/bugzilla3/attachment. cgi?id=60705&action=diff#a/Koha/Patrons.pm_sec1) ;P
on a firt attempt, I copied what search_patron_to_anonymize does, but then in follow-up removed it from Patrons and placed it in LastPatrons without $class->_resultset->search.
Heh ok, fair enough. I do not think it's correct (not incorrect either). We should return $class->search(), as you did then! I am still not happy with that new module. I do not think it really makes sense. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #48 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- FYI On bug 24152 I provide a flexible way to remove Koha::Object-based objects depending on date range. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #49 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |ASSIGNED CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> 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=23260 Martin Renvoize <martin.renvoize@ptfs-europe.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=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> 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=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.05.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=23260 --- Comment #50 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- OK, this isn't pushed.. my mistake on updating the bug prematurely.. had too many tabs open.. Moving onto this one now and having a read as that recent comments make it sound contentious. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Patch doesn't apply --- Comment #51 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- error: sha1 information is lacking or useless (Koha/Patrons.pm). error: could not build fake ancestor Patch failed at 0001 Bug 23260: (follow-up) optimize anonymise_items_last_borrower -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #52 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- OK, the patch doesn't apply currently, SHA1 errors. However, I think I agree with Jonathan here, I'm not sure there's a requirement at all for introducing a Koha::Item::LastPatron object.. we have a nice method in Koha::Item for returning a Koha::Patron object for the last_borrower. I think we can simply inline the search and removal here rather than adding a new class. Finally.. as for the 'update' debate.. personally I think we should ban update calls as a direct passthrough in Koha::Objects but allow the manual "I know what I'm doing" reach inside _resultset version. So, I would encourage _resultset->update() as the format for that particular case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #53 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 96791 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96791&action=edit Bug 23260: [ALTERNATIVE] Inline code to anonymise_issue_history This alternative patch reduces the complexity of the change by simply updateing the existing anonymise_issue_history method to include anonymisation of the items_last_borrowers table. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #54 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- OK, I've gone into 'golf mode' and submitted an alternative patch which I feel accomplishes the same result but in a significantly reduced amount of clear code. I'd still be interested in a squashed patch for the original 4 commit submission as I struggled to fully asses it given I could not apply... but I'd also be very interested in peoples opinions regarding my alternative approach.. (It would obviously fail qa as it stands as it requires some additional tests adding to cover the change) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #55 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Martin, your alternative approach looks good to me! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #56 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I talked to Agustín this weekend and he was surprised as he was sure he implemented what Jonathan requested. I agree he should've squashed the patches, though. He was sure he removed the introduced classes I like the alternative, but would prefer to hear from Agustin first when he's back and maybe he can adjust the details. Also, we should find some criteria for when doing what we do everywhere is ok, and when improving the codebase is a requirement. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95769|0 |1 is obsolete| | Attachment #95770|0 |1 is obsolete| | Attachment #95771|0 |1 is obsolete| | Attachment #95772|0 |1 is obsolete| | Attachment #96791|0 |1 is obsolete| | --- Comment #57 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 97841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97841&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable Sponsored-by: Northeast Kansas Library System 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=23260 --- Comment #58 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 97842 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97842&action=edit Bug 23260: Inline code to anonymise_issue_history This alternative patch reduces the complexity of the change by simply updateing the existing anonymise_issue_history method to include anonymisation of the items_last_borrowers table. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 5 and 6 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #59 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Agustín Moyano from comment #58)
Created attachment 97842 [details] [review] Bug 23260: Inline code to anonymise_issue_history
This alternative patch reduces the complexity of the change by simply updateing the existing anonymise_issue_history method to include anonymisation of the items_last_borrowers table.
To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 5 and 6 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off
Agustin, If you agree with this patch, please test and sign off. I could do the last step of QA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |RM_priority -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97842|0 |1 is obsolete| | --- Comment #60 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 98044 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98044&action=edit Bug 23260: Inline code to anonymise_issue_history This alternative patch reduces the complexity of the change by simply updateing the existing anonymise_issue_history method to include anonymisation of the items_last_borrowers table. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 5 and 6 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> 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=23260 --- Comment #61 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 98053 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98053&action=edit Bug 23260: Simplify tests Use build_sample_item and build_object -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #62 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 98054 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98054&action=edit Bug 23260: Add a new test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #63 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Almost done but I think I found an issue, the method does no longer return the number of issues modified. I do not think we should sum the number of items_last_borrower updated. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #64 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #63)
Almost done but I think I found an issue, the method does no longer return the number of issues modified. I do not think we should sum the number of items_last_borrower updated.
I think your right.. looks like an oversight on my part when I first submitted the alternative approach. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #65 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 98064 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98064&action=edit Bug 23260: (follow-up) Remove last_borrower updates from issues count -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@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=23260 --- Comment #66 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Seems I forgot to reset the status when I added the followup.. ready for QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98054|0 |1 is obsolete| | --- Comment #67 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 98282 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98282&action=edit Bug 23260: Add a new test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #68 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Martin Renvoize from comment #66)
Seems I forgot to reset the status when I added the followup.. ready for QA
The test was not passing. I have updated it, as I think we are expecting 1 checkout to be anonymised here. Still not passing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98282|0 |1 is obsolete| | --- Comment #69 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 98349 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98349&action=edit Bug 23260: Add a new test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #70 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #68)
(In reply to Martin Renvoize from comment #66)
Seems I forgot to reset the status when I added the followup.. ready for QA
The test was not passing. I have updated it, as I think we are expecting 1 checkout to be anonymised here. Still not passing.
Forget that, I misread the code. We want 4 checkouts to be anonymised. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #71 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I see!!!! Right.. I totally missed that `but not if the item is lost, damaged, or withdrawn.` in the original request is different to how the existing anonymisation logic works. Personally (and I've checked with a few people now) I feel that the two locations this data is stored should be anonymised equally so they don't fall out of sync. As this is a change in a privacy feature I think we probably need to govern whether we filter out by item status based on a system preference to keep everyone happy. I'll add that as a followup now and update the test to correspond. Good catch Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #72 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Setting to Failed QA whilst I code the followup -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #73 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 98352 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98352&action=edit Bug 23260: Proposed preference driven filtering -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #74 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- When the option to store the last patron was introduced separately from the normal reading history feature, I was quite happy as it would allow us to keep that information, without necessarily keeping all the history. What libraries often ask for is to know the last person that checked out an item, in case they have missed damage on return (like it can happen in times of self checks). In my opinion, by synching those with no option to not delete both at the same time - we make the StoreLastPatron obsolete. We could always have used the other tables to retrieve the information, but it was added with a new table as a separate thing with the reasoning of avoiding automatic anonymization. See the bug description from the initial feature add (bug 14945): "Currently if the AnonymousPatron system preference is in use, all patron data is anonymized. Some libraries would like to be able to see the last patron who returned out an item ( in case of damage ) but still keep all other patrons anonymized." -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=9011, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=14945 --- Comment #75 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I guess what I was trying to say is that this was designed to fall out of sync with the other tables - so we should not break that use case and allow for separate treatment of both. Added see also the bugs with former discussion. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #76 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- OK.. at this point I'm totally confused as to why/how this dev request came about... The items_last_borrower table is only populated if you enable the `StoreLastBorrower` system preference and the original idea of that preference was to allow staff to keep a record of last_borrower separately from the checkout history, which may be anonymized, so that staff can refer back to who was the last borrower if they find a book is damaged and as such that can associate that damage with a patron. As such, I'm not sure I understand at all the reasoning behind wanting to remove it at the same time as the rest of the anonymisation and also why you would want to filter on the given item states, given that the idea of the original feature is that you're not likely to have set such a status until after in this case you would have deleted it. Is this actually just a misunderstanding of the original feature in question I wonder? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=24576 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|RM_priority | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 George Williams (NEKLS) <george@nekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |george@nekls.org --- Comment #77 from George Williams (NEKLS) <george@nekls.org> --- NEKLS is sponsoring the development of this cronjob. Currently we have StoreLastBorrower turned on because we want the last borrower information stored if patron privacy is anonymized. We also have a cron running that prunes old_issues more than 400 days old so that all patron data is effectively anonymized after about 13 months. But we are not pruning items_last_borrower because staff at many of our libraries want the last borrower information saved on the item record if the item was lost. This means that we are currently anonymizing patron data in old_issues after it's 400 days old and never anonymizing that same data in items_last_borrower for the sake of the libraries that want that data saved for lost items. So for us the point of this cronjob is to prune items_last_borrower once the data is more than 400 days old which is in line with the other pruning we're already doing but it will make an exception if the item has a lost status. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #78 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi George, I think an option to clean it is not in question, I just think we should not tie it to the same 'switch' - so libraries can make the decision to delete both tables after a different number of days. This change as proposed currently would not only affect the cronjob. The method changed is used in different areas: - batch_anonymise.pl cronjob - When using the batch anonymize feature tool in the staff interface - When a patron decides to delete their reading history from the OPAC (OpacPrivacy etc.) So if I know I just returned a damaged book via the self check... I could delete my reading history from the OPAC. Info might still be retrievable somewhere, but I feel StoreLastPatron should be covering that use case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #79 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I've run out of steam for this at this point I'm afraid. We've gone nearly full circle now.. to me this highlights the need for good RFC's as the first step. I'll try to revisit unless someone takes it back over. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #80 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Martin Renvoize from comment #79)
I've run out of steam for this at this point I'm afraid. We've gone nearly full circle now.. to me this highlights the need for good RFC's as the first step.
I'll try to revisit unless someone takes it back over.
I'll take ir again as soon as I can -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Agustín Moyano <agustinmoyano@theke.io> 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=23260 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97841|0 |1 is obsolete| | Attachment #98044|0 |1 is obsolete| | Attachment #98053|0 |1 is obsolete| | Attachment #98064|0 |1 is obsolete| | Attachment #98349|0 |1 is obsolete| | Attachment #98352|0 |1 is obsolete| | --- Comment #81 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 112734 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=112734&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable Sponsored-by: Northeast Kansas Library System 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=23260 --- Comment #82 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 112735 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=112735&action=edit Bug 23260: Inline code to anonymise_issue_history This alternative patch reduces the complexity of the change by simply updateing the existing anonymise_issue_history method to include anonymisation of the items_last_borrowers table. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 5 and 6 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #83 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 112736 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=112736&action=edit Bug 23260: Simplify tests Use build_sample_item and build_object -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #84 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 112737 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=112737&action=edit Bug 23260: (follow-up) Remove last_borrower updates from issues count -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #85 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 112738 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=112738&action=edit Bug 23260: Add a new test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #86 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 112739 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=112739&action=edit Bug 23260: Proposed preference driven filtering -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #87 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 112740 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=112740&action=edit Bug 23260: (follow-up) Add AnonymiseLastBorrower and AnonymiseLastBorrowerDays sysprefs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #88 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 112741 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=112741&action=edit Bug 23260: (follow-up) Update test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #89 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 112742 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=112742&action=edit Bug 23260: (follow-up) Add new cron job -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #90 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 112743 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=112743&action=edit Bug 23260: (follow-up) Add anonymise_last_borrowers method to Patrons.pm This patch adds the method anonymise_last_borrowers in Patrons.pm. To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymise_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymised yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days eralier. 9) set AnonymiseLastBorrower to 'Anonymise' and AnonymiseLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #91 from Agustín Moyano <agustinmoyano@theke.io> --- (In reply to Katrin Fischer from comment #78)
Hi George,
I think an option to clean it is not in question, I just think we should not tie it to the same 'switch' - so libraries can make the decision to delete both tables after a different number of days.
This change as proposed currently would not only affect the cronjob. The method changed is used in different areas:
- batch_anonymise.pl cronjob - When using the batch anonymize feature tool in the staff interface - When a patron decides to delete their reading history from the OPAC (OpacPrivacy etc.)
So if I know I just returned a damaged book via the self check... I could delete my reading history from the OPAC. Info might still be retrievable somewhere, but I feel StoreLastPatron should be covering that use case.
Hi Katrin, I've added a series of follow-ups that separates anonymization of checkouts from item's last borrower. I added a new cron job just for this, that's controlled by two sysprefs.. one to say if anonymizing item's last borrower is allowed and another to set how old it must be before it get's anonymized. Hope this is the one! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #112734|0 |1 is obsolete| | --- Comment #92 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 117974 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117974&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable Sponsored-by: Northeast Kansas Library System 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=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #112735|0 |1 is obsolete| | --- Comment #93 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 117975 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117975&action=edit Bug 23260: Inline code to anonymise_issue_history This alternative patch reduces the complexity of the change by simply updateing the existing anonymise_issue_history method to include anonymisation of the items_last_borrowers table. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 5 and 6 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #112736|0 |1 is obsolete| | --- Comment #94 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 117976 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117976&action=edit Bug 23260: Simplify tests Use build_sample_item and build_object -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #112737|0 |1 is obsolete| | --- Comment #95 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 117977 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117977&action=edit Bug 23260: (follow-up) Remove last_borrower updates from issues count -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #112738|0 |1 is obsolete| | --- Comment #96 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 117978 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117978&action=edit Bug 23260: Add a new test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #112739|0 |1 is obsolete| | --- Comment #97 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 117979 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117979&action=edit Bug 23260: Proposed preference driven filtering -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #112740|0 |1 is obsolete| | --- Comment #98 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 117980 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117980&action=edit Bug 23260: (follow-up) Add AnonymiseLastBorrower and AnonymiseLastBorrowerDays sysprefs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #112741|0 |1 is obsolete| | --- Comment #99 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 117981 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117981&action=edit Bug 23260: (follow-up) Update test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #112742|0 |1 is obsolete| | --- Comment #100 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 117982 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117982&action=edit Bug 23260: (follow-up) Add new cron job -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #112743|0 |1 is obsolete| | --- Comment #101 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 117983 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117983&action=edit Bug 23260: (follow-up) Add anonymise_last_borrowers method to Patrons.pm This patch adds the method anonymise_last_borrowers in Patrons.pm. To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymise_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymised yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days eralier. 9) set AnonymiseLastBorrower to 'Anonymise' and AnonymiseLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply --- Comment #102 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am sorry, this patch set no longer applies and I can't fix it: Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 23260: Make borrowernumber nullable in items_last_borrower Applying: Bug 23260: Inline code to anonymise_issue_history Applying: Bug 23260: Simplify tests Applying: Bug 23260: (follow-up) Remove last_borrower updates from issues count Applying: Bug 23260: Add a new test Applying: Bug 23260: Proposed preference driven filtering Applying: Bug 23260: (follow-up) Add AnonymiseLastBorrower and AnonymiseLastBorrowerDays sysprefs Applying: Bug 23260: (follow-up) Update test error: sha1 information is lacking or useless (t/db_dependent/Koha/Patrons.t). error: could not build fake ancestor Patch failed at 0001 Bug 23260: (follow-up) Update test The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-23260-follow-up-Update-test-oyzp2x.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117974|0 |1 is obsolete| | --- Comment #103 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 120522 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120522&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable Sponsored-by: Northeast Kansas Library System 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=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117975|0 |1 is obsolete| | --- Comment #104 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 120523 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120523&action=edit Bug 23260: Inline code to anonymise_issue_history This alternative patch reduces the complexity of the change by simply updateing the existing anonymise_issue_history method to include anonymisation of the items_last_borrowers table. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 5 and 6 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117976|0 |1 is obsolete| | --- Comment #105 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 120524 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120524&action=edit Bug 23260: Simplify tests Use build_sample_item and build_object -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117977|0 |1 is obsolete| | --- Comment #106 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 120525 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120525&action=edit Bug 23260: (follow-up) Remove last_borrower updates from issues count -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117978|0 |1 is obsolete| | --- Comment #107 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 120526 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120526&action=edit Bug 23260: Add a new test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117979|0 |1 is obsolete| | --- Comment #108 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 120527 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120527&action=edit Bug 23260: Proposed preference driven filtering -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117980|0 |1 is obsolete| | --- Comment #109 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 120528 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120528&action=edit Bug 23260: (follow-up) Add AnonymiseLastBorrower and AnonymiseLastBorrowerDays sysprefs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117981|0 |1 is obsolete| | --- Comment #110 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 120529 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120529&action=edit Bug 23260: (follow-up) Update test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117982|0 |1 is obsolete| | --- Comment #111 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 120530 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120530&action=edit Bug 23260: (follow-up) Add new cron job -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117983|0 |1 is obsolete| | --- Comment #112 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 120531 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120531&action=edit Bug 23260: (follow-up) Add anonymise_last_borrowers method to Patrons.pm This patch adds the method anonymise_last_borrowers in Patrons.pm. To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymise_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymised yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days eralier. 9) set AnonymiseLastBorrower to 'Anonymise' and AnonymiseLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com Status|Signed Off |Failed QA --- Comment #113 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- I'm getting a test failure at the end: root@kohadevbox:koha(master)$ prove t/db_dependent/Koha/Patrons.t t/db_dependent/Koha/Patrons.t .. 42/42 # Looks like you planned 42 tests but ran 43. t/db_dependent/Koha/Patrons.t .. Dubious, test returned 255 (wstat 65280, 0xff00) All 42 subtests passed Test Summary Report ------------------- t/db_dependent/Koha/Patrons.t (Wstat: 65280 Tests: 43 Failed: 1) Failed test: 43 Non-zero exit status: 255 Parse errors: Bad plan. You planned 42 tests but ran 43. Files=1, Tests=43, 31 wallclock secs ( 0.08 usr 0.01 sys + 23.30 cusr 5.08 csys = 28.47 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120522|0 |1 is obsolete| | --- Comment #114 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122963 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122963&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable Sponsored-by: Northeast Kansas Library System 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=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120523|0 |1 is obsolete| | --- Comment #115 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122964 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122964&action=edit Bug 23260: Inline code to anonymise_issue_history This alternative patch reduces the complexity of the change by simply updateing the existing anonymise_issue_history method to include anonymisation of the items_last_borrowers table. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 5 and 6 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120524|0 |1 is obsolete| | --- Comment #116 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122965 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122965&action=edit Bug 23260: Simplify tests Use build_sample_item and build_object -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120525|0 |1 is obsolete| | --- Comment #117 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122966 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122966&action=edit Bug 23260: (follow-up) Remove last_borrower updates from issues count -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120526|0 |1 is obsolete| | --- Comment #118 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122967 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122967&action=edit Bug 23260: Add a new test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120527|0 |1 is obsolete| | --- Comment #119 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122968 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122968&action=edit Bug 23260: Proposed preference driven filtering -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120528|0 |1 is obsolete| | --- Comment #120 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122969 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122969&action=edit Bug 23260: (follow-up) Add AnonymiseLastBorrower and AnonymiseLastBorrowerDays sysprefs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120529|0 |1 is obsolete| | --- Comment #121 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122970 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122970&action=edit Bug 23260: (follow-up) Update test Update test count -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120530|0 |1 is obsolete| | --- Comment #122 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122971 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122971&action=edit Bug 23260: (follow-up) Add new cron job -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120531|0 |1 is obsolete| | --- Comment #123 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122972 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122972&action=edit Bug 23260: (follow-up) Add anonymise_last_borrowers method to Patrons.pm This patch adds the method anonymise_last_borrowers in Patrons.pm. To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymise_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymised yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days eralier. 9) set AnonymiseLastBorrower to 'Anonymise' and AnonymiseLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 George Williams (NEKLS) <george@nekls.org> 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=23260 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122963|0 |1 is obsolete| | Attachment #122964|0 |1 is obsolete| | Attachment #122965|0 |1 is obsolete| | Attachment #122966|0 |1 is obsolete| | Attachment #122967|0 |1 is obsolete| | Attachment #122968|0 |1 is obsolete| | Attachment #122969|0 |1 is obsolete| | Attachment #122970|0 |1 is obsolete| | Attachment #122971|0 |1 is obsolete| | Attachment #122972|0 |1 is obsolete| | --- Comment #124 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145175 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145175&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable Sponsored-by: Northeast Kansas Library System 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=23260 --- Comment #125 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145176 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145176&action=edit Bug 23260: Inline code to anonymise_issue_history This alternative patch reduces the complexity of the change by simply updateing the existing anonymise_issue_history method to include anonymisation of the items_last_borrowers table. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 5 and 6 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #126 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145177 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145177&action=edit Bug 23260: Simplify tests Use build_sample_item and build_object -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #127 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145178 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145178&action=edit Bug 23260: (follow-up) Remove last_borrower updates from issues count -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #128 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145179 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145179&action=edit Bug 23260: Add a new test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #129 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145180 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145180&action=edit Bug 23260: Proposed preference driven filtering -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #130 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145181 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145181&action=edit Bug 23260: (follow-up) Add AnonymiseLastBorrower and AnonymiseLastBorrowerDays sysprefs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #131 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145182 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145182&action=edit Bug 23260: (follow-up) Update test Update test count -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #132 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145183 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145183&action=edit Bug 23260: (follow-up) Add new cron job -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #133 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 145184 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145184&action=edit Bug 23260: (follow-up) Add anonymise_last_borrowers method to Patrons.pm This patch adds the method anonymise_last_borrowers in Patrons.pm. To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymise_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymised yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days eralier. 9) set AnonymiseLastBorrower to 'Anonymise' and AnonymiseLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Laura.escamilla@bywatersolu | |tions.com Status|Needs Signoff |Patch doesn't apply --- Comment #134 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- error: sha1 information is lacking or useless (t/db_dependent/Koha/Patrons.t). error: could not build fake ancestor Patch failed at 0001 Bug 23260: (follow-up) Update test hint: Use 'git am --show-current-patch=diff' to see the failed patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #135 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Nick, could you please rebase? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145175|0 |1 is obsolete| | Attachment #145176|0 |1 is obsolete| | Attachment #145177|0 |1 is obsolete| | Attachment #145178|0 |1 is obsolete| | Attachment #145179|0 |1 is obsolete| | Attachment #145180|0 |1 is obsolete| | Attachment #145181|0 |1 is obsolete| | Attachment #145182|0 |1 is obsolete| | Attachment #145183|0 |1 is obsolete| | Attachment #145184|0 |1 is obsolete| | --- Comment #136 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157106 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157106&action=edit Bug 23260: Make borrowernumber nullable in items_last_borrower This patch alters table structure to make borrowernumber nullable Sponsored-by: Northeast Kansas Library System 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=23260 --- Comment #137 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157107 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157107&action=edit Bug 23260: Inline code to anonymise_issue_history This alternative patch reduces the complexity of the change by simply updateing the existing anonymise_issue_history method to include anonymisation of the items_last_borrowers table. To test: 1) apply this patch and the previous one 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 8) repeat steps 5 and 6 9) set AnonymousPatron preference to 0 10) perl misc/cronjobs/batch_anonymise.pl --days 1 SUCCESS => borrower number in items_last_borrower changed to null 11) prove t/db_dependent/Koha/Patrons.t 12) Sign off Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #138 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157108 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157108&action=edit Bug 23260: Simplify tests Use build_sample_item and build_object -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #139 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157109 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157109&action=edit Bug 23260: (follow-up) Remove last_borrower updates from issues count -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #140 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157110 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157110&action=edit Bug 23260: Add a new test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #141 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157111 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157111&action=edit Bug 23260: Proposed preference driven filtering -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #142 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157112 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157112&action=edit Bug 23260: (follow-up) Add AnonymiseLastBorrower and AnonymiseLastBorrowerDays sysprefs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #143 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157113 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157113&action=edit Bug 23260: (follow-up) Update test Update test count -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #144 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157114 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157114&action=edit Bug 23260: (follow-up) Add new cron job -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #145 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157115 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157115&action=edit Bug 23260: (follow-up) Add anonymise_last_borrowers method to Patrons.pm This patch adds the method anonymise_last_borrowers in Patrons.pm. To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymise_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymised yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days eralier. 9) set AnonymiseLastBorrower to 'Anonymise' and AnonymiseLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymise_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #146 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157116 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157116&action=edit Bug 23260: (follow-up) Tidy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #147 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Oi, so many rebases. Sorry we didn't get to this earlier. 1) Can you explain this part of the code please? + my $last_borrowers_to_anonymise = $patron->_result->items_last_borrowers->search( + { + ( + $older_than_date + ? ( created_on => { '<' => $dtf->format_datetime($older_than_date) } ) + : (), + "itemnumber.damaged" => 0, + "itemnumber.itemlost" => 0, + "itemnumber.withdrawn" => 0, + ), + }, + { join => ['itemnumber'] } + ); 2) Database updated needs to be reformatted to use the newer template. 3) Terminology / System preference naming Sorry to be nit-picky about this, but I believe we should stick to the standard terminology as per our coding guidelines: * Use AE instead of BE: Anonymise should be Anonymize * Borrower should be Patron AnonymiseLastBorrower => AnonymizeLastPatron AnonymiseLastBorrowerDays => AnonymizeLastPatronDelay/Days System preference descriptions need to be adapted as well. 4) Cronjob +use strict; +use warnings; --> should be Use Modern::Perl. 5) anonymise_issue_history appears to be unused? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157106|0 |1 is obsolete| | Attachment #157107|0 |1 is obsolete| | Attachment #157108|0 |1 is obsolete| | Attachment #157109|0 |1 is obsolete| | Attachment #157110|0 |1 is obsolete| | Attachment #157111|0 |1 is obsolete| | Attachment #157112|0 |1 is obsolete| | Attachment #157113|0 |1 is obsolete| | Attachment #157114|0 |1 is obsolete| | Attachment #157115|0 |1 is obsolete| | Attachment #157116|0 |1 is obsolete| | --- Comment #148 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 159291 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159291&action=edit Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays This patch alters the items_last_borrowers table to allow for NULL borrowers It also adds two new system preferences to allow controlling the anonymization of items_last_borrower data -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #149 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 159292 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159292&action=edit Bug 23260: Add anonymize_last_borrowers method to Patrons.pm This patch adds a new routine to allow anonymizing the items_last_borrower table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #150 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 159293 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159293&action=edit Bug 23260: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #151 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 159294 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159294&action=edit Bug 23260: Add cronjob anonymize_last_borrowers.pl This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a new cron job anonymize_last_borrowers.pl To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymize_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymized yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days earlier. 9) set AnonymizeLastBorrower to 'Anonymize' and AnonymizeLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #152 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #147)
Oi, so many rebases. Sorry we didn't get to this earlier.
1) Can you explain this part of the code please?
+ my $last_borrowers_to_anonymise = $patron->_result->items_last_borrowers->search( + { + ( + $older_than_date + ? ( created_on => { '<' => $dtf->format_datetime($older_than_date) } ) + : (), + "itemnumber.damaged" => 0, + "itemnumber.itemlost" => 0, + "itemnumber.withdrawn" => 0, + ), + }, + { join => ['itemnumber'] } + );
This fetches the items_last_borrower rows to anonymise, joining to the items table to avoid removing info from items that are no longer in circulation where the last borrower is likely to be responsible for that status
2) Database updated needs to be reformatted to use the newer template.
OK
3) Terminology / System preference naming
Sorry to be nit-picky about this, but I believe we should stick to the standard terminology as per our coding guidelines:
* Use AE instead of BE: Anonymise should be Anonymize * Borrower should be Patron
AnonymiseLastBorrower => AnonymizeLastPatron AnonymiseLastBorrowerDays => AnonymizeLastPatronDelay/Days
System preference descriptions need to be adapted as well.
changed 'ise' to 'ize' As the table is 'items_last_borrower' and we are referring to 'the patron that last borrowed' I think borrower actually makes more sense in this case
4) Cronjob
+use strict; +use warnings;
--> should be Use Modern::Perl.
OK
5) anonymise_issue_history appears to be unused?
It looks like this has been through multiple coders and revisions - all squashed - unused routine removed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|m.de.rooy@rijksmuseum.nl |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159291|0 |1 is obsolete| | --- Comment #153 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 159298 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159298&action=edit Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays This patch alters the items_last_borrowers table to allow for NULL borrowers It also adds two new system preferences to allow controlling the anonymization of items_last_borrower data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159292|0 |1 is obsolete| | --- Comment #154 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 159299 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159299&action=edit Bug 23260: Add anonymize_last_borrowers method to Patrons.pm This patch adds a new routine to allow anonymizing the items_last_borrower table Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159293|0 |1 is obsolete| | --- Comment #155 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 159300 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159300&action=edit Bug 23260: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159294|0 |1 is obsolete| | --- Comment #156 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 159301 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159301&action=edit Bug 23260: Add cronjob anonymize_last_borrowers.pl This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a new cron job anonymize_last_borrowers.pl To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymize_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymized yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days earlier. 9) set AnonymizeLastBorrower to 'Anonymize' and AnonymizeLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|martin.renvoize@ptfs-europe |testopia@bugs.koha-communit |.com |y.org --- Comment #157 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice clean rebase, all workings as described here now. Signing off and passing back for a final QA round. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize <martin.renvoize@ptfs-europe.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=23260 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@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=23260 Kyle M Hall <kyle@bywatersolutions.com> 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=23260 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #159298|0 |1 is obsolete| | Attachment #159299|0 |1 is obsolete| | Attachment #159300|0 |1 is obsolete| | Attachment #159301|0 |1 is obsolete| | --- Comment #158 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 164129 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164129&action=edit Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays This patch alters the items_last_borrowers table to allow for NULL borrowers It also adds two new system preferences to allow controlling the anonymization of items_last_borrower data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #159 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 164130 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164130&action=edit Bug 23260: Add anonymize_last_borrowers method to Patrons.pm This patch adds a new routine to allow anonymizing the items_last_borrower table Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #160 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 164131 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164131&action=edit Bug 23260: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #161 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 164132 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164132&action=edit Bug 23260: Add cronjob anonymize_last_borrowers.pl This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a new cron job anonymize_last_borrowers.pl To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymize_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymized yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days earlier. 9) set AnonymizeLastBorrower to 'Anonymize' and AnonymizeLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #162 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 164133 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164133&action=edit Bug 23260: (QA follow-up) Tidy code Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #163 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think as this is going to remove/delete data and doesn't require any options in order to be run, it would be good to have a confirm flag on the script. What do you think? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Rebecca Coert <rcoert@arlingtonva.us> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rcoert@arlingtonva.us -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164129|0 |1 is obsolete| | --- Comment #164 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 182000 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182000&action=edit Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays This patch alters the items_last_borrowers table to allow for NULL borrowers It also adds two new system preferences to allow controlling the anonymization of items_last_borrower data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164130|0 |1 is obsolete| | --- Comment #165 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 182001 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182001&action=edit Bug 23260: Add anonymize_last_borrowers method to Patrons.pm This patch adds a new routine to allow anonymizing the items_last_borrower table Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164131|0 |1 is obsolete| | --- Comment #166 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 182002 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182002&action=edit Bug 23260: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164132|0 |1 is obsolete| | --- Comment #167 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 182003 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182003&action=edit Bug 23260: Add cronjob anonymize_last_borrowers.pl This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a new cron job anonymize_last_borrowers.pl To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymize_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymized yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days earlier. 9) set AnonymizeLastBorrower to 'Anonymize' and AnonymizeLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164133|0 |1 is obsolete| | --- Comment #168 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 182004 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182004&action=edit Bug 23260: (QA follow-up) Tidy code Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #169 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 182005 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182005&action=edit Bug 23260: Adjust the number of tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #170 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 182006 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182006&action=edit Bug 23260: Tidy Koha/Patrons.pm -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #171 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Attempting to revive this, patches rebased for current main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #172 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 182007 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182007&action=edit Bug 23260: Add a confirm flag To test the confirm flag: 1. Run perl misc/cronjobs/batch_anonymise.pl --days 1 2. Notice the warning about needing a confirm flag 3. Run perl misc/cronjobs/batch_anonymise.pl --days 1 --confirm 4. The script runs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lin Wei <lin-wei.li@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lin-wei.li@inLibro.com --- Comment #173 from Lin Wei <lin-wei.li@inLibro.com> --- # Test Results Unsure. I think the Test Plan mentions the wrong perl script to run: attachment 182007 shows a script different to the one mentionned in the Test Plan. Furthermore, the unit tests defined in `t/db_dependent/Koha/Patrons.t` currently fail in `main`. # Test Execution 1. Apply patch. 2. Set "AnonymousPatron" to "10101010." 3. Set "AnonymizeLastBorrower" and "AnonymizeLastBorrower" to "Anonymize" and "10". 3. Run `./misc/cronjobs/batch_anonymise.pl`. => Runs without asking for confirmation. 4. Run `./misc/cronjobs/anonymize_last_borrowers.pl`. => Asks for "--confirm" flag. 5. Run `./misc/cronjobs/anonymize_last_borrowers.pl --confirm`. => Runs. 6. Run `prove t/db_dependent/Koha/Patrons.t`. => Tests fail, see [Prove Output - Patch] below. 7. Reset via `git reset --hard origin/main; git pull`. 8. Run `prove t/db_dependent/Koha/Patrons.t`. => Tests fail, see [Prove Output - Main] below. # Conclusion - Test Plan is unclear: - Test Plan might contain typo. - Script that I think needs to be tested behaves as expected. - Attachment 182006 shows inconsequential change in code formatting (ok). - But 182005 adjusts unit tests that are difficult to verify because they also fail in `main`. - It seems that everything is likely behaving as expected but, due to the uncertainties mentionned above, I am leaving this patch as "Needs Signoff." # Prove Output - Patch prove t/db_dependent/Koha/Patrons.t t/db_dependent/Koha/Patrons.t .. 13/47 # Failed test 'Patron should have 2 overdues' # at t/db_dependent/Koha/Patrons.t line 862. # got: '3' # expected: '2' # Looks like you failed 1 test of 19. t/db_dependent/Koha/Patrons.t .. 16/47 # Failed test 'checkouts + pending_checkouts + overdues + old_checkouts' # at t/db_dependent/Koha/Patrons.t line 882. t/db_dependent/Koha/Patrons.t .. 46/47 # Failed test 'no warnings' # at /usr/local/share/perl/5.38.2/Test/Builder.pm line 187. # There were 3 warning(s) # Previous test 17 'The issue should be returned in the same order as they have been done, second is correct' # Use of uninitialized value $unit in string eq at /inlibro/git/koha-master-dev-linwei/C4/Overdues.pm line 352. # at /inlibro/git/koha-master-dev-linwei/C4/Overdues.pm line 352. # C4::Overdues::get_chargeable_units(undef, DateTime=HASH(0x59e5be8f57f8), DateTime=HASH(0x59e5be8d1b18), "zJnwJX") called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2830 # C4::Circulation::_calculate_new_debar_dt(Koha::Patron=HASH(0x59e5be7c50b0), Koha::Item=HASH(0x59e5be8bba30), DateTime=HASH(0x59e5be8f57f8), DateTime=HASH(0x59e5be8d1b18)) called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2893 # C4::Circulation::_debar_user_on_return(Koha::Patron=HASH(0x59e5be7c50b0), Koha::Item=HASH(0x59e5be8bba30), DateTime=HASH(0x59e5be8f57f8), DateTime=HASH(0x59e5be8d1b18)) called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2471 # C4::Circulation::AddReturn("F7WtNareKyJ_KO") called at t/db_dependent/Koha/Patrons.t line 873 # main::__ANON__() called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # eval {...} called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # Test::Builder::subtest(Test::Builder=HASH(0x59e5b3d98ff0), "checkouts + pending_checkouts + overdues + old_checkouts", CODE(0x59e5be47d6a8)) called at /usr/local/share/perl/5.38.2/Test/More.pm line 831 # Test::More::subtest("checkouts + pending_checkouts + overdues + old_checkouts", CODE(0x59e5be47d6a8)) called at t/db_dependent/Koha/Patrons.t line 882 # # ---------- # Previous test 17 'The issue should be returned in the same order as they have been done, second is correct' # Use of uninitialized value $unit in string eq at /inlibro/git/koha-master-dev-linwei/C4/Overdues.pm line 352. # at /inlibro/git/koha-master-dev-linwei/C4/Overdues.pm line 352. # C4::Overdues::get_chargeable_units(undef, DateTime=HASH(0x59e5be8bee00), DateTime=HASH(0x59e5be8dedf0), "zJnwJX") called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2830 # C4::Circulation::_calculate_new_debar_dt(Koha::Patron=HASH(0x59e5be8e6838), Koha::Item=HASH(0x59e5be8e6598), DateTime=HASH(0x59e5be8bee00), DateTime=HASH(0x59e5be8dedf0)) called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2893 # C4::Circulation::_debar_user_on_return(Koha::Patron=HASH(0x59e5be8e6838), Koha::Item=HASH(0x59e5be8e6598), DateTime=HASH(0x59e5be8bee00), DateTime=HASH(0x59e5be8dedf0)) called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2471 # C4::Circulation::AddReturn("DaXCuu4Lm6mqI") called at t/db_dependent/Koha/Patrons.t line 874 # main::__ANON__() called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # eval {...} called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # Test::Builder::subtest(Test::Builder=HASH(0x59e5b3d98ff0), "checkouts + pending_checkouts + overdues + old_checkouts", CODE(0x59e5be47d6a8)) called at /usr/local/share/perl/5.38.2/Test/More.pm line 831 # Test::More::subtest("checkouts + pending_checkouts + overdues + old_checkouts", CODE(0x59e5be47d6a8)) called at t/db_dependent/Koha/Patrons.t line 882 # # ---------- # Previous test 0 '' # Use of uninitialized value $unit in string eq at /inlibro/git/koha-master-dev-linwei/C4/Overdues.pm line 352. # at /inlibro/git/koha-master-dev-linwei/C4/Overdues.pm line 352. # C4::Overdues::get_chargeable_units(undef, DateTime=HASH(0x59e5be808390), DateTime=HASH(0x59e5be8f2fb8), "mxQDxyz8") called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2830 # C4::Circulation::_calculate_new_debar_dt(Koha::Patron=HASH(0x59e5be700268), Koha::Item=HASH(0x59e5be75cc50), DateTime=HASH(0x59e5be808390), DateTime=HASH(0x59e5be8f2fb8)) called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2893 # C4::Circulation::_debar_user_on_return(Koha::Patron=HASH(0x59e5be700268), Koha::Item=HASH(0x59e5be75cc50), DateTime=HASH(0x59e5be808390), DateTime=HASH(0x59e5be8f2fb8)) called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2471 # C4::Circulation::AddReturn("rgu6PRZrAlB", undef, undef, DateTime=HASH(0x59e5be8f2fb8)) called at t/db_dependent/Koha/Patrons.t line 1589 # main::__ANON__() called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # eval {...} called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # Test::Builder::subtest(Test::Builder=HASH(0x59e5b3d98ff0), "anonymize items_last_borrower by days", CODE(0x59e5be8f5660)) called at /usr/local/share/perl/5.38.2/Test/More.pm line 831 # Test::More::subtest("anonymize items_last_borrower by days", CODE(0x59e5be8f5660)) called at t/db_dependent/Koha/Patrons.t line 1612 # main::__ANON__() called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # eval {...} called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # Test::Builder::subtest(Test::Builder=HASH(0x59e5b3d98ff0), "anonymize items_last_borrower", CODE(0x59e5be47d6a8)) called at /usr/local/share/perl/5.38.2/Test/More.pm line 831 # Test::More::subtest("anonymize items_last_borrower", CODE(0x59e5be47d6a8)) called at t/db_dependent/Koha/Patrons.t line 1704 # # Looks like you failed 2 tests of 47. t/db_dependent/Koha/Patrons.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/47 subtests Test Summary Report ------------------- t/db_dependent/Koha/Patrons.t (Wstat: 512 (exited 2) Tests: 47 Failed: 2) Failed tests: 16, 47 Non-zero exit status: 2 Files=1, Tests=47, 27 wallclock secs ( 0.04 usr 0.01 sys + 18.53 cusr 2.86 csys = 21.44 CPU) Result: FAIL # Prove Output - Main prove t/db_dependent/Koha/Patrons.t t/db_dependent/Koha/Patrons.t .. 13/46 # Failed test 'Patron should have 2 overdues' # at t/db_dependent/Koha/Patrons.t line 862. # got: '3' # expected: '2' # Looks like you failed 1 test of 19. t/db_dependent/Koha/Patrons.t .. 16/46 # Failed test 'checkouts + pending_checkouts + overdues + old_checkouts' # at t/db_dependent/Koha/Patrons.t line 882. t/db_dependent/Koha/Patrons.t .. 44/46 # Failed test 'no warnings' # at /usr/local/share/perl/5.38.2/Test/Builder.pm line 187. # There were 2 warning(s) # Previous test 17 'The issue should be returned in the same order as they have been done, second is correct' # Use of uninitialized value $unit in string eq at /inlibro/git/koha-master-dev-linwei/C4/Overdues.pm line 352. # at /inlibro/git/koha-master-dev-linwei/C4/Overdues.pm line 352. # C4::Overdues::get_chargeable_units(undef, DateTime=HASH(0x5c5975d35c98), DateTime=HASH(0x5c5975d0eba0), "uNLwkz") called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2830 # C4::Circulation::_calculate_new_debar_dt(Koha::Patron=HASH(0x5c5975c01cb0), Koha::Item=HASH(0x5c5975c19cf0), DateTime=HASH(0x5c5975d35c98), DateTime=HASH(0x5c5975d0eba0)) called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2893 # C4::Circulation::_debar_user_on_return(Koha::Patron=HASH(0x5c5975c01cb0), Koha::Item=HASH(0x5c5975c19cf0), DateTime=HASH(0x5c5975d35c98), DateTime=HASH(0x5c5975d0eba0)) called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2471 # C4::Circulation::AddReturn("Z6bNQUnw8Q1_F") called at t/db_dependent/Koha/Patrons.t line 873 # main::__ANON__() called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # eval {...} called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # Test::Builder::subtest(Test::Builder=HASH(0x5c596b215960), "checkouts + pending_checkouts + overdues + old_checkouts", CODE(0x5c59758ad970)) called at /usr/local/share/perl/5.38.2/Test/More.pm line 831 # Test::More::subtest("checkouts + pending_checkouts + overdues + old_checkouts", CODE(0x5c59758ad970)) called at t/db_dependent/Koha/Patrons.t line 882 # # ---------- # Previous test 17 'The issue should be returned in the same order as they have been done, second is correct' # Use of uninitialized value $unit in string eq at /inlibro/git/koha-master-dev-linwei/C4/Overdues.pm line 352. # at /inlibro/git/koha-master-dev-linwei/C4/Overdues.pm line 352. # C4::Overdues::get_chargeable_units(undef, DateTime=HASH(0x5c5975d3be70), DateTime=HASH(0x5c5975d48620), "uNLwkz") called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2830 # C4::Circulation::_calculate_new_debar_dt(Koha::Patron=HASH(0x5c5975c7f748), Koha::Item=HASH(0x5c5975c23998), DateTime=HASH(0x5c5975d3be70), DateTime=HASH(0x5c5975d48620)) called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2893 # C4::Circulation::_debar_user_on_return(Koha::Patron=HASH(0x5c5975c7f748), Koha::Item=HASH(0x5c5975c23998), DateTime=HASH(0x5c5975d3be70), DateTime=HASH(0x5c5975d48620)) called at /inlibro/git/koha-master-dev-linwei/C4/Circulation.pm line 2471 # C4::Circulation::AddReturn("oVFGo_tqof9jA7HGAgH1") called at t/db_dependent/Koha/Patrons.t line 874 # main::__ANON__() called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # eval {...} called at /usr/local/share/perl/5.38.2/Test/Builder.pm line 368 # Test::Builder::subtest(Test::Builder=HASH(0x5c596b215960), "checkouts + pending_checkouts + overdues + old_checkouts", CODE(0x5c59758ad970)) called at /usr/local/share/perl/5.38.2/Test/More.pm line 831 # Test::More::subtest("checkouts + pending_checkouts + overdues + old_checkouts", CODE(0x5c59758ad970)) called at t/db_dependent/Koha/Patrons.t line 882 # # Looks like you failed 2 tests of 46. t/db_dependent/Koha/Patrons.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/46 subtests Test Summary Report ------------------- t/db_dependent/Koha/Patrons.t (Wstat: 512 (exited 2) Tests: 46 Failed: 2) Failed tests: 16, 46 Non-zero exit status: 2 Files=1, Tests=46, 24 wallclock secs ( 0.05 usr 0.00 sys + 16.98 cusr 2.70 csys = 19.73 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #174 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- prove t/db_dependent/Koha/Patrons.t succeeds for me both with and without this patch. The test plan worked as described. I get an error trying to open /cgi-bin/koha/catalogue/moredetail.pl when StoreLastBorrower is enabled and one or more items on the bib has a null borrowernumber entry in items_last_borrower. That means step 13 of the test plan is creating data that causes records not to load in the staff client. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #175 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- (In reply to Andrew Fuerste-Henry from comment #174)
prove t/db_dependent/Koha/Patrons.t succeeds for me both with and without this patch. The test plan worked as described.
I get an error trying to open /cgi-bin/koha/catalogue/moredetail.pl when StoreLastBorrower is enabled and one or more items on the bib has a null borrowernumber entry in items_last_borrower. That means step 13 of the test plan is creating data that causes records not to load in the staff client.
I can't recreate exactly this. Instead, when I get to step 12, I get: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'borrowernumber' cannot be null at /kohadevbox/koha/Koha/Patrons.pm line 218 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #176 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 182927 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182927&action=edit Bug 23260: Fix DB update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #177 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- In last_returned_by there is this line: return unless $rs; So if there is no item, return. We should add this directly afterwards: return unless $rs->borrowernumber; So if there is an item but no borrowernumber, return. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #178 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 182930 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182930&action=edit Bug 23260: Return from last_returned_by if there is no borrowernumber -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.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=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182930|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=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff QA Contact|kyle@bywatersolutions.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #179 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- This should be again ready for testing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Sarah Cornell <sbcornell@cityofportsmouth.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sbcornell@cityofportsmouth. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #180 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- I'm getting this error: "error: sha1 information is lacking or useless (t/db_dependent/Koha/Patrons.t)." -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182005|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=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182006|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=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182004|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=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182000|0 |1 is obsolete| | --- Comment #181 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 186835 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186835&action=edit Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays This patch alters the items_last_borrowers table to allow for NULL borrowers It also adds two new system preferences to allow controlling the anonymization of items_last_borrower data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182001|0 |1 is obsolete| | --- Comment #182 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 186836 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186836&action=edit Bug 23260: Add anonymize_last_borrowers method to Patrons.pm This patch adds a new routine to allow anonymizing the items_last_borrower table Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182002|0 |1 is obsolete| | --- Comment #183 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 186837 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186837&action=edit Bug 23260: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182003|0 |1 is obsolete| | --- Comment #184 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 186838 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186838&action=edit Bug 23260: Add cronjob anonymize_last_borrowers.pl This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a new cron job anonymize_last_borrowers.pl To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymize_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymized yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days earlier. 9) set AnonymizeLastBorrower to 'Anonymize' and AnonymizeLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182007|0 |1 is obsolete| | --- Comment #185 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 186839 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186839&action=edit Bug 23260: Add a confirm flag To test the confirm flag: 1. Run perl misc/cronjobs/batch_anonymise.pl --days 1 2. Notice the warning about needing a confirm flag 3. Run perl misc/cronjobs/batch_anonymise.pl --days 1 --confirm 4. The script runs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182927|0 |1 is obsolete| | --- Comment #186 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 186840 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186840&action=edit Bug 23260: Fix DB update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Failed QA --- Comment #187 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Rebased for main and removed the tidy commits. Now I'm setting to FQA, if nothing else tests are failing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #188 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 186843 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186843&action=edit Bug 23260: Adjust number of tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |26993 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26993 [Bug 26993] Allow StoreLastBorrower to retain a locally-defined number of previous borrowers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #189 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- I am making this one dependent on Bug 26993 which I recently submitted. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|agustinmoyano@theke.io |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #190 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Lucas Gass (lukeg) from comment #185)
Created attachment 186839 [details] [review] Bug 23260: Add a confirm flag
To test the confirm flag: 1. Run perl misc/cronjobs/batch_anonymise.pl --days 1 2. Notice the warning about needing a confirm flag 3. Run perl misc/cronjobs/batch_anonymise.pl --days 1 --confirm 4. The script runs
Note there is not actually a --days option here, it just follows the syspref. The confirm flag works, though! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #191 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- "Note: If the system preference 'AnonymousPatron' is not defined, NULL will be used." If items_last_borrower.borrowernumber is null, moredetail.pl explodes: Template process failed: undef error - DBIC result _type isn't of the _type Borrower at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt line 498. at /kohadevbox/koha/C4/Templates.pm line 146 We should make the cronjob require AnonymousPatron to have a value and tell you so in the --help output. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #192 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 186902 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186902&action=edit Bug 23260: (QA followup) Prevent use of cronjob when AnonymousPatron not set To test: 1 - configure StoreLastBorrower but not AnonymousPatron 2 - perl misc/cronjobs/anonymize_last_borrowers.pl -c 3 - the cron tells 'Preference 'AnonymousPatron' must be enabled to anonymize item's last borrower' 4 - put a value in AnonymousPatron 5 - repeat 2 6 - cron runs good -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #193 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- FQA on myself, now it's not properly complaining when AnonymizeLastBorrower is disabled. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #194 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 186942 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186942&action=edit Bug 23260: Fix DB update to NOT allow for NULL borrowernumber -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #195 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 186943 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186943&action=edit Bug 23260: Update cron to exit if AnonymousPatron is not set -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #196 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- items_last_borrower has "ON UPDATE current_timestamp()" but that will be problematic here. We don't want to update that column to the current timestamp when the cron runs. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #197 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 186948 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186948&action=edit Bug 23260: Alter created_on column to not update to current timestamp ON UPDATE -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.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=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186835|0 |1 is obsolete| | --- Comment #198 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 187768 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187768&action=edit Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays This patch alters the items_last_borrowers table to allow for NULL borrowers It also adds two new system preferences to allow controlling the anonymization of items_last_borrower data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186836|0 |1 is obsolete| | --- Comment #199 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 187769 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187769&action=edit Bug 23260: Add anonymize_last_borrowers method to Patrons.pm This patch adds a new routine to allow anonymizing the items_last_borrower table Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186837|0 |1 is obsolete| | --- Comment #200 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 187770 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187770&action=edit Bug 23260: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186838|0 |1 is obsolete| | --- Comment #201 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 187771 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187771&action=edit Bug 23260: Add cronjob anonymize_last_borrowers.pl This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a new cron job anonymize_last_borrowers.pl To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymize_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymized yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days earlier. 9) set AnonymizeLastBorrower to 'Anonymize' and AnonymizeLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186839|0 |1 is obsolete| | --- Comment #202 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 187772 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187772&action=edit Bug 23260: Add a confirm flag To test the confirm flag: 1. Run perl misc/cronjobs/batch_anonymise.pl --days 1 2. Notice the warning about needing a confirm flag 3. Run perl misc/cronjobs/batch_anonymise.pl --days 1 --confirm 4. The script runs Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186840|0 |1 is obsolete| | --- Comment #203 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 187773 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187773&action=edit Bug 23260: Fix DB update Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186843|0 |1 is obsolete| | --- Comment #204 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 187774 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187774&action=edit Bug 23260: Adjust number of tests Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186902|0 |1 is obsolete| | --- Comment #205 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 187775 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187775&action=edit Bug 23260: (QA followup) Prevent use of cronjob when AnonymousPatron not set To test: 1 - configure StoreLastBorrower but not AnonymousPatron 2 - perl misc/cronjobs/anonymize_last_borrowers.pl -c 3 - the cron tells 'Preference 'AnonymousPatron' must be enabled to anonymize item's last borrower' 4 - put a value in AnonymousPatron 5 - repeat 2 6 - cron runs good Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186942|0 |1 is obsolete| | --- Comment #206 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 187776 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187776&action=edit Bug 23260: Fix DB update to NOT allow for NULL borrowernumber Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186943|0 |1 is obsolete| | --- Comment #207 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 187777 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187777&action=edit Bug 23260: Update cron to exit if AnonymousPatron is not set Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186948|0 |1 is obsolete| | --- Comment #208 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 187778 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187778&action=edit Bug 23260: Alter created_on column to not update to current timestamp ON UPDATE Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Koha collecto <koha@collecto.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |koha@collecto.ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 holly@bywatersolutions.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |holly@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply --- Comment #209 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Sorry dude, doesn't apply :( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |martin.renvoize@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=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187774|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=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187768|0 |1 is obsolete| | --- Comment #210 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192200 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192200&action=edit Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays This patch alters the items_last_borrowers table to allow for NULL borrowers It also adds two new system preferences to allow controlling the anonymization of items_last_borrower data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187769|0 |1 is obsolete| | --- Comment #211 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192201&action=edit Bug 23260: Add anonymize_last_borrowers method to Patrons.pm This patch adds a new routine to allow anonymizing the items_last_borrower table Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187770|0 |1 is obsolete| | --- Comment #212 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192202 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192202&action=edit Bug 23260: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187771|0 |1 is obsolete| | --- Comment #213 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192203 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192203&action=edit Bug 23260: Add cronjob anonymize_last_borrowers.pl This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a new cron job anonymize_last_borrowers.pl To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymize_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymized yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days earlier. 9) set AnonymizeLastBorrower to 'Anonymize' and AnonymizeLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187772|0 |1 is obsolete| | --- Comment #214 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192204 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192204&action=edit Bug 23260: Add a confirm flag To test the confirm flag: 1. Run perl misc/cronjobs/batch_anonymise.pl --days 1 2. Notice the warning about needing a confirm flag 3. Run perl misc/cronjobs/batch_anonymise.pl --days 1 --confirm 4. The script runs Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187773|0 |1 is obsolete| | --- Comment #215 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192205 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192205&action=edit Bug 23260: Fix DB update Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187775|0 |1 is obsolete| | --- Comment #216 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192206 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192206&action=edit Bug 23260: (QA followup) Prevent use of cronjob when AnonymousPatron not set To test: 1 - configure StoreLastBorrower but not AnonymousPatron 2 - perl misc/cronjobs/anonymize_last_borrowers.pl -c 3 - the cron tells 'Preference 'AnonymousPatron' must be enabled to anonymize item's last borrower' 4 - put a value in AnonymousPatron 5 - repeat 2 6 - cron runs good Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187776|0 |1 is obsolete| | --- Comment #217 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192207 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192207&action=edit Bug 23260: Fix DB update to NOT allow for NULL borrowernumber Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187777|0 |1 is obsolete| | --- Comment #218 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192208 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192208&action=edit Bug 23260: Update cron to exit if AnonymousPatron is not set Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187778|0 |1 is obsolete| | --- Comment #219 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192209 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192209&action=edit Bug 23260: Alter created_on column to not update to current timestamp ON UPDATE Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192205|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=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192209|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=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192200|0 |1 is obsolete| | --- Comment #220 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192210 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192210&action=edit Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays This patch alters the items_last_borrowers table to allow for NULL borrowers It also adds two new system preferences to allow controlling the anonymization of items_last_borrower data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192201|0 |1 is obsolete| | --- Comment #221 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192211 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192211&action=edit Bug 23260: Add anonymize_last_borrowers method to Patrons.pm This patch adds a new routine to allow anonymizing the items_last_borrower table Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192202|0 |1 is obsolete| | --- Comment #222 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192212 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192212&action=edit Bug 23260: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192203|0 |1 is obsolete| | --- Comment #223 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192213 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192213&action=edit Bug 23260: Add cronjob anonymize_last_borrowers.pl This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a new cron job anonymize_last_borrowers.pl To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymize_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymized yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days earlier. 9) set AnonymizeLastBorrower to 'Anonymize' and AnonymizeLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192204|0 |1 is obsolete| | --- Comment #224 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192214 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192214&action=edit Bug 23260: Add a confirm flag To test the confirm flag: 1. Run perl misc/cronjobs/batch_anonymise.pl --days 1 2. Notice the warning about needing a confirm flag 3. Run perl misc/cronjobs/batch_anonymise.pl --days 1 --confirm 4. The script runs Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192206|0 |1 is obsolete| | --- Comment #225 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192215 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192215&action=edit Bug 23260: (QA followup) Prevent use of cronjob when AnonymousPatron not set To test: 1 - configure StoreLastBorrower but not AnonymousPatron 2 - perl misc/cronjobs/anonymize_last_borrowers.pl -c 3 - the cron tells 'Preference 'AnonymousPatron' must be enabled to anonymize item's last borrower' 4 - put a value in AnonymousPatron 5 - repeat 2 6 - cron runs good Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192207|0 |1 is obsolete| | --- Comment #226 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192216 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192216&action=edit Bug 23260: Fix DB update to NOT allow for NULL borrowernumber Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192208|0 |1 is obsolete| | --- Comment #227 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192217 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192217&action=edit Bug 23260: Update cron to exit if AnonymousPatron is not set Signed-off-by: Peter Moore <peter@mrcpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #228 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192218 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192218&action=edit Bug 23260: DO NOT PUSH Schema changes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #229 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192219 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192219&action=edit Bug 23260: Fix kohastructure.sql -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #230 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192220 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192220&action=edit Bug 23260: Fix database update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> 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=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192210|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=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192211|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=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192212|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=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192213|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=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192214|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=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192216|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=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192217|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=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192218|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=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192219|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=23260 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192220|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=23260 --- Comment #231 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192221 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192221&action=edit Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays This patch alters the items_last_borrowers table to allow for NULL borrowers It also adds two new system preferences to allow controlling the anonymization of items_last_borrower data Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #232 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192222 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192222&action=edit Bug 23260: Add anonymize_last_borrowers method to Patrons.pm This patch adds a new routine to allow anonymizing the items_last_borrower table Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #233 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192223 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192223&action=edit Bug 23260: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #234 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192224 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192224&action=edit Bug 23260: Add cronjob anonymize_last_borrowers.pl This patch adds the feature to anonymize patrons from items_last_borrower table. This code is run from batch_anonymize script, which is triggered from a new cron job anonymize_last_borrowers.pl To test: 1) apply this patch and the previous ones 2) perl installer/data/mysql/updatedatabase.pl 3) set StoreLastBorrower preference to Allow. 4) set AnonymousPatron preference to a valid patron id 5) Create a Check out followed by a Check in. CHECK => a row should appear in items_last_borrower table with the borrower and the item number. 6) In mysql, update created_on of items_last_borrower and returndate of old_issues to two days earlier. 7) perl misc/cronjobs/anonymize_last_borrowers.pl CHECK => borrower number in items_last_borrower is not anonymized yet. 8) Repeat step 5 and 6 but instead of two days earlier, set the new entry in items_last_borrower to three days earlier. 9) set AnonymizeLastBorrower to 'Anonymize' and AnonymizeLastBorrowerDays to 2 days. 10) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to AnonymousPatron id 11) repeat step 8 12) set AnonymousPatron preference to 0 13) perl misc/cronjobs/anonymize_last_borrowers.pl SUCCESS => borrower number in items_last_borrower changed to null 14) prove t/db_dependent/Koha/Patrons.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Peter Moore <peter@mrcpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #235 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192225 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192225&action=edit Bug 23260: Add a confirm flag To test the confirm flag: 1. Run perl misc/cronjobs/batch_anonymise.pl --days 1 2. Notice the warning about needing a confirm flag 3. Run perl misc/cronjobs/batch_anonymise.pl --days 1 --confirm 4. The script runs Signed-off-by: Peter Moore <peter@mrcpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #236 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192226 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192226&action=edit Bug 23260: (QA follow-up) Prevent use of cronjob when AnonymousPatron not set To test: 1 - configure StoreLastBorrower but not AnonymousPatron 2 - perl misc/cronjobs/anonymize_last_borrowers.pl -c 3 - the cron tells 'Preference 'AnonymousPatron' must be enabled to anonymize item's last borrower' 4 - put a value in AnonymousPatron 5 - repeat 2 6 - cron runs good Signed-off-by: Peter Moore <peter@mrcpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #237 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192227 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192227&action=edit Bug 23260: Fix DB update to NOT allow for NULL borrowernumber Signed-off-by: Peter Moore <peter@mrcpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #238 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192228 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192228&action=edit Bug 23260: Update cron to exit if AnonymousPatron is not set Signed-off-by: Peter Moore <peter@mrcpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #239 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192229 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192229&action=edit Bug 23260: DO NOT PUSH Schema changes Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #240 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192230 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192230&action=edit Bug 23260: Fix kohastructure.sql Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #241 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192231 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192231&action=edit Bug 23260: Fix database update Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #242 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192232 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192232&action=edit Bug 23260: (QA follow-up) Optimize anonymize_last_borrowers to avoid N+1 queries This commit refactors Koha::Patrons->anonymize_last_borrowers() to use a single bulk UPDATE instead of looping through patrons individually. Performance Problem: ------------------- The original implementation had a severe N+1 query problem: 1. Query all patrons with items_last_borrower records 2. Loop through each patron (First N+1) 3. For each patron, search their items_last_borrowers (Second N+1) 4. Update each result set For a library with 10,000 patrons and 100,000 items, this would execute 20,000+ database queries when run as a cronjob. The Fix: -------- Query the items_last_borrower table directly with all conditions in a single search, then perform one bulk UPDATE: $schema->resultset('ItemsLastBorrower')->search({...})->update({...}) This reduces execution from potentially thousands of queries to a single SQL UPDATE statement, regardless of data volume. Why This Pattern: ----------------- While Koha::Objects->update() exists, it loops through records individually if the object class has update()/store() methods, unless {no_triggers => 1} is passed. Working directly with the resultset guarantees bulk update behavior. This pattern is used throughout Koha for bulk operations (see Koha/Item.pm, Koha/Hold.pm, admin/koha2marclinks.pl, etc). Testing: -------- prove t/db_dependent/Koha/Patrons.t All existing tests pass, confirming identical behavior with dramatically improved performance. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #243 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192233 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192233&action=edit Bug 23260: (QA follow-up) Validate AnonymousPatron preference value Add validation to ensure AnonymousPatron preference contains a valid borrowernumber before attempting to use it in the anonymization process. This prevents foreign key constraint errors and orphaned records if the preference contains an invalid value (non-existent borrowernumber, string instead of number, etc.). Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement allows the release notes| |automatic deletion of data | |from the | |items_last_borrower table. | |This data is generated | |based on the | |StoreLastBorrower system | |preference. Deletion of | |this data performed by the | |new cronjob | |anonymize_last_borrowers.pl | |, with its behavior | |governed by the new system | |preferences | |AnonymizeLastBorrower and | |AnonymizeLastBorrowerDays. | |When the cronjob is run, | |entries in | |items_last_borrower are | |anonymized if older than | |the number of days defined | |in | |AnonymizeLastBorrowerDays. Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Michelle Spinney <mspinney@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mspinney@clamsnet.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192215|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=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.05.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=23260 --- Comment #244 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=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #245 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- I think the schema and DB are out of sync now because of this patchset: 17:31:36 < KEY `items_last_borrower_ibfk_1` (`itemnumber`), 17:31:36 ERROR - DB structures are not identical 17:31:36 'diff /tmp/current_db.sql /tmp/upgraded_db.sql && diff -q /tmp/current_db.sql /tmp/upgraded_db.sql || { echo "ERROR - DB structures are not identical" && exit 1; }' exited with value 1 at /kohadevbox/misc4dev/run_tests.pl line 306. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 --- Comment #246 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 195080 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195080&action=edit Bug 23260: (follow-up) Add index check -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195080|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=23260 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23260 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jacob.omara@openfifth.co.uk Status|Pushed to main |Needs documenting --- Comment #247 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Enhancement, not backporting. Scream at me if you feel strongly it should be backported. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org