[Bug 37522] New: Logging item modification should record the original version of the item
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 Bug ID: 37522 Summary: Logging item modification should record the original version of the item Change sponsored?: Sponsored Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Tools Assignee: januszop@gmail.com Reporter: januszop@gmail.com QA Contact: testopia@bugs.koha-community.org When modifying bibliographic record, Koha records in the log the original version of the record. This allows one to see what has been changed in the record. However, in case of item modification Koha records in the log the the current version of the item (i.e. the version after the edit). This is inconsistent with the biblio modification behavior and makes it difficult or even impossible to trace changes (especially in case of the first modif since the initial version is not being recorded). The ability to track changes is quite important for library staff and the inconsistency here is not understandable. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 Janusz Kaczmarek <januszop@gmail.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=37522 --- Comment #1 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 169855 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169855&action=edit Bug 37522: Logging item modification should record the original version of the item When modifying bibliographic record, Koha records in the log the original version of the record. This allows one to see what has been changed in the record. However, in case of item modification Koha records in the log the the current version of the item (i.e. the version after the edit). This is inconsistent with the biblio modification behavior and makes it difficult or even impossible to trace changes (especially in case of the first modif since the initial version is not being recorded). This patch makes the item modification logging feature work similarly to logging modifications in bibliographic records. Test plan: ========== 1. With CataloguingLog enabled (default in ktd) make a modification of an item. 2. Check the Modification log. You should see as the recorded varsion the version of the item after the modification. 3. Apply the patch; restart_all. 4. Repeat p. 1. 5. In the Modification log you should see now the version of the item that existed before the recent modification. Sponsored-by: Ignatianum University in Cracow -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 Roman Dolny <roman.dolny@jezuici.pl> 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=37522 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #169855|0 |1 is obsolete| | --- Comment #2 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 169862 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169862&action=edit Bug 37522: Logging item modification should record the original version of the item When modifying bibliographic record, Koha records in the log the original version of the record. This allows one to see what has been changed in the record. However, in case of item modification Koha records in the log the the current version of the item (i.e. the version after the edit). This is inconsistent with the biblio modification behavior and makes it difficult or even impossible to trace changes (especially in case of the first modif since the initial version is not being recorded). This patch makes the item modification logging feature work similarly to logging modifications in bibliographic records. Test plan: ========== 1. With CataloguingLog enabled (default in ktd) make a modification of an item. 2. Check the Modification log. You should see as the recorded version the version of the item after the modification. 3. Apply the patch; restart_all. 4. Repeat p. 1. 5. In the Modification log you should see now the version of the item that existed before the recent modification. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi, can you please detail how it works/should work (before/after)? If I understand correctly it changes from logging the new version to logging the old version. I think this would be a behavior change for libraries working with the logs and it would not be "visible" when the change occurred in the logs. We discussed at one of the last meetings a new coding guideline that new log entries should be using the new JSON diff. Could you have a look please? https://wiki.koha-community.org/wiki/Coding_Guidelines#ACTN1:_New_additions_... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 --- Comment #4 from Janusz Kaczmarek <januszop@gmail.com> --- (In reply to Katrin Fischer from comment #3)
Hi, can you please detail how it works/should work (before/after)?
Now: 1) log records previous version of modified biblio record (very useful); 2) log records current version of modified item record (which is inconsistent with biblio behavior; not useful, since we have the current version in the database; leading to data loss in case of the first modif: the initial values go to /dev/null--which is most frustrating when working with the logs). Also note that the librarian sees the changes both of the biblio record and item record in one single table, but the meaning of the rows is opposite. It is my strong conviction that is should be consistent (the inconsistency here is not understandable for the librarians) and that it is probably buggy, maybe from the very beginning (the initial value of the item is never recorded in the log).
If I understand correctly it changes from logging the new version to logging the old version.
Yes--for items.
I think this would be a behavior change for libraries working with the logs and it would not be "visible" when the change occurred in the logs.
Yes, it changes the behavior for better, IMHO, by eliminating the (most probably buggy) inconsistency.
We discussed at one of the last meetings a new coding guideline that new log entries should be using the new JSON diff. Could you have a look please?
https://wiki.koha-community.org/wiki/Coding_Guidelines#ACTN1: _New_additions_to_actions_logs_should_use_the_JSON_Diff_format
The proposed patch make use of the diff feature: after applying it action_logs.diff column is filled as well, according to the proposal (but not visible from the interface). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com, | |nick@bywatersolutions.com Status|Failed QA |Signed Off --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thanks for the replies and sorry for not coming back to this earlier. I am resetting to SO and I think another set of eyes would be good. Also adding Kyle and Nick. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 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 | CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |Failed QA --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Module changes need tests. Please add. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 Janusz Kaczmarek <januszop@gmail.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=37522 --- Comment #7 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 171520 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171520&action=edit Bug 37522: Unit tests NB, since the 6th argument to logaction is now mandatory for logging item modifications, one had to modify one line from the previous tests by adding this additional parameter. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 Kyle M Hall <kyle@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=37522 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #169862|0 |1 is obsolete| | Attachment #171520|0 |1 is obsolete| | --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 171566 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171566&action=edit Bug 37522: Logging item modification should record the original version of the item When modifying bibliographic record, Koha records in the log the original version of the record. This allows one to see what has been changed in the record. However, in case of item modification Koha records in the log the the current version of the item (i.e. the version after the edit). This is inconsistent with the biblio modification behavior and makes it difficult or even impossible to trace changes (especially in case of the first modif since the initial version is not being recorded). This patch makes the item modification logging feature work similarly to logging modifications in bibliographic records. Test plan: ========== 1. With CataloguingLog enabled (default in ktd) make a modification of an item. 2. Check the Modification log. You should see as the recorded version the version of the item after the modification. 3. Apply the patch; restart_all. 4. Repeat p. 1. 5. In the Modification log you should see now the version of the item that existed before the recent modification. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> 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=37522 --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 171567 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171567&action=edit Bug 37522: Unit tests NB, since the 6th argument to logaction is now mandatory for logging item modifications, one had to modify one line from the previous tests by adding this additional parameter. 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=37522 --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Looks good! It does make me wonder if we should be storing a JSON diff for object creation as well. I'm not sure if that is within the scope of this bug though. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 --- Comment #11 from Janusz Kaczmarek <januszop@gmail.com> --- (In reply to Kyle M Hall from comment #10)
Looks good! It does make me wonder if we should be storing a JSON diff for object creation as well. I'm not sure if that is within the scope of this bug though.
Thank you, Kyle, for the remark. I think, this is beyond the idea of this patch. In fact, we probably should make a general review od all logaction calls and add the 6th argument to consistently create the content ot the diff column, as you made it in bug 25159 for holds. (In case of item creation and also changes made to bibliographic records this does not seem to be straightforward...) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 --- Comment #12 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Janusz Kaczmarek from comment #11)
(In reply to Kyle M Hall from comment #10)
Looks good! It does make me wonder if we should be storing a JSON diff for object creation as well. I'm not sure if that is within the scope of this bug though.
Thank you, Kyle, for the remark. I think, this is beyond the idea of this patch. In fact, we probably should make a general review od all logaction calls and add the 6th argument to consistently create the content ot the diff column, as you made it in bug 25159 for holds. (In case of item creation and also changes made to bibliographic records this does not seem to be straightforward...)
Agreed. I will file a followup bug report! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37943 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943 [Bug 37943] Object creation 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=37522 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171566|0 |1 is obsolete| | --- Comment #13 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173547 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173547&action=edit Bug 37522: Logging item modification should record the original version of the item When modifying bibliographic record, Koha records in the log the original version of the record. This allows one to see what has been changed in the record. However, in case of item modification Koha records in the log the the current version of the item (i.e. the version after the edit). This is inconsistent with the biblio modification behavior and makes it difficult or even impossible to trace changes (especially in case of the first modif since the initial version is not being recorded). This patch makes the item modification logging feature work similarly to logging modifications in bibliographic records. Test plan: ========== 1. With CataloguingLog enabled (default in ktd) make a modification of an item. 2. Check the Modification log. You should see as the recorded version the version of the item after the modification. 3. Apply the patch; restart_all. 4. Repeat p. 1. 5. In the Modification log you should see now the version of the item that existed before the recent modification. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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=37522 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171567|0 |1 is obsolete| | --- Comment #14 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173548 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173548&action=edit Bug 37522: Unit tests NB, since the 6th argument to logaction is now mandatory for logging item modifications, one had to modify one line from the previous tests by adding this additional parameter. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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=37522 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA 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=37522 --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Kyle M Hall (khall) from comment #10)
Looks good! It does make me wonder if we should be storing a JSON diff for object creation as well. I'm not sure if that is within the scope of this bug though.
We shoudld we have a coding guideline now enforcing this for new logs too :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Please explain the consequence of this change for the release notes, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 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=37522 --- Comment #17 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=37522 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |Actions logs for changes to release notes| |items now include the pre | |and post change item data | |in the database. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37522 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m 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=37522 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED Resolution|--- |FIXED CC| |lucas@bywatersolutions.com --- Comment #18 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Missing 24.05.x deps, no backport. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org