Bug 16589 - Quote of the day: Fix upload with csv files associated to LibreOffice Calc
Summary: Quote of the day: Fix upload with csv files associated to LibreOffice Calc
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-25 14:35 UTC by Marc Véron
Modified: 2017-12-07 22:16 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16589 - Quote of the day: Fix upload with csv files associated to LibreOffice Calc (1.56 KB, patch)
2016-05-28 07:59 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16589 - Quote of the day: Fix upload with csv files associated to LibreOffice Calc (1.78 KB, patch)
2016-05-28 09:04 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 16589 - Quote of the day: Fix upload with csv files associated to LibreOffice Calc (1.90 KB, patch)
2016-06-10 15:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16859: Fix wrong item field name in export.pl (2.49 KB, patch)
2016-07-06 14:10 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2016-05-25 14:35:30 UTC
Upload a valid CSV file to QOD results in error message.

Uploads limited to csv. Incorrect filetype: application/vnd.sun.xml.calc

Tested with a valid sample file from Bug 15684 - Fix encoding issues with quote upload
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47405
Comment 1 Owen Leonard 2016-05-25 15:06:57 UTC
I've tried my own CSV file and those on Bug 15684 and I get no errors.
Comment 2 Marc Véron 2016-05-26 08:30:34 UTC
(In reply to Owen Leonard from comment #1)
> I've tried my own CSV file and those on Bug 15684 and I get no errors.

I think the issue is related to the fact that on my computer .csv files are associated with LibreOffice (Calc): application/vnd.sun.xml.calc

See koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt line 241:

if (!fileType.match(/comma-separated-values|csv|excel/i)) {
    alert(_("Uploads limited to csv. Incorrect filetype: %s").format(fileType));
Comment 3 Marc Véron 2016-05-28 07:59:58 UTC Comment hidden (obsolete)
Comment 4 Frédéric Demians 2016-05-28 09:04:29 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2016-06-10 15:06:17 UTC
Looks good but I cannot recreate the issue.
Comment 6 Jonathan Druart 2016-06-10 15:10:35 UTC
Created attachment 52244 [details] [review]
Bug 16589 - Quote of the day: Fix upload with csv files associated to LibreOffice Calc

To reproduce:
- Install LibreOffice and make sure that csv files are associated to Calc
  (Note: tested with Firefox 46.0.1 on Windows 8)
- Go to Home > Tools > Quote editor > Quote uploader
- Try to upload a valid CSV (e.g. Example from Bug 15684)
Result: File can not be uploaded
        (Incorrect filetype: application/vnd.sun.xml.calc)
To test:
- Apply patch
- Try to upload again
Expected result: Quotes are imported.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Can't reproduce on a Mac but get it fails on a Windows Box: fixed with this
  patch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Can't recreate on debian but the fix looks safe.
Comment 7 Kyle M Hall 2016-06-10 17:39:29 UTC
Pushed to master for Koha 16.11, thanks Marc!
Comment 8 Frédéric Demians 2016-06-15 07:47:18 UTC
Pushed in 16.05. Will be in 16.05.01.
Comment 9 Julian Maurice 2016-06-16 09:21:10 UTC
Patch pushed to 3.22.x, will be in 3.22.8
Comment 10 Marcel de Rooy 2016-07-06 14:10:06 UTC Comment hidden (obsolete)
Comment 11 Marcel de Rooy 2016-07-06 14:12:53 UTC
Comment on attachment 53129 [details] [review]
Bug 16859: Fix wrong item field name in export.pl

Sorry, wrong bug number..