Bug 28692: (QA follow-up) Fix test for objects
Fix the bug where object is first stringified and then tested for being a Koha::Item. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
2d528efc69
commit
6abe27e7b8
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue