Bug 39234

Summary: Set default upload category
Product: Koha Reporter: Lari Taskula <lari.taskula>
Component: ToolsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Lari Taskula 2025-03-04 11:06:14 UTC
Uploaded files are considered temporary and will be removed by cleanup_database.pl unless an authorised value from category UPLOAD is provided.

By default, Koha sets empty category meaning the uploaded file is considered a temporary upload.

Add a system preference to define an upload category to be selected by default.
Comment 1 Lari Taskula 2025-03-04 11:10:11 UTC
Since not everyone likes adding yet another system preference, one option would be to select the most used category by default.

Btw by selecting I mean values for the "Category" dropdown under Tools -> Upload (requires at least one authorised_value under UPLOAD category to display the dropdown)
Comment 2 Lari Taskula 2025-03-04 11:47:04 UTC
Adding a few notes,

> will be removed by cleanup_database.pl unless an authorised value from category UPLOAD is provided.
cleanup_database.pl only removes temporary files if system preference "UploadPurgeTemporaryFilesDays" is set.

> By default, Koha sets empty category meaning the uploaded file is considered a temporary upload.
Technically Koha only looks at uploaded_files.permanent flag for temporary file deletion.