https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19318
--- Comment #2 from Julian Maurice <julian.maur...@biblibre.com> --- Created attachment 71017 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71017&action=edit Bug 19318: Allow multiple storage spaces for file uploads This patch allow to configure multiple storage spaces to be used when uploading a file. Configuration is done in $KOHA_CONF. Element 'upload_path' is replaced by 'storage', which is repeatable and can contain the following elements: - name: The storage's identifier (also used for display) - adapter: The storage's adapter is a Perl module who is responsible for actually writing in the storage (creating/deleting files/directories). There is actually only one adapter, 'directory', which writes directly on the filesystem. - adapter_params: Additional parameters required for the storage's adapter - hash_filename: Whether to prepend hashvalue to the filename or not - temporary: Whether the storage is temporary or not - baseurl: Base URL of the storage, if one doesn't want to (or can't) use opac-retrieve-file.pl This is all documented in Koha::Storage There is two built-in storages: - 'TMP', the default temporary storage (not configurable) - 'DEFAULT', the default persistent storage (configurable in $KOHA_CONF) Note that if $KOHA_CONF is not updated, uploads should continues to work (the 'DEFAULT' storage will use 'upload_path', if set) This patch affects the following pages: - Tools › Upload - Tools › Upload local cover image (ZIP file upload) - Tools › Stage MARC records for import - Tools › Upload patron images - Circulation › Offline circulation file upload - Cataloguing plugin upload.pl Test plan: 0. Before applying the patch, be sure to use the pages mentioned above and upload some files, those files should continue to be accessible after the patch 1. Apply the patch, run updatedatabase and update_dbix_class_files 2. Without modifying $KOHA_CONF, verify that files uploaded in step 0 are still accessible (you can find them in tools/upload.pl) 3. Verify that you can still upload files using the pages mentioned above 4. Edit your $KOHA_CONF, copy the <storage> element from etc/koha-conf.xml in the source, set the <path> using the value of <upload_path> and remove <upload_path> 5. Verify that you can still upload files 6. Add another storage in $KOHA_CONF, set <hash_filename> to 0, and a <baseurl>. Now try to use the cataloguing plugin and see how the generated URL change. Also note that the files keep their original filename (without the hashvalue prepended) 7. Create some subdirectories under the main storage's path (using a shell). Try to upload a new files and see that these directories appear in a dropdown list. Select one, finish the upload and verify that the file has been uploaded to the selected subdirectory. 8. Run prove t/ImportBatch.t t/Koha/Storage.t t/db_dependent/ImportBatch.t t/db_dependent/Upload.t -- 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/