Bugzilla – Attachment 126902 Details for
Bug 28700
"Unblessed" method in Object.pm has blessed values for keys in some cases
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28700: Throw exception on dirty columns for unblessed
Bug-28700-Throw-exception-on-dirty-columns-for-unb.patch (text/plain), 1.54 KB, created by
Martin Renvoize (ashimema)
on 2021-10-26 10:25:25 UTC
(
hide
)
Description:
Bug 28700: Throw exception on dirty columns for unblessed
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-10-26 10:25:25 UTC
Size:
1.54 KB
patch
obsolete
>From 2165e536efd5710f14bd1230cd3ebe04ef0e3447 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 26 Oct 2021 11:24:25 +0100 >Subject: [PATCH] Bug 28700: Throw exception on dirty columns for unblessed > >This patch updates the unblessed method to throw an exception when >called with dirty columns. >--- > Koha/Exceptions/Object.pm | 5 +++++ > Koha/Object.pm | 4 ++++ > 2 files changed, 9 insertions(+) > >diff --git a/Koha/Exceptions/Object.pm b/Koha/Exceptions/Object.pm >index 688a97cd5a..684c5eb4c7 100644 >--- a/Koha/Exceptions/Object.pm >+++ b/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", >diff --git a/Koha/Object.pm b/Koha/Object.pm >index 8daffd536f..03576a810f 100644 >--- a/Koha/Object.pm >+++ b/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 }; > } > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28700
:
122770
|
122776
|
122797
|
126082
|
126181
|
126437
| 126902