Bug 37944 - Object deletion should be logged with a JSON diff of changes, implement for items
Summary: Object deletion should be logged with a JSON diff of changes, implement for i...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Kyle M Hall (khall)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords: release-notes-needed
Depends on: 37943
Blocks:
  Show dependency treegraph
 
Reported: 2024-09-17 13:38 UTC by Kyle M Hall (khall)
Modified: 2024-11-18 13:47 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 37944: Log object delete as JSON diff, implement for items (2.00 KB, patch)
2024-09-17 13:40 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 37944: Log object delete as JSON diff, implement for items (2.05 KB, patch)
2024-09-26 15:44 UTC, Sukhmandeep
Details | Diff | Splinter Review
Bug 37944: Log object delete as JSON diff, implement for items (2.32 KB, patch)
2024-10-28 15:02 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2024-09-17 13:38:59 UTC
We should store deleted objects as diffs just as we do for modification and item created.
This enhancement will store modification diffs if the action is set to DELETE, and an "original" object is passed in.
Comment 1 Kyle M Hall (khall) 2024-09-17 13:40:35 UTC
Created attachment 171626 [details] [review]
Bug 37944: Log object delete as JSON diff, implement for items

We should store deleted objects as diffs just as we do for modification and item created.
This enhancement will store modification diffs if the action is set to DELETE, and an "original" object is passed in.

Test Plan:
1) Enable CataloguingLog
2) Deletee 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) Delete another item
8) Query the database again
9) Note the diff has been created!
Comment 2 Sukhmandeep 2024-09-26 15:44:12 UTC
Created attachment 171992 [details] [review]
Bug 37944: Log object delete as JSON diff, implement for items

We should store deleted objects as diffs just as we do for modification and item created.
This enhancement will store modification diffs if the action is set to DELETE, and an "original" object is passed in.

Test Plan:
1) Enable CataloguingLog
2) Deletee 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) Delete another item
8) Query the database again
9) Note the diff has been created!

Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com>
Comment 3 Martin Renvoize (ashimema) 2024-10-28 15:02:08 UTC
Created attachment 173550 [details] [review]
Bug 37944: Log object delete as JSON diff, implement for items

We should store deleted objects as diffs just as we do for modification and item created.
This enhancement will store modification diffs if the action is set to DELETE, and an "original" object is passed in.

Test Plan:
1) Enable CataloguingLog
2) Deletee 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) Delete 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>
Comment 4 Katrin Fischer 2024-10-30 08:04:23 UTC
Can we please get a unit test here as well? (can also be part of follow-up for 37943)
Comment 5 Katrin Fischer 2024-10-30 11:00:00 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 6 Katrin Fischer 2024-11-14 15:31:06 UTC
Would still like a unit test.