The action logging for the SUGGESTION module (Koha/Suggestion.pm) currently logs CREATE and MODIFY actions without passing the $original parameter to logaction(). No structured diff is generated in the action_logs.diff column. The relevant logaction() call is in Koha/Suggestion.pm (~line 79): logaction( 'SUGGESTION', $action, $result->suggestionid, $self ); This bug covers updating Koha::Suggestion to capture the pre-change suggestion state and pass it as the sixth argument to logaction(), enabling before/after comparison in the action log viewer. Since Koha::Suggestion is a Koha::Object subclass, $self->get_from_storage (or an equivalent pre-change snapshot) should be captured before store() and passed as $original for MODIFY actions. For CREATE, $self can serve as the single state captured.
Created attachment 195032 [details] [review] Bug 42030: Populate diff column for suggestion CREATE/MODIFY/DELETE logs Update suggestion action logging to populate the diff column using the correct before/after semantics: - CREATE: empty before-state ({}), new suggestion data as after-state - MODIFY: pre-change unblessed data as before, post-store object as after - DELETE: log before the SQL DELETE so the object can still be fetched; pass the suggestion as both $infos (info column) and $original (diff before-state), logaction sets after-state to {} Also add tests verifying the diff column is populated for all three actions.