Bug 18704

Summary: File types limit in tools/export.pl is causing issues with csv files generated by MS/Excel
Product: Koha Reporter: Nick Clemens <nick>
Component: ToolsAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: 1joynelson, fridolin.somers, jpalmer, katrin.fischer, m.de.rooy, mtj, nick, sandboxes, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 18087    
Bug Blocks:    
Attachments: Bug 18704 - File types limit in tools/export.pl is causing issues with csv files generated by MS/Excel
Bug 18704 - File types limit in tools/export.pl is causing issues with csv files generated by MS/Excel
Bug 18704 - File types limit in tools/export.pl is causing issues with csv files generated by MS/Excel

Description Nick Clemens 2017-05-30 19:23:00 UTC
It seems that a file saved as csv from Excel sometimes has the mime type:
application/vnd.ms-excel

Bug 18087 limited the file types to:
text/csv
text/plain

Users are complaining of a loss of functionality here.
Comment 1 Jonathan Druart 2017-05-30 20:37:51 UTC
I guess the following patch would fixes the problem:

-        my @valid_mimetypes = qw( application/octet-stream text/csv text/plain );
+        my @valid_mimetypes = qw( application/octet-stream text/csv text/plain application/vnd.ms-excel );

Are we going to create a patch for vendors that provide non-standard mimetype?
(Yes I know, this one is certainly the most used).
Comment 2 Nick Clemens 2017-05-30 20:57:14 UTC
Created attachment 63856 [details] [review]
Bug 18704 - File types limit in tools/export.pl is causing issues with csv files generated by MS/Excel

To test:
1 - Save a csv of biblionumber from MS/Excel
2 - Attempt to export records using this file
3 - It fails (mimetype is appliction/vnd.ms-excel)
4 - Apply patch
5 - Try again
6 - It succeeds!
Comment 3 PTFS Europe Sandboxes 2017-05-31 20:08:55 UTC
Patch tested with a sandbox, by Jason Palmer <jpalmer@switchinc.org>
Comment 4 PTFS Europe Sandboxes 2017-05-31 20:09:17 UTC
Created attachment 63892 [details] [review]
Bug 18704 - File types limit in tools/export.pl is causing issues with csv files generated by MS/Excel

To test:
1 - Save a csv of biblionumber from MS/Excel
2 - Attempt to export records using this file
3 - It fails (mimetype is appliction/vnd.ms-excel)
4 - Apply patch
5 - Try again
6 - It succeeds!

Signed-off-by: Jason Palmer <jpalmer@switchinc.org>
Comment 5 Jason Palmer 2017-05-31 20:10:57 UTC
Executed plan in test environment.  Works as desired.
Comment 6 Marcel de Rooy 2017-06-02 09:30:42 UTC
Created attachment 63932 [details] [review]
Bug 18704 - File types limit in tools/export.pl is causing issues with csv files generated by MS/Excel

To test:
1 - Save a csv of biblionumber from MS/Excel
2 - Attempt to export records using this file
3 - It fails (mimetype is appliction/vnd.ms-excel)
4 - Apply patch
5 - Try again
6 - It succeeds!

Signed-off-by: Jason Palmer <jpalmer@switchinc.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Jonathan Druart 2017-06-05 14:57:16 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 8 Fridolin Somers 2017-06-09 10:56:20 UTC
Pushed to 17.05.x, will be in v17.05.01
Comment 9 Katrin Fischer 2017-06-11 19:40:23 UTC
This patch has been pushed to 16.11.x and will be in 16.11.09.
Comment 10 Mason James 2017-07-31 11:15:37 UTC
Pushed to 16.05.x, for 16.05.15 release