Bugzilla – Attachment 104596 Details for
Bug 25423
Methods update and empty from Koha::Objects are not class methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25423: Force call to update and empty with an instanciated object
Bug-25423-Force-call-to-update-and-empty-with-an-i.patch (text/plain), 1.27 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-05-08 13:23:04 UTC
(
hide
)
Description:
Bug 25423: Force call to update and empty with an instanciated object
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-05-08 13:23:04 UTC
Size:
1.27 KB
patch
obsolete
>From 5741eec7152f4c3b4e4e83ea1ad8b9dab4cf4ce9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 8 May 2020 15:17:31 +0200 >Subject: [PATCH] Bug 25423: Force call to update and empty with an > instanciated object > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Objects.pm | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > >diff --git a/Koha/Objects.pm b/Koha/Objects.pm >index 2bf33917a7..7824d83d27 100644 >--- a/Koha/Objects.pm >+++ b/Koha/Objects.pm >@@ -24,6 +24,7 @@ use List::MoreUtils qw( none ); > use Class::Inspector; > > use Koha::Database; >+use Koha::Exceptions::Object; > > =head1 NAME > >@@ -225,6 +226,11 @@ catch wrong uses as well. > sub update { > my ($self, $fields, $options) = @_; > >+ Koha::Exceptions::Object::NotInstantiated->throw( >+ method => 'update', >+ class => $self >+ ) unless ref $self; >+ > my $no_triggers = $options->{no_triggers}; > > if ( >@@ -325,9 +331,10 @@ an iterator). > sub empty { > my ($self) = @_; > >- unless (ref($self)) { >- $self = $self->new; >- } >+ Koha::Exceptions::Object::NotInstantiated->throw( >+ method => 'empty', >+ class => $self >+ ) unless ref $self; > > $self->_resultset()->set_cache([]); > >-- >2.26.2
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 25423
:
104587
|
104588
|
104589
|
104590
|
104591
|
104592
|
104593
|
104594
|
104595
| 104596 |
104618