[Bug 37943] New: Object creation should be logged with a JSON diff of changes, implement for items
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Bug ID: 37943 Summary: Object creation should be logged with a JSON diff of changes, implement for items Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org We should store newly created objects as diffs just as we do for modifications. This enhancement will store modification diffs if the action is set to ADD or CREATE, and an "original" object is passed in. -- 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=37943 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |37522 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 [Bug 37522] Logging item modification should record the original version of the item -- 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=37943 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |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=37943 Kyle M Hall <kyle@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=37943 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 171624 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171624&action=edit Bug 37943: Log object create as JSON diff, implement for items We should store newly created objects as diffs just as we do for modifications. This enhancement will store modification diffs if the action is set to ADD or CREATE and an "original" object is passed in. Test Plan: 1) Enable CataloguingLog 2) Create an item 3) Query the database for the newest action log: select * from action_logs order by action_id desc limit 1\G 4) Note the diff column is NULL 5) Apply this patch 6) Restart all the things! 7) Create another item 8) Query the database again 9) Note the diff has been created! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37940 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37940 [Bug 37940] [OMNIBUS] All modification logged via action logs should include original to create JSON diff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37944 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37944 [Bug 37944] Object deletion should be logged with a JSON diff of changes, implement for items -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Sukhmandeep <sukhmandeep.benipal@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171624|0 |1 is obsolete| | --- Comment #2 from Sukhmandeep <sukhmandeep.benipal@inLibro.com> --- Created attachment 171996 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171996&action=edit Bug 37943: Log object create as JSON diff, implement for items We should store newly created objects as diffs just as we do for modifications. This enhancement will store modification diffs if the action is set to ADD or CREATE and an "original" object is passed in. Test Plan: 1) Enable CataloguingLog 2) Create an item 3) Query the database for the newest action log: select * from action_logs order by action_id desc limit 1\G 4) Note the diff column is NULL 5) Apply this patch 6) Restart all the things! 7) Create another item 8) Query the database again 9) Note the diff has been created! Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Sukhmandeep <sukhmandeep.benipal@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sukhmandeep.benipal@inLibro | |.com 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=37943 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171996|0 |1 is obsolete| | --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173549 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173549&action=edit Bug 37943: Log object create as JSON diff, implement for items We should store newly created objects as diffs just as we do for modifications. This enhancement will store modification diffs if the action is set to ADD or CREATE and an "original" object is passed in. Test Plan: 1) Enable CataloguingLog 2) Create an item 3) Query the database for the newest action log: select * from action_logs order by action_id desc limit 1\G 4) Note the diff column is NULL 5) Apply this patch 6) Restart all the things! 7) Create another item 8) Query the database again 9) Note the diff has been created! Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com> 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=37943 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |Main Keywords| |additional_work_needed --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Can we please get some unit tests for the change to Log.pm? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- I don't think ->store should call discard_changes. If you need an additional fetch then do it before logging, don't you think? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #6)
I don't think ->store should call discard_changes. If you need an additional fetch then do it before logging, don't you think?
Nevermind, forget that. There was one additional fetch already - $self->get_from_storage->_after_item_action_hooks({ action => $action }); + $self->_after_item_action_hooks({ action => $action }); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 --- Comment #8 from Jonathan Druart <jonathan.druart@gmail.com> --- t/db_dependent/Circulation/CalcFine.t .. 1/7 # Failed test 'Amount is calculated correctly' # at t/db_dependent/Circulation/CalcFine.t line 271. # got: '0' # expected: '6' # Looks like you failed 1 test of 2. See bug 37943 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 --- Comment #9 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #8)
t/db_dependent/Circulation/CalcFine.t .. 1/7 # Failed test 'Amount is calculated correctly' # at t/db_dependent/Circulation/CalcFine.t line 271. # got: '0' # expected: '6' # Looks like you failed 1 test of 2.
See bug 37943
Did this get fixed? Main is passing this test for me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38303 --- Comment #10 from Jonathan Druart <jonathan.druart@gmail.com> --- Sorry wrong bug, it was bug 38303. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=37943 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.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=37943 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Architecture, internals, |Tools |and plumbing | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | Text to go in the| |This enhancement will store release notes| |modification diffs, if the | |action is set to ADD or | |CREATE and an "original" | |object is passed in. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to main |Needs documenting --- Comment #11 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Enhancement, no 24.05.x backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 Bug 37943 depends on bug 37522, which changed state. Bug 37522 Summary: Logging item modification should record the original version of the item https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org