Bug 39628

Summary: Display 'diff' in action logs
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: ToolsAssignee: Andrew Fuerste-Henry <andrew>
Status: Pushed to main --- QA Contact: Emily Lamancusa (emlam) <emily.lamancusa>
Severity: enhancement    
Priority: P5 - low CC: angela.berrett, emily.lamancusa, roman.dolny
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35645
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Adds a "diff" column to the action logs viewer. This column will display the old (O) and new (N) values of the fields that were changed, for modules that store that information.
Version(s) released in:
25.05.00
Circulation function:
Bug Depends on:    
Bug Blocks: 36698, 39908    
Attachments: Bug 39628: Show diff in log viewer and column settings
Bug 39628: Show diff in log viewer and column settings
Bug 39628: Show diff in log viewer and column settings

Description Andrew Fuerste-Henry 2025-04-14 15:34:15 UTC
Bug 36698 wants to display the diff nicely. As a stopgap, how about we just make it possible to display them as-is?
Comment 1 Andrew Fuerste-Henry 2025-04-14 15:39:33 UTC
Created attachment 180922 [details] [review]
Bug 39628: Show diff in log viewer and column settings

To test:
1 - apply patch
2 - search the log viewer for item edits or something else that records a diff value
3 - see that diff in the new column
4 - confirm the diff value is present in exports and prints
5 - confirm you can use column config to hide that diff value
Comment 2 Roman Dolny 2025-04-14 18:23:39 UTC
Yes, it is good start to show data from diff col.

I modified an item and can confirm p. 1-4 test plan, but not p. 5.

There is no "Diff" in cols list for "Columns" button.
There is no "diff" in configure table (/cgi-bin/koha/admin/columns_settings.pl?module=tools&page=logviewer&table=logst) to hide it by default.
Comment 3 Andrew Fuerste-Henry 2025-04-14 19:05:57 UTC
(In reply to Roman Dolny from comment #2)
> Yes, it is good start to show data from diff col.
> 
> I modified an item and can confirm p. 1-4 test plan, but not p. 5.
> 
> There is no "Diff" in cols list for "Columns" button.
> There is no "diff" in configure table
> (/cgi-bin/koha/admin/columns_settings.
> pl?module=tools&page=logviewer&table=logst) to hide it by default.

Did you restart_all after applying the patch? I forgot to specify that in the test plan, but I do see Diff in the table config after restarting services.
Comment 4 Roman Dolny 2025-04-14 20:05:27 UTC
(In reply to Andrew Fuerste-Henry from comment #3)
> ...
> Did you restart_all after applying the patch? I forgot to specify that in
> the test plan, but I do see Diff in the table config after restarting
> services.

I'm pretty sure I did, but now it works... checked twice, with another browser and incognito. Thanks for suggestion.
Comment 5 Roman Dolny 2025-04-14 20:06:03 UTC
Created attachment 180937 [details] [review]
Bug 39628: Show diff in log viewer and column settings

To test:
1 - apply patch
2 - search the log viewer for item edits or something else that records a diff value
3 - see that diff in the new column
4 - confirm the diff value is present in exports and prints
5 - confirm you can use column config to hide that diff value

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 6 Emily Lamancusa (emlam) 2025-05-09 15:20:12 UTC
Created attachment 182190 [details] [review]
Bug 39628: Show diff in log viewer and column settings

To test:
1 - apply patch
2 - search the log viewer for item edits or something else that records a diff value
3 - see that diff in the new column
4 - confirm the diff value is present in exports and prints
5 - confirm you can use column config to hide that diff value

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 7 Emily Lamancusa (emlam) 2025-05-09 15:26:02 UTC
I agree it's worth displaying the raw diff in the meantime. Thanks, Andrew!
Comment 8 Katrin Fischer 2025-05-15 06:42:27 UTC
This is a bit scary looking. Could we agree to hide the column by default in the table configuration settings? (these are also missing, please follow-up!)
Comment 9 Katrin Fischer 2025-05-15 06:45:17 UTC
I need to clarify, the "Diff" was not showing up initially in my column configuration settings above the table. After some restarting etc. it does now. 
It still might be nice to hide it by default, but leaving that for a simple follow-up.
Comment 10 Katrin Fischer 2025-05-15 07:21:44 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 11 Andrew Fuerste-Henry 2025-05-15 12:31:16 UTC
> It still might be nice to hide it by default, but leaving that for a simple
> follow-up.

Follow-up filed: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39908