Bug 42188: Use to_json for biblio action log info column
Replace Dumper with to_json for the biblio info column in logaction, fixing UTF-8 encoding and extending coverage to ADD and DELETE actions which previously logged only the literal string "biblio". All three actions (ADD, MODIFY, DELETE) now log "biblio " followed by a pretty-printed JSON representation of the relevant state: pre-change for MODIFY, new state for ADD, and deleted state for DELETE. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
3d78340552
commit
1846433ffb
|
|
@ -94,9 +94,9 @@ sub logaction {
|
|||
}
|
||||
} else {
|
||||
$updated = $infos;
|
||||
if ( ref $infos eq 'HASH' && $modulename eq 'CATALOGUING' && $actionname eq 'MODIFY' ) {
|
||||
local $Data::Dumper::Sortkeys = 1;
|
||||
$infos = "biblio " . Dumper( ref $original eq 'HASH' ? $original : {} );
|
||||
if ( $modulename eq 'CATALOGUING' && ref $original eq 'HASH' ) {
|
||||
my $prefix = ref $infos eq 'HASH' ? 'biblio' : $infos;
|
||||
$infos = "$prefix " . to_json( $original, { utf8 => 1, pretty => 1 } );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue