Bug 17501: [Follow-up] QA Requests
commite429db4746f4ea53abe4e271afd6adb43b54c5d8
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tue, 10 Jan 2017 16:11:08 +0000 (10 17:11 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 20 Jan 2017 14:20:07 +0000 (20 14:20 +0000)
treeb6014d68e9d7fe88dee1917e9d467276e953adf3
parenta118dd2ba09c62f4d30475636f4900232ef80132
Bug 17501: [Follow-up] QA Requests

This patch makes the following changes, as requested by QA:

[1] UploadedFile->delete always calls SUPER::delete.
    The return value normally comes from SUPER::delete; if removing the
    file failed, we return false. Two warns are kept.
    Since delete does no longer return the filename, a few changes were
    needed in tools/upload.pl.
[2] Method getCategories is moved to UploadedFiles. Script tools/upload.pl
    now only contains one call. Added a use C4::Koha.
[3] Calls UploadedFiles->delete as class method. As a result I removed
    method delete_errors for now; may be reconsidered on a new report.
[4] Adjusted three ->search calls for id and public to ->find calls.
[5] If you pass no id to upload.pl when deleting, you don't get an alert.

All by all, we got rid of 15 lines !

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/UploadedFile.pm
Koha/UploadedFiles.pm
t/db_dependent/Upload.t
tools/upload.pl