[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2020-01-07 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Jonathan Druart  changed:

   What|Removed |Added

 Blocks||21684


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21684
[Bug 21684] Koha::Object[s]->delete methods must behave identically as the
corresponding DBIx::Class ones
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-21 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Katrin Fischer  changed:

   What|Removed |Added

 CC||katrin.fisc...@bsz-bw.de
 Status|Pushed to Master|RESOLVED
 Resolution|--- |FIXED

--- Comment #60 from Katrin Fischer  ---
This won't get ported back to 16.11.x as it is an enhancement.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-21 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Kyle M Hall  changed:

   What|Removed |Added

 CC||k...@bywatersolutions.com
 Status|Passed QA   |Pushed to Master

--- Comment #59 from Kyle M Hall  ---
Pushed to master for 17.05, thanks Marcel, Jonathan!

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-21 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #58 from Marcel de Rooy  ---
Thx Jonathan

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #52 from Jonathan Druart  
---
Created attachment 62490
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62490=edit
Bug 17669: Add new switch to crontab example and debian daily cron file

The new switch for deleting temporary uploads in cleanup_database can
be added to cron.

Note: Since the option --temp-uploads does only purge temporary uploads
when triggered by the preference Upload_PurgeTemporaryFiles_Days, it can
be safely added here.

Test plan:
There is actually nothing to test here if you followed the preceding test
plans. Just verify that the switch is inserted ocrrectly.

Signed-off-by: Mirko Tietgen 

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #54 from Jonathan Druart  
---
Created attachment 62492
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62492=edit
Bug 17669: [QA Follow-up] Rename --temp-uploads-override parameter

As requested by QA on comment25.

Signed-off-by: Marcel de Rooy 

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #53 from Jonathan Druart  
---
Created attachment 62491
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62491=edit
Bug 17669: [QA Follow-up] Rename preference by removing underscores

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 

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #57 from Jonathan Druart  
---
Created attachment 62495
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62495=edit
Bug 17669: Remove warning 'variable $kohaobj masks earlier declaration in same
scope'

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #56 from Jonathan Druart  
---
Created attachment 62494
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62494=edit
Bug 17669: [QA Follow-up] More consistency in return values of delete

See Bugzilla comment36 (QA request).

Koha::UploadedFile->delete
Returns 1, 0E0 or -1 (unknown).

Koha::UploadedFiles->delete and delete_temporary
Returns number of deleted records, 0E0 or -1.

POD lines are corrected accordingly. Unit tests adjusted too.

Signed-off-by: Marcel de Rooy 
Added a note that Koha::Object->delete itself is not completely consistent
with Koha::Objects->delete (DBIx). The singular may return 1 when it
gets 0E0 from DBIx, while the plural one may return 0E0. But should be
handled somewhere else.

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #55 from Jonathan Druart  
---
Created attachment 62493
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62493=edit
Bug 17669: [QA Follow-up] Allow zero in temp-uploads-days

As requested by QA on comment33.
If the pref is 0 or the overriding command line parameter is 0, all
temporary files will be deleted. But if the pref is NULL or empty string,
we will not delete files.

Also adjusted the description of the preference in this regard.

Signed-off-by: Marcel de Rooy 

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #51 from Jonathan Druart  
---
Created attachment 62489
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62489=edit
Bug 17669: Incorporate the changes in cleanup_database

Two command line options are added:
[1] -temp-uploads to indicate that you want to purge these uploads,
[2] -temp-uploads-override DAYS to (optionally) tell that you want to
override the corresponding pref value.

Test plan:
[1] Check the modified usage statement.
[2] If needed, backup your temporary uploads :)
In case you do not have one, add a temporary one with Tools/Upload.
Note: Do not choose an upload category.
[3] Set pref to 0, and run cleanup_database with only --temp-uploads.
No files should be deleted.
[4] Check number of "old" temp uploads. Set pref to nonzero value.
Verify that the oldest are gone (depending on the value chosen).
[5] Set pref to 0 again.
If all uploads are gone now, add a new one with Tools/Upload.
Run cleanup_database with --temp-uploads --temp-uploads-override -1
All temporary files are gone.

Signed-off-by: Marcel de Rooy 
Signed-off-by: Mirko Tietgen 

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #49 from Jonathan Druart  
---
Created attachment 62487
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62487=edit
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 
Signed-off-by: Mirko Tietgen 

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #50 from Jonathan Druart  
---
Created attachment 62488
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62488=edit
Bug 17669: Add delete_temporary method with unit tests

Test plan:
Run t/db_dependent/Upload.t

Signed-off-by: Marcel de Rooy 
Signed-off-by: Mirko Tietgen 

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Jonathan Druart  changed:

   What|Removed |Added

  Attachment #61465|0   |1
is obsolete||
  Attachment #61466|0   |1
is obsolete||
  Attachment #61467|0   |1
is obsolete||
  Attachment #61468|0   |1
is obsolete||
  Attachment #61469|0   |1
is obsolete||
  Attachment #61729|0   |1
is obsolete||
  Attachment #61730|0   |1
is obsolete||
  Attachment #61743|0   |1
is obsolete||
  Attachment #61819|0   |1
is obsolete||

--- Comment #48 from Jonathan Druart  
---
Created attachment 62486
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62486=edit
Bug 17669: Introduce new preference for purging temp uploads

The new preference is: Upload_PurgeTemporaryFiles_Days.
It controls if the cron job will delete temporary uploaded files and if so,
how many days should have passed before doing so.

Since the default value is empty, it will not start deleting these uploads
until you change the pref. No behavior change. But the dbrev will print a
message if you already have temporary uploads.

Test plan:
[1] Check Administration, Preferences, Tools for the new pref.
[2] Run the db rev.
If you have temporary uploads, check the reported count.
[3] Bonus: Run sysprefs.sql in a safe environment.

Signed-off-by: Marcel de Rooy 
Signed-off-by: Mirko Tietgen 

Signed-off-by: Jonathan Druart 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Jonathan Druart  changed:

   What|Removed |Added

 Status|Signed Off  |Passed QA

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-18 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #47 from Marcel de Rooy  ---
Joubu: hi; any chance to have another look at the qa changes on the upload
reports 17669/18300 ?

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

   See Also||https://bugs.koha-community
   ||.org/bugzilla3/show_bug.cgi
   ||?id=18381

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

 Status|BLOCKED |Signed Off

--- Comment #46 from Marcel de Rooy  ---
Back to Signed Off

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #45 from Marcel de Rooy  ---
Created attachment 61819
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61819=edit
Bug 17669: [QA Follow-up] More consistency in return values of delete

See Bugzilla comment36 (QA request).

Koha::UploadedFile->delete
Returns 1, 0E0 or -1 (unknown).

Koha::UploadedFiles->delete and delete_temporary
Returns number of deleted records, 0E0 or -1.

POD lines are corrected accordingly. Unit tests adjusted too.

Signed-off-by: Marcel de Rooy 
Added a note that Koha::Object->delete itself is not completely consistent
with Koha::Objects->delete (DBIx). The singular may return 1 when it
gets 0E0 from DBIx, while the plural one may return 0E0. But should be
handled somewhere else.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #61818|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

 CC||m.de.r...@rijksmuseum.nl

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #61809|0   |1
is obsolete||

--- Comment #44 from Marcel de Rooy  ---
Created attachment 61818
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61818=edit
Bug 17669: [QA Follow-up] More consistency in return values of delete

See Bugzilla comment36 (QA request).

Koha::UploadedFile->delete
Returns 1, 0E0 or -1 (unknown). Return value may depend on storage backend.

Koha::UploadedFiles->delete and delete_temporary
Returns number of deleted records, 0E0 or -1.

POD lines are corrected accordingly. Unit tests adjusted too.

Signed-off-by: Marcel de Rooy 
Added a note that Koha::Object->delete itself is not completely consistent
with Koha::Objects->delete (DBIx). The singular may return 1 when it
gets 0E0 from DBIx, while the plural one may return 0E0.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-03 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

 Status|Signed Off  |BLOCKED

--- Comment #43 from Marcel de Rooy  ---
Temporarily blocked

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-03 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #42 from Marcel de Rooy  ---
(In reply to Marcel de Rooy from comment #39)
> If you insist now on further tests of the return value, I would rather move
> the last follow-up somewhere else.

Suppose I do that on 18300?

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-03 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #61805|0   |1
is obsolete||

--- Comment #41 from Marcel de Rooy  ---
Created attachment 61809
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61809=edit
Bug 17669: [QA Follow-up] More consistency in return values of delete

See Bugzilla comment36 (QA request).

Koha::UploadedFile->delete
Returns number of deleted records. POD corrected. Handles a possible or
fictive undef from the storage backend. 0E0 means zero (like DBI), -1
means unknown.

Koha::UploadedFile->delete
Returns number of deleted records (just as above), and no longer true or
false depending on errors encountered. POD corrected.

Koha::UploadedFile->delete_temporary
Returns number of deleted records (just as above). Does no longer return
true when the associated pref contains NULL or empty string. POD corrected.

Signed-off-by: Marcel de Rooy 
As often in Koha, the return values of delete operations are ignored.
The test t/db_dependent/Upload.t still passes.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-03 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #40 from Marcel de Rooy  ---
Hmm 
Still a very small thing: if I come across an undef, pass -1 instead of 0E0
(two places?)

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-03 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #39 from Marcel de Rooy  ---
If you insist now on further tests of the return value, I would rather move the
last follow-up somewhere else.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-03 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #38 from Marcel de Rooy  ---
Created attachment 61805
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61805=edit
Bug 17669: [QA Follow-up] More consistency in return values of delete

See Bugzilla comment36 (QA request).

Koha::UploadedFile->delete
Returns number of deleted records. POD corrected. Handles a possible or
fictive undef from the storage backend. 0E0 means zero (like DBI), -1
means unknown.

Koha::UploadedFile->delete
Returns number of deleted records (just as above), and no longer true or
false depending on errors encountered. POD corrected.

Koha::UploadedFile->delete_temporary
Returns number of deleted records (just as above). Does no longer return
true when the associated pref contains NULL or empty string. POD corrected.

Signed-off-by: Marcel de Rooy 
As often in Koha, the return values of delete operations are ignored.
The test t/db_dependent/Upload.t still passes.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-03 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #37 from Marcel de Rooy  ---
(In reply to Jonathan Druart from comment #36)
> Very small thing again, delete_temporary returns true if no errors occur. I
> am wondering if we should not return true if the delete worked.
> 
>  92 } elsif( !defined($days) || $days eq '' ) { # allow 0, not NULL or ""
>  93 return 1;
>  94 }
> 
> would then be 'return;'
> 
> It's how delete and delete_missing work.

Hope we still make it before release :)
I agree that we should make this more consistent. But returning undef is
perhaps not the best solution. I will add a follow-up that returns 0E0 just as
DBIx does when DBI is the storage backend.
This affects UploadedFile too. Only a few small changes, but more than one
line..

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-04-03 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #36 from Jonathan Druart  
---
Very small thing again, delete_temporary returns true if no errors occur. I am
wondering if we should not return true if the delete worked.

 92 } elsif( !defined($days) || $days eq '' ) { # allow 0, not NULL or ""
 93 return 1;
 94 }

would then be 'return;'

It's how delete and delete_missing work.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-31 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #61742|0   |1
is obsolete||

--- Comment #35 from Marcel de Rooy  ---
Created attachment 61743
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61743=edit
Bug 17669: [QA Follow-up] Allow zero in temp-uploads-days

As requested by QA on comment33.
If the pref is 0 or the overriding command line parameter is 0, all
temporary files will be deleted. But if the pref is NULL or empty string,
we will not delete files.

Also adjusted the description of the preference in this regard.

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-31 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #34 from Marcel de Rooy  ---
Created attachment 61742
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61742=edit
Bug 17669: [QA Follow-up] Allow zero in temp-uploads-days

As requested by QA on comment33.
If the pref is 0 or the overriding command line parameter is 0, all
temporary files will be deleted. But if the pref is NULL or empty string,
we will not delete files.

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-31 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #61727|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-30 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #33 from Jonathan Druart  
---
I did not find where it is referenced, not in the syspref's description nor POD
of the script nor tests.

To me today is 0, not -1

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-30 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #32 from Marcel de Rooy  ---
(In reply to Jonathan Druart from comment #31)
> Marcel, just wondering: It seems that there is no way to delete *all*
> temporary uploads (the ones from today). If we handle differently 0 and NULL
> for UploadPurgeTemporaryFilesDays, it would be possible.
> 
> Does it make sense?

Step 5 from the test plan:
Run cleanup_database with --temp-uploads --temp-uploads-override -1
All temporary files are gone

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-30 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #31 from Jonathan Druart  
---
Marcel, just wondering: It seems that there is no way to delete *all* temporary
uploads (the ones from today). If we handle differently 0 and NULL for
UploadPurgeTemporaryFilesDays, it would be possible.

Does it make sense?

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-30 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #30 from Marcel de Rooy  ---
(In reply to Jonathan Druart from comment #25)
> The pref name contains '_', it's unusual. Not blocker
> 
> I'd rename the option's name of the script with --temp-uploads-days
> (currently --temp-uploads-override). What do you think?

Always in for changing names or wording :)
Done

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-30 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #28 from Marcel de Rooy  ---
Created attachment 61729
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61729=edit
Bug 17669: [QA Follow-up] Rename preference by removing underscores

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 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-30 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #29 from Marcel de Rooy  ---
Created attachment 61730
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61730=edit
Bug 17669: [QA Follow-up] Rename --temp-uploads-override parameter

As requested by QA on comment25.

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-30 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #27 from Marcel de Rooy  ---
Created attachment 61727
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61727=edit
Bug 17669: Rename preference by removing underscores

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 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-30 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #26 from Marcel de Rooy  ---
(In reply to Jonathan Druart from comment #25)
> Right, I forgot that, makes sense.
> It sounds weird to have ->delete behaving differently than
> Koha::Objects->delete, not blocker

Should be solved on a general level, not here.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-29 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #25 from Jonathan Druart  
---
Right, I forgot that, makes sense.
It sounds weird to have ->delete behaving differently than
Koha::Objects->delete, not blocker

The pref name contains '_', it's unusual. Not blocker

I'd rename the option's name of the script with --temp-uploads-days (currently
--temp-uploads-override). What do you think?

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #24 from Marcel de Rooy  ---
(In reply to Jonathan Druart from comment #23)
> Why do we need to overwrite Koha::UploadedFiles->delete finally?

Because I want to call Koha::UploadedFile->delete and not DBIx::delete.
Otherwise I only delete a bunch of records and not the files.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Jonathan Druart  changed:

   What|Removed |Added

 CC||jonathan.dru...@bugs.koha-c
   ||ommunity.org

--- Comment #23 from Jonathan Druart  
---
Why do we need to overwrite Koha::UploadedFiles->delete finally?

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Mirko Tietgen  changed:

   What|Removed |Added

  Attachment #61243|0   |1
is obsolete||

--- Comment #22 from Mirko Tietgen  ---
Created attachment 61469
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61469=edit
Bug 17669: Add new switch to crontab example and debian daily cron file

The new switch for deleting temporary uploads in cleanup_database can
be added to cron.

Note: Since the option --temp-uploads does only purge temporary uploads
when triggered by the preference Upload_PurgeTemporaryFiles_Days, it can
be safely added here.

Test plan:
There is actually nothing to test here if you followed the preceding test
plans. Just verify that the switch is inserted ocrrectly.

Signed-off-by: Mirko Tietgen 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Mirko Tietgen  changed:

   What|Removed |Added

  Attachment #61242|0   |1
is obsolete||

--- Comment #21 from Mirko Tietgen  ---
Created attachment 61468
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61468=edit
Bug 17669: Incorporate the changes in cleanup_database

Two command line options are added:
[1] -temp-uploads to indicate that you want to purge these uploads,
[2] -temp-uploads-override DAYS to (optionally) tell that you want to
override the corresponding pref value.

Test plan:
[1] Check the modified usage statement.
[2] If needed, backup your temporary uploads :)
In case you do not have one, add a temporary one with Tools/Upload.
Note: Do not choose an upload category.
[3] Set pref to 0, and run cleanup_database with only --temp-uploads.
No files should be deleted.
[4] Check number of "old" temp uploads. Set pref to nonzero value.
Verify that the oldest are gone (depending on the value chosen).
[5] Set pref to 0 again.
If all uploads are gone now, add a new one with Tools/Upload.
Run cleanup_database with --temp-uploads --temp-uploads-override -1
All temporary files are gone.

Signed-off-by: Marcel de Rooy 
Signed-off-by: Mirko Tietgen 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Mirko Tietgen  changed:

   What|Removed |Added

  Attachment #61240|0   |1
is obsolete||

--- Comment #19 from Mirko Tietgen  ---
Created attachment 61466
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61466=edit
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 
Signed-off-by: Mirko Tietgen 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Mirko Tietgen  changed:

   What|Removed |Added

  Attachment #61241|0   |1
is obsolete||

--- Comment #20 from Mirko Tietgen  ---
Created attachment 61467
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61467=edit
Bug 17669: Add delete_temporary method with unit tests

Test plan:
Run t/db_dependent/Upload.t

Signed-off-by: Marcel de Rooy 
Signed-off-by: Mirko Tietgen 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Mirko Tietgen  changed:

   What|Removed |Added

  Attachment #61239|0   |1
is obsolete||

--- Comment #18 from Mirko Tietgen  ---
Created attachment 61465
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61465=edit
Bug 17669: Introduce new preference for purging temp uploads

The new preference is: Upload_PurgeTemporaryFiles_Days.
It controls if the cron job will delete temporary uploaded files and if so,
how many days should have passed before doing so.

Since the default value is empty, it will not start deleting these uploads
until you change the pref. No behavior change. But the dbrev will print a
message if you already have temporary uploads.

Test plan:
[1] Check Administration, Preferences, Tools for the new pref.
[2] Run the db rev.
If you have temporary uploads, check the reported count.
[3] Bonus: Run sysprefs.sql in a safe environment.

Signed-off-by: Marcel de Rooy 
Signed-off-by: Mirko Tietgen 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #17 from Marcel de Rooy  ---
(In reply to Mirko Tietgen from comment #16)
> I applied all patches and ran the test, I get
> 
> prove t/db_dependent/Upload.t 
> t/db_dependent/Upload.t .. 1/11 The method delete_temporary is not covered
> by tests at t/db_dependent/Upload.t line 273.
> The method delete_temporary is not covered by tests at
> t/db_dependent/Upload.t line 277.
> The method delete_temporary is not covered by tests at
> t/db_dependent/Upload.t line 281.
> 
> #   Failed test 'Delete with pref==5 makes 4'
> #   at t/db_dependent/Upload.t line 282.
> #  got: '6'
> # expected: '4'
> The method delete_temporary is not covered by tests at
> t/db_dependent/Upload.t line 284.
> 
> #   Failed test 'Delete override==1 makes 3'
> #   at t/db_dependent/Upload.t line 285.
> #  got: '6'
> # expected: '3'
> # Looks like you failed 2 tests of 7.
> 
> #   Failed test 'Testing delete_temporary'
> #   at t/db_dependent/Upload.t line 288.
> # Looks like you failed 1 test of 11.
> t/db_dependent/Upload.t .. Dubious, test returned 1 (wstat 256, 0x100)
> Failed 1/11 subtests 
> 
> Test Summary Report
> ---
> t/db_dependent/Upload.t (Wstat: 256 Tests: 11 Failed: 1)
>   Failed test:  11
>   Non-zero exit status: 1
> Files=1, Tests=11,  1 wallclock secs ( 0.02 usr  0.00 sys +  1.04 cusr  0.07
> csys =  1.13 CPU)
> Result: FAIL

Are you sure that your paths are okay?
Sounds like the path points to the code without the patches?

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Mirko Tietgen  changed:

   What|Removed |Added

 CC||mi...@abunchofthings.net

--- Comment #16 from Mirko Tietgen  ---
I applied all patches and ran the test, I get

prove t/db_dependent/Upload.t 
t/db_dependent/Upload.t .. 1/11 The method delete_temporary is not covered by
tests at t/db_dependent/Upload.t line 273.
The method delete_temporary is not covered by tests at t/db_dependent/Upload.t
line 277.
The method delete_temporary is not covered by tests at t/db_dependent/Upload.t
line 281.

#   Failed test 'Delete with pref==5 makes 4'
#   at t/db_dependent/Upload.t line 282.
#  got: '6'
# expected: '4'
The method delete_temporary is not covered by tests at t/db_dependent/Upload.t
line 284.

#   Failed test 'Delete override==1 makes 3'
#   at t/db_dependent/Upload.t line 285.
#  got: '6'
# expected: '3'
# Looks like you failed 2 tests of 7.

#   Failed test 'Testing delete_temporary'
#   at t/db_dependent/Upload.t line 288.
# Looks like you failed 1 test of 11.
t/db_dependent/Upload.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/11 subtests 

Test Summary Report
---
t/db_dependent/Upload.t (Wstat: 256 Tests: 11 Failed: 1)
  Failed test:  11
  Non-zero exit status: 1
Files=1, Tests=11,  1 wallclock secs ( 0.02 usr  0.00 sys +  1.04 cusr  0.07
csys =  1.13 CPU)
Result: FAIL

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

 Blocks||18300


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18300
[Bug 18300] Delete missing upload records
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

 Status|ASSIGNED|Needs Signoff

--- Comment #15 from Marcel de Rooy  ---
Added the second patch. Ready to go again!

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #58812|0   |1
is obsolete||

--- Comment #14 from Marcel de Rooy  ---
Created attachment 61243
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61243=edit
Bug 17669: Add new switch to crontab example and debian daily cron file

The new switch for deleting temporary uploads in cleanup_database can
be added to cron.

Note: Since the option --temp-uploads does only purge temporary uploads
when triggered by the preference Upload_PurgeTemporaryFiles_Days, it can
be safely added here.

Test plan:
There is actually nothing to test here if you followed the preceding test
plans. Just verify that the switch is inserted ocrrectly.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #58811|0   |1
is obsolete||

--- Comment #13 from Marcel de Rooy  ---
Created attachment 61242
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61242=edit
Bug 17669: Incorporate the changes in cleanup_database

Two command line options are added:
[1] -temp-uploads to indicate that you want to purge these uploads,
[2] -temp-uploads-override DAYS to (optionally) tell that you want to
override the corresponding pref value.

Test plan:
[1] Check the modified usage statement.
[2] If needed, backup your temporary uploads :)
In case you do not have one, add a temporary one with Tools/Upload.
Note: Do not choose an upload category.
[3] Set pref to 0, and run cleanup_database with only --temp-uploads.
No files should be deleted.
[4] Check number of "old" temp uploads. Set pref to nonzero value.
Verify that the oldest are gone (depending on the value chosen).
[5] Set pref to 0 again.
If all uploads are gone now, add a new one with Tools/Upload.
Run cleanup_database with --temp-uploads --temp-uploads-override -1
All temporary files are gone.

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #11 from Marcel de Rooy  ---
Created attachment 61240
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61240=edit
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 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-03-20 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

 Status|Needs Signoff   |ASSIGNED

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-01-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669
Bug 17669 depends on bug 17501, which changed state.

Bug 17501 Summary: Koha Objects for uploaded files
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17501

   What|Removed |Added

 Status|Pushed to Master|RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-01-11 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #9 from Marcel de Rooy  ---
Rebased on top of changes to 17501

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-01-11 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #58179|0   |1
is obsolete||

--- Comment #8 from Marcel de Rooy  ---
Created attachment 58812
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58812=edit
Bug 17669: Add new switch to crontab example and debian daily cron file

The new switch for deleting temporary uploads in cleanup_database can
be added to cron.

Note: Since the option --temp-uploads does only purge temporary uploads
when triggered by the preference Upload_PurgeTemporaryFiles_Days, it can
be safely added here.

Test plan:
There is actually nothing to test here if you followed the preceding test
plans. Just verify that the switch is inserted ocrrectly.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-01-11 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #58178|0   |1
is obsolete||

--- Comment #7 from Marcel de Rooy  ---
Created attachment 58811
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58811=edit
Bug 17669: Incorporate the changes in cleanup_database

Two command line options are added:
[1] -temp-uploads to indicate that you want to purge these uploads,
[2] -temp-uploads-override DAYS to (optionally) tell that you want to
override the corresponding pref value.

Test plan:
[1] Check the modified usage statement.
[2] If needed, backup your temporary uploads :)
In case you do not have one, add a temporary one with Tools/Upload.
Note: Do not choose an upload category.
[3] Set pref to 0, and run cleanup_database with only --temp-uploads.
No files should be deleted.
[4] Check number of "old" temp uploads. Set pref to nonzero value.
Verify that the oldest are gone (depending on the value chosen).
[5] Set pref to 0 again.
If all uploads are gone now, add a new one with Tools/Upload.
Run cleanup_database with --temp-uploads --temp-uploads-override -1
All temporary files are gone.

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2017-01-11 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #58177|0   |1
is obsolete||

--- Comment #6 from Marcel de Rooy  ---
Created attachment 58810
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58810=edit
Bug 17669: Add delete_temporary method with unit tests

Test plan:
Run t/db_dependent/Upload.t

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2016-12-14 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

  Component|Architecture, internals,|Tools
   |and plumbing|

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2016-12-14 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

 Status|ASSIGNED|Needs Signoff

--- Comment #5 from Marcel de Rooy  ---
Testers: Please apply 17501 first

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2016-12-14 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #4 from Marcel de Rooy  ---
Created attachment 58179
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58179=edit
Bug 17669: Add new switch to crontab example and debian daily cron file

The new switch for deleting temporary uploads in cleanup_database can
be added to cron.

Note: Since the option --temp-uploads does only purge temporary uploads
when triggered by the preference Upload_PurgeTemporaryFiles_Days, it can
be safely added here.

Test plan:
There is actually nothing to test here if you followed the preceding test
plans. Just verify that the switch is inserted ocrrectly.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2016-12-14 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #1 from Marcel de Rooy  ---
Created attachment 58176
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58176=edit
Bug 17669: Introduce new preference for purging temp uploads

The new preference is: Upload_PurgeTemporaryFiles_Days.
It controls if the cron job will delete temporary uploaded files and if so,
how many days should have passed before doing so.

Since the default value is empty, it will not start deleting these uploads
until you change the pref. No behavior change. But the dbrev will print a
message if you already have temporary uploads.

Test plan:
[1] Check Administration, Preferences, Tools for the new pref.
[2] Run the db rev.
If you have temporary uploads, check the reported count.
[3] Bonus: Run sysprefs.sql in a safe environment.

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2016-12-14 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #2 from Marcel de Rooy  ---
Created attachment 58177
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58177=edit
Bug 17669: Add delete_temporary method with unit tests

Test plan:
Run t/db_dependent/Upload.t

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2016-12-14 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

--- Comment #3 from Marcel de Rooy  ---
Created attachment 58178
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58178=edit
Bug 17669: Incorporate the changes in cleanup_database

Two command line options are added:
[1] -temp-uploads to indicate that you want to purge these uploads,
[2] -temp-uploads-override DAYS to (optionally) tell that you want to
override the corresponding pref value.

Test plan:
[1] Check the modified usage statement.
[2] If needed, backup your temporary uploads :)
In case you do not have one, add a temporary one with Tools/Upload.
Note: Do not choose an upload category.
[3] Set pref to 0, and run cleanup_database with only --temp-uploads.
No files should be deleted.
[4] Check number of "old" temp uploads. Set pref to nonzero value.
Verify that the oldest are gone (depending on the value chosen).
[5] Set pref to 0 again.
If all uploads are gone now, add a new one with Tools/Upload.
Run cleanup_database with --temp-uploads --temp-uploads-override -1
All temporary files are gone.

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2016-12-12 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

   Assignee|gmcha...@gmail.com  |m.de.r...@rijksmuseum.nl
 Status|NEW |ASSIGNED

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2016-11-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

 Depends on||17501


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17501
[Bug 17501] Koha Objects for uploaded files
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17669] Add purging temporary uploads to cleanup_database

2016-11-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17669

Marcel de Rooy  changed:

   What|Removed |Added

   See Also||https://bugs.koha-community
   ||.org/bugzilla3/show_bug.cgi
   ||?id=14294

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/