Bug 42033 - Add diff support to patron restriction and circ message action logs
Summary: Add diff support to patron restriction and circ message 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:36 UTC by Martin Renvoize (ashimema)
Modified: 2026-03-09 15:36 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:36:49 UTC
Several MEMBERS action log calls in Koha do not pass the $original parameter to logaction(), so no structured diff is generated in the action_logs.diff column.

Affected calls:
1. Koha/Patron/Debarments.pm - CREATE_RESTRICTION (~line 89):
   logaction( "MEMBERS", "CREATE_RESTRICTION", $borrowernumber, $restriction )
   (no $original; $restriction hashref is the new state)

2. Koha/Patron/Debarments.pm - DELETE_RESTRICTION (~line 113):
   logaction( "MEMBERS", "DELETE_RESTRICTION", $borrowernumber, $restriction )
   (no $original; $restriction hashref is the state being deleted)

3. Koha/Patron/Message.pm - MODCIRCMESSAGE (~line 58):
   C4::Log::logaction( "MEMBERS", "MODCIRCMESSAGE", $self->borrowernumber, $self->message )
   (passes new message text; should also pass original for diff)

4. Koha/Patron/Message.pm - ADDCIRCMESSAGE (~line 60):
   C4::Log::logaction( "MEMBERS", "ADDCIRCMESSAGE", $self->borrowernumber, $self->message )

5. Koha/Patron/Message.pm - DELCIRCMESSAGE (~line 74):
   C4::Log::logaction( "MEMBERS", "DELCIRCMESSAGE", $self->borrowernumber, $self->message )

This bug covers updating these calls to pass structured data so the diff mechanism can generate proper before/after comparisons.