[Bug 17782] New: Patron updated_on field should be set to current timestamp when borrower is deleted
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Bug ID: 17782 Summary: Patron updated_on field should be set to current timestamp when borrower is deleted Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Currently the timestamp is not udpated when a patron is deleted. This is because we insert the db value of updated_on from the patron when we move the borrower. Clearing the value beforehand should resolve this -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 58203 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58203&action=edit Bug 17782 - Patron updated_on field should be set to current timestamp when borrower is deleted To test: 01 Find a patron 02 Get the updated_on value from the db in borrowers table 03 Delete the patron 04 Get the update_on value from the db on deletedborrowers table 05 Values from 02 and 04 are the same 06 Apply patch 07 Repeat 01-04 08 Values should now be different -- 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=17782 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |major Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | Patch complexity|--- |Trivial patch -- 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=17782 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Nick, is this ready to be tested? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #2)
Nick, is this ready to be tested?
Yes, should be, forgot to change status -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Claire Gravely <claire_gravely@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |claire_gravely@hotmail.com --- Comment #4 from Claire Gravely <claire_gravely@hotmail.com> --- Hi Nick After applying the patch, the updated_on field in deletedborrowers hasn't been populated after deleting the patron. They appear in the table, but the field is blank. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Nick, I did not test, but it does not work that way. If you want DBIx::Class to use the default value you must not pass the key. So: delete $patron_infos->{updated_on}; should work. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 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=17782 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58203|0 |1 is obsolete| | --- Comment #6 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 58890 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58890&action=edit Bug 17782 - Patron updated_on field should be set to current timestamp when borrower is deleted To test: 01 Find a patron 02 Get the updated_on value from the db in borrowers table 03 Delete the patron 04 Get the update_on value from the db on deletedborrowers table 05 Values from 02 and 04 are the same 06 Apply patch 07 Repeat 01-04 08 Values should now be different -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- I thought it worked the other way, this is better though :-) Updated patch (In reply to Jonathan Druart from comment #5)
Nick, I did not test, but it does not work that way. If you want DBIx::Class to use the default value you must not pass the key. So: delete $patron_infos->{updated_on}; should work.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Claire Gravely <claire_gravely@hotmail.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=17782 Claire Gravely <claire_gravely@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58890|0 |1 is obsolete| | --- Comment #8 from Claire Gravely <claire_gravely@hotmail.com> --- Created attachment 58913 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58913&action=edit Bug 17782 - Patron updated_on field should be set to current timestamp when borrower is deleted To test: 01 Find a patron 02 Get the updated_on value from the db in borrowers table 03 Delete the patron 04 Get the update_on value from the db on deletedborrowers table 05 Values from 02 and 04 are the same 06 Apply patch 07 Repeat 01-04 08 Values should now be different Signed-off-by: Claire Gravely <claire_gravely@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Please provide tests (t/db_dependent/Koha/Patrons.t -> move_to_deleted). Note that at one test does not pass on my devbox: # Failed test 'Koha::Patron->move_to_deleted should have correctly moved the patron to the deleted table' # at t/db_dependent/Koha/Patrons.t line 331. # Structures begin differing at: # $got->{updated_on} = '2017-01-13 11:42:27' # $expected->{updated_on} = '2017-01-13 10:42:26' system date is 2017-01-13 11:42:27 I do not understand what's going on actually. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 George Williams (NEKLS) <george@nekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |george@nekls.org --- Comment #10 from George Williams (NEKLS) <george@nekls.org> --- This failed the test when I tried to sign off this evening. The timestamp didn't change on the second deletion. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Nick Clemens <nick@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=17782 --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 59558 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59558&action=edit Bug 17782 - (QA Followup) Fix tests 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=17782 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59573 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59573&action=edit Bug 17782: Try to fix tests Previous code was wrong, $retrieved_patron->{updated_on} is always undef, $retrieved_patron is a Koha::Object -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 --- Comment #13 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 59583 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59583&action=edit Bug 17782 - Allow discard_changes to work for Deletedborrower class -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=17782 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58913|0 |1 is obsolete| | Attachment #59558|0 |1 is obsolete| | Attachment #59573|0 |1 is obsolete| | Attachment #59583|0 |1 is obsolete| | --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59605 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59605&action=edit Bug 17782 - Patron updated_on field should be set to current timestamp when borrower is deleted To test: 01 Find a patron 02 Get the updated_on value from the db in borrowers table 03 Delete the patron 04 Get the update_on value from the db on deletedborrowers table 05 Values from 02 and 04 are the same 06 Apply patch 07 Repeat 01-04 08 Values should now be different Signed-off-by: Claire Gravely <claire_gravely@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59606 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59606&action=edit Bug 17782 - (QA Followup) Fix tests prove t/db_dependent/Koha/Patrons.t Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59607 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59607&action=edit Bug 17782: Fix tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Let's deal with deletedborrowers.borrowernumber as a PK on another bug report. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18003 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18003 [Bug 18003] Should deletedborrowers.borrowernumber be a primary key? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 --- Comment #18 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #17)
Let's deal with deletedborrowers.borrowernumber as a PK on another bug report.
See bug 18003. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |kyle@bywatersolutions.com --- Comment #19 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Nick, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |katrin.fischer@bsz-bw.de --- Comment #20 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This patch has been pushed to 16.11.x and will be in 16.11.04. Note: updated_on is also present in 3.22.x, so possibly needs backporting all the way down. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 --- Comment #21 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 60047 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60047&action=edit [3.22.x] Bug 17782: deletedborrowers.updated_on should be set to current timestamp -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #22 from Julian Maurice <julian.maurice@biblibre.com> --- Pushed to 3.22.x for 3.22.17 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17782 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #23 from Mason James <mtj@kohaaloha.com> --- Pushed to 16.05.x, for 16.05.10 release -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org