Bug 42035 - Add diff support to APIKEYS CREATE and DELETE action logs
Summary: Add diff support to APIKEYS CREATE and DELETE 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:05 UTC
The action logging for the APIKEYS module (Koha/ApiKey.pm) already has diff support for MODIFY, REVOKE, and ACTIVATE actions. However, CREATE and DELETE actions do not pass the $original parameter.

Affected calls in Koha/ApiKey.pm:
- APIKEYS/CREATE (~line 84):
  logaction( 'APIKEYS', 'CREATE', $self->patron_id, $self, undef );
  (passes $self as $infos but no $original; for CREATE, $self represents the new state)

- APIKEYS/DELETE (~line 142):
  logaction( 'APIKEYS', 'DELETE', $patron_id )
  (no info or original passed at all)

For CREATE, passing $self as both $infos and $original (or with undef original) would allow the viewer to show what was created. For DELETE, the API key object should be fetched before deletion and passed as both $infos and $original so the log shows what was deleted. This is important for security audit trails.