Bugzilla – Attachment 62487 Details for
Bug 17669
Add purging temporary uploads to cleanup_database
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17669: Small change to sub delete
Bug-17669-Small-change-to-sub-delete.patch (text/plain), 1.41 KB, created by
Jonathan Druart
on 2017-04-20 18:28:03 UTC
(
hide
)
Description:
Bug 17669: Small change to sub delete
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-04-20 18:28:03 UTC
Size:
1.41 KB
patch
obsolete
>From 427bea37d025756a1a56aa043bf2eb066499c05d Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 20 Mar 2017 08:43:32 +0100 >Subject: [PATCH] Bug 17669: Small change to sub delete > >Instead of looping through _resultset here and wrapping the results, >we should use a Koha::Objects instance. Since the method may be called >as a class method, we create an instance if needed. > >Test plan: >Run t/db_dependent/Upload.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/UploadedFiles.pm | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/UploadedFiles.pm b/Koha/UploadedFiles.pm >index 109593d..74211fa 100644 >--- a/Koha/UploadedFiles.pm >+++ b/Koha/UploadedFiles.pm >@@ -63,11 +63,11 @@ Parameter keep_file may be used to delete records, but keep files. > > sub delete { > my ( $self, $params ) = @_; >+ $self = Koha::UploadedFiles->new if !ref($self); # handle class call > # We use the individual delete on each resultset record > my $err = 0; >- while( my $row = $self->_resultset->next ) { >- my $kohaobj = Koha::UploadedFile->_new_from_dbic( $row ); >- $err++ if !$kohaobj->delete( $params ); >+ while( my $row = $self->next ) { >+ $err++ if !$row->delete( $params ); > } > return $err==0; > } >-- >2.9.3
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 17669
:
58176
|
58177
|
58178
|
58179
|
58810
|
58811
|
58812
|
61239
|
61240
|
61241
|
61242
|
61243
|
61465
|
61466
|
61467
|
61468
|
61469
|
61727
|
61729
|
61730
|
61742
|
61743
|
61805
|
61809
|
61818
|
61819
|
62486
| 62487 |
62488
|
62489
|
62490
|
62491
|
62492
|
62493
|
62494
|
62495