Bugzilla – Attachment 61729 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: [QA Follow-up] Rename preference by removing underscores
Bug-17669-QA-Follow-up-Rename-preference-by-removi.patch (text/plain), 6.56 KB, created by
Marcel de Rooy
on 2017-03-30 06:53:21 UTC
(
hide
)
Description:
Bug 17669: [QA Follow-up] Rename preference by removing underscores
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-03-30 06:53:21 UTC
Size:
6.56 KB
patch
obsolete
>From dc1b75482e6d94f1152416363f434ddd04068433 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 30 Mar 2017 08:42:38 +0200 >Subject: [PATCH] Bug 17669: [QA Follow-up] Rename preference by removing > underscores >Content-Type: text/plain; charset=utf-8 > >Requested by QA on comment25. >Result of: >git grep -l Upload_PurgeTemporaryFiles_Days | xargs sed -i -e "s/Upload_PurgeTemporaryFiles_Days/UploadPurgeTemporaryFilesDays/g" > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/UploadedFiles.pm | 4 ++-- > installer/data/mysql/atomicupdate/bug17669.perl | 4 ++-- > installer/data/mysql/sysprefs.sql | 2 +- > .../intranet-tmpl/prog/en/modules/admin/preferences/tools.pref | 2 +- > t/db_dependent/Upload.t | 6 +++--- > 5 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/Koha/UploadedFiles.pm b/Koha/UploadedFiles.pm >index 06a9965..3d28b25 100644 >--- a/Koha/UploadedFiles.pm >+++ b/Koha/UploadedFiles.pm >@@ -77,7 +77,7 @@ sub delete { > =head3 delete_temporary > > Delete_temporary is called by cleanup_database and only removes temporary >-uploads older than [pref Upload_PurgeTemporaryFiles_Days] days. >+uploads older than [pref UploadPurgeTemporaryFilesDays] days. > It is possible to override the pref with the override_pref parameter. > > Returns true if no errors occur. (Even when no files had to be deleted.) >@@ -87,7 +87,7 @@ Returns true if no errors occur. (Even when no files had to be deleted.) > sub delete_temporary { > my ( $self, $params ) = @_; > my $days = $params->{override_pref} || >- C4::Context->preference('Upload_PurgeTemporaryFiles_Days'); >+ C4::Context->preference('UploadPurgeTemporaryFilesDays'); > return 1 if !$days; > my $dt = dt_from_string(); > $dt->subtract( days => $days ); >diff --git a/installer/data/mysql/atomicupdate/bug17669.perl b/installer/data/mysql/atomicupdate/bug17669.perl >index ef2e58f..d4c4f86 100644 >--- a/installer/data/mysql/atomicupdate/bug17669.perl >+++ b/installer/data/mysql/atomicupdate/bug17669.perl >@@ -1,12 +1,12 @@ > $DBversion = 'XXX'; # will be replaced by the RM > if( CheckVersion( $DBversion ) ) { > $dbh->do(q| >-INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('Upload_PurgeTemporaryFiles_Days','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'); >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'); > |); > > my ( $cnt ) = $dbh->selectrow_array( "SELECT COUNT(*) FROM uploaded_files WHERE permanent IS NULL or permanent=0" ); > if( $cnt ) { >- print "NOTE: You have $cnt temporary uploads. You could benefit from setting pref Upload_PurgeTemporaryFiles_Days now to automatically delete them.\n"; >+ print "NOTE: You have $cnt temporary uploads. You could benefit from setting pref UploadPurgeTemporaryFilesDays now to automatically delete them.\n"; > } > > SetVersion( $DBversion ); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 825fe2e..fc53d1d 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -536,7 +536,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('UniqueItemFields','barcode','','Space-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table','Free'), > ('UpdateNotForLoanStatusOnCheckin', '', 'NULL', 'This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value it will be updated to the right-hand value. E.g. ''-1: 0'' will cause an item that was set to ''Ordered'' to now be available for loan. Each pair of values should be on a separate line.', 'Free'), > ('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'), >-('Upload_PurgeTemporaryFiles_Days','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'), >+('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'), > ('uppercasesurnames','0',NULL,'If ON, surnames are converted to upper case in patron entry form','YesNo'), > ('URLLinkText','',NULL,'Text to display as the link anchor in the OPAC','free'), > ('UsageStats', 0, NULL, 'Share anonymous usage data on the Hea Koha community website.', 'YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref >index a64a25c..9403951 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref >@@ -29,6 +29,6 @@ Tools: > Upload: > - > - Automatically delete temporary uploads older than >- - pref: Upload_PurgeTemporaryFiles_Days >+ - pref: UploadPurgeTemporaryFilesDays > class: integer > - "days in cleanup_database cron job. NOTE: If you leave this field empty (zero), the cron job will not delete any files." >diff --git a/t/db_dependent/Upload.t b/t/db_dependent/Upload.t >index 6d7864d..136a9d7 100644 >--- a/t/db_dependent/Upload.t >+++ b/t/db_dependent/Upload.t >@@ -269,15 +269,15 @@ subtest 'Testing delete_temporary' => sub { > $recs[2]->dtcreated($dt)->store; > > # Now call delete_temporary with 0, 6, 5 and 1 (via override) >- t::lib::Mocks::mock_preference('Upload_PurgeTemporaryFiles_Days', 0 ); >+ t::lib::Mocks::mock_preference('UploadPurgeTemporaryFilesDays', 0 ); > Koha::UploadedFiles->delete_temporary; > is( Koha::UploadedFiles->search->count, 6, 'Delete with pref==0' ); > >- t::lib::Mocks::mock_preference('Upload_PurgeTemporaryFiles_Days', 6 ); >+ t::lib::Mocks::mock_preference('UploadPurgeTemporaryFilesDays', 6 ); > Koha::UploadedFiles->delete_temporary; > is( Koha::UploadedFiles->search->count, 6, 'Delete with pref==6' ); > >- t::lib::Mocks::mock_preference('Upload_PurgeTemporaryFiles_Days', 5 ); >+ t::lib::Mocks::mock_preference('UploadPurgeTemporaryFilesDays', 5 ); > Koha::UploadedFiles->delete_temporary; > is( Koha::UploadedFiles->search->count, 4, 'Delete with pref==5 makes 4' ); > >-- >2.1.4
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