diff --git a/C4/Log.pm b/C4/Log.pm index d7ad162c4c..cf0fd34de7 100644 --- a/C4/Log.pm +++ b/C4/Log.pm @@ -88,7 +88,7 @@ sub logaction { local $Data::Dumper::Sortkeys = 1; if ( $infos->isa('Koha::Item') && $modulename eq 'CATALOGUING' && $actionname eq 'MODIFY' ) { - $infos = "item " . Dumper($updated); + $infos = "item " . Dumper( $original->unblessed ); } else { $infos = Dumper($updated); } diff --git a/Koha/Item.pm b/Koha/Item.pm index 92803c2618..e098b05b8e 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -220,11 +220,12 @@ sub store { } } + my $original = Koha::Items->find( $self->itemnumber ); # $original will be undef if $action eq 'create' my $result = $self->SUPER::store; if ( $log_action && C4::Context->preference("CataloguingLog") ) { $action eq 'create' - ? logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" ) - : logaction( "CATALOGUING", "MODIFY", $self->itemnumber, $self ); + ? logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" ) + : logaction( "CATALOGUING", "MODIFY", $self->itemnumber, $self, undef, $original ); } my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); $indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" )