]> git.koha-community.org Git - koha.git/commit
Bug 17501: Move Koha::Upload::delete to Koha::UploadedFile[s]
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Mon, 21 Nov 2016 13:53:27 +0000 (14:53 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 20 Jan 2017 14:20:04 +0000 (14:20 +0000)
commit7a620054684e4ab0dfdbb5bd285a9c70928a7e14
tree262ef5c98d6dea964f990966131a76bfab6b11cd
parent42f0bdf9f1a3f14ca454fee93507d795f6da74c0
Bug 17501: Move Koha::Upload::delete to Koha::UploadedFile[s]

Since delete is not part of the upload process, we will move it now
to Koha::UploadedFile[s].
Deleting the file will be done in UploadedFile.
The (multiple) delete method in UploadedFiles refers to the single delete.

Test plan:
[1] Run t/db_dependent/Upload.t
    The warning ("but file was missing") in the last subtest is fine;
    the file did not exist. Will be addressed in a follow-up.
[2] Search for uploads on Tools/Upload. Clone this tab (repeat search on
    a new tab in your browser).
[3] Delete an existing upload on the first tab.
[4] Try to delete it again on the second tab. Error message?
[5] Bonus points:
    Add an upload. Mark the file immutable with chattr +i. Try to delete
    the file. You should see a "Could not be deleted"-message.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/Upload.pm
Koha/UploadedFile.pm
Koha/UploadedFiles.pm
koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt
t/db_dependent/Upload.t
tools/upload.pl