Bug 42034 - Add diff support to system preference action logs
Summary: Add diff support to system preference 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:00 UTC
The action logging in Koha/Config/SysPref.pm does not pass the $original parameter to logaction(), so no structured diff is generated in the action_logs.diff column.

Affected calls in Koha/Config/SysPref.pm:
- SYSTEMPREFERENCE/MODIFY or ADD (~line 47):
  C4::Log::logaction( 'SYSTEMPREFERENCE', $action, undef, $self->variable . ' | ' . $self->value );
  (concatenates variable name and new value into a string; no before state)

- SYSTEMPREFERENCE/DELETE (~line 63):
  C4::Log::logaction( 'SYSTEMPREFERENCE', 'DELETE', undef, " $variable | $value" );

System preference changes are important for configuration audit trails. This bug covers updating store() in Koha::Config::SysPref to capture the pre-change value and pass it as $original, and to pass a structured hashref (e.g. { variable => ..., value => ... }) as $infos so the diff mechanism can produce a clear before/after comparison.