From 9515c7bc9ace6d82bb1c44fe29aeb576311407b8 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 12 Nov 2021 10:40:32 +0000 Subject: [PATCH] Bug 28692: (QA follow-up) Fix test for objects Content-Type: text/plain; charset=utf-8 Fix the bug where object is first stringified and then tested for being a Koha::Item. Signed-off-by: Marcel de Rooy --- C4/Log.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/C4/Log.pm b/C4/Log.pm index 3f1255b25e..19e4a57ec1 100644 --- a/C4/Log.pm +++ b/C4/Log.pm @@ -26,6 +26,7 @@ use warnings; use Data::Dumper qw( Dumper ); use JSON qw( to_json ); +use Scalar::Util qw( blessed ); use C4::Context; use Koha::Logger; @@ -77,13 +78,14 @@ sub logaction { $usernumber ||= 0; $interface //= C4::Context->interface; - if ( ref($infos) && ref($infos) !~ /HASH|ARRAY/ && $infos->isa('Koha::Object') ) { + if( blessed($infos) && $infos->isa('Koha::Object') ) { $infos = $infos->get_from_storage if $infos->in_storage; local $Data::Dumper::Sortkeys = 1; - $infos = Dumper( $infos->unblessed ); if ( $infos->isa('Koha::Item') && $modulename eq 'CATALOGUING' && $actionname eq 'MODIFY' ) { - $infos = "item " . $infos; + $infos = "item " . Dumper( $infos->unblessed ); + } else { + $infos = Dumper( $infos->unblessed ); } } -- 2.20.1