Bug 42036 - Add diff support to REPORTS action logs
Summary: Add diff support to REPORTS action logs
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Transaction logs (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 37940
  Show dependency treegraph
 
Reported: 2026-03-09 15:37 UTC by Martin Renvoize (ashimema)
Modified: 2026-03-09 15:37 UTC (History)
0 users

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2026-03-09 15:37:15 UTC
The action logging for saved reports does not pass the $original parameter to logaction(), so no structured diff is generated in the action_logs.diff column. Currently log entries store the report name and SQL concatenated as a plain string.

Affected calls:
- reports/guided_reports.pl MODIFY (~line 250):
  logaction( "REPORTS", "MODIFY", $id, "$reportname | $sql" )
  (no $original; only post-change state captured as a string)

- reports/guided_reports.pl ADD (~line 594):
  logaction( "REPORTS", "ADD", $id, "$name | $sql" )

- C4/Reports/Guided.pm DELETE (~line 798):
  logaction( "REPORTS", "DELETE", $id, $data->report_name . " | " . $data->savedsql )

This bug covers updating these calls to pass structured hashrefs (e.g. { report_name => ..., savedsql => ... }) as $infos and, for MODIFY, the pre-change report data as $original, enabling proper before/after diff display in the action log viewer.