@@ -, +, @@ --- Koha/Exceptions/Object.pm | 5 +++++ Koha/Object.pm | 4 ++++ 2 files changed, 9 insertions(+) --- a/Koha/Exceptions/Object.pm +++ a/Koha/Exceptions/Object.pm @@ -23,6 +23,11 @@ use Exception::Class ( 'Koha::Exceptions::Object' => { isa => 'Koha::Exceptions::Exception', }, + 'Koha::Exceptions::Object::Dirty' => { + isa => 'Koha::Exceptions::Object', + description => "Dirty object passed to unblessed", + fields => ['dirty_fields'] + }, 'Koha::Exceptions::Object::DuplicateID' => { isa => 'Koha::Exceptions::Object', description => "Duplicate ID passed", --- a/Koha/Object.pm +++ a/Koha/Object.pm @@ -319,6 +319,10 @@ Returns an unblessed representation of object. sub unblessed { my ($self) = @_; + Koha::Exceptions::Object::Dirty->throw( + { dirty_fields => [ keys %{ $self->_result->get_dirty_columns } ] } ) + if $self->_result->get_dirty_columns; + return { $self->_result->get_columns }; } --