--- Comment #1 from Marcel de Rooy <m.de.r...@rijksmuseum.nl> ---
Created attachment 61250
Bug 18300: Delete missing upload records
If you deleted files from the upload directories manually, or you rebooted
with files in the temporary upload folder, or for some other reason have
records without a file, you may want to cleanup your records in the
This patch adds the method delete_missing to Koha::UploadedFiles. It also
supports a keep_record parameter to do a dry run (count the missing files
Also, we add an option --uploads-missing to cleanup_database. If you add
the flag 1 after this option, you will delete missing files. If you add the
flag 0 or only use the option, you will count missing files.
A subtest is added to Upload.t for delete_missing tests.
 Run t/db_dependent/Upload.t
 Upload a file and delete the file manually.
 Run cleanup_database.pl --uploads-missing
It should report at least one missing file now.
Check that the record has not been deleted.
 Run cleanup_database.pl --uploads-missing 1
It should report that it removed at least one file.
Check that the record is gone.
Signed-off-by: Marcel de Rooy <m.de.r...@rijksmuseum.nl>
You are receiving this mail because:
You are watching all bug changes.
Koha-bugs mailing list
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/