Bug 14263 - Export of CSV from item search form does only work in English
Summary: Export of CSV from item search form does only work in English
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 11425
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-24 14:25 UTC by Katrin Fischer
Modified: 2016-12-05 21:23 UTC (History)
8 users (show)

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


Attachments
Bug 14263: Fix export of item search results when translated (2.17 KB, patch)
2015-05-24 16:07 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14263: Fix export of item search results when translated (4.62 KB, patch)
2015-05-26 15:12 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14263: Fix export of item search results when translated (4.61 KB, patch)
2015-05-26 15:50 UTC, Frédéric Demians
Details | Diff | Splinter Review
[PASSED QA] Bug 14263: Fix export of item search results when translated (4.68 KB, patch)
2015-05-31 20:32 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2015-05-24 14:25:08 UTC
Exporting the results of an item search as CSV will only work for the English templates, but not for translated templates (German or French). 

To test:

English templates:
- Go to the item search form
- Select CSV at the bottom of the page
- Do a search
- verify the CSV is ok and opens alright in LibreOffice
- Switch to another fully translated language
- Repeat steps
- Verify the CSV is NOT ok - everything appears on one line
Comment 1 Katrin Fischer 2015-05-24 15:01:13 UTC
This is a bigger problem - also other CSV exports suffer from this: basket, late orders, serial claims.
Comment 2 Jonathan Druart 2015-05-24 16:07:59 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-05-24 16:08:26 UTC
(In reply to Katrin Fischer from comment #1)
> This is a bigger problem - also other CSV exports suffer from this: basket,
> late orders, serial claims.

Should work for basket and serial claims.
See bug 14169 for late orders.
Comment 4 Jonathan Druart 2015-05-24 16:09:02 UTC
(In reply to Jonathan Druart from comment #3)
> (In reply to Katrin Fischer from comment #1)
> > This is a bigger problem - also other CSV exports suffer from this: basket,
> > late orders, serial claims.
> 
> Should work for basket and serial claims.
> See bug 14169 for late orders.

See bug 14264!
Comment 5 Frédéric Demians 2015-05-26 14:27:31 UTC
I can't make it working properly. Without the patch: 1 unique line. With it: 2 lines, one for field name, one for all records aggregated.
Comment 6 Jonathan Druart 2015-05-26 15:12:45 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2015-05-26 15:13:56 UTC
Actually(In reply to Frédéric Demians from comment #5)
> I can't make it working properly. Without the patch: 1 unique line. With it:
> 2 lines, one for field name, one for all records aggregated.

Sorry about that, I tested with a wrong record.
This patch is dirty but works as expected.
Comment 8 Frédéric Demians 2015-05-26 15:48:48 UTC
(In reply to Jonathan Druart from comment #7)
> Actually(In reply to Frédéric Demians from comment #5)
> > I can't make it working properly. Without the patch: 1 unique line. With it:
> > 2 lines, one for field name, one for all records aggregated.
> 
> Sorry about that, I tested with a wrong record.
> This patch is dirty but works as expected.

Yes, your workaround reintroduces newlines required by CSV format. In the first place, the template toolkit translation machinery is the culprit, but can't be fixed that easily, unfortunately.
Comment 9 Frédéric Demians 2015-05-26 15:50:30 UTC Comment hidden (obsolete)
Comment 10 Marc Véron 2015-05-29 14:44:07 UTC
Should this be set to Signed-off?
Comment 11 Frédéric Demians 2015-05-29 15:01:43 UTC
Thanks Marc!
Comment 12 Katrin Fischer 2015-05-31 20:32:26 UTC
Created attachment 39718 [details] [review]
[PASSED QA] Bug 14263: Fix export of item search results when translated

This csv does not use the correct way to display headers.
They should be put in a separate file to get a correct display.
Without this patch, the first line of the generated file contains the
headers + data

Test plan:
1/ choose a language and update + translate the templates
for instance:
  cd misc/translate;
  ./translate update es-ES; ./translate install es-ES
2/ Go to the item search form using this language
3/ Launch a search and select CSV to display the results.
The CSV headers should be correct

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  Seen the bug. Works as described.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2015-05-31 20:32:42 UTC
Thx for the quick fix!
Comment 14 Tomás Cohen Arazi 2015-06-04 13:18:52 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 15 Chris Cormack 2015-06-07 07:58:50 UTC
Pushed to 3.20.x will be in 3.20.1
Comment 16 Liz Rea 2015-08-04 01:37:37 UTC
Pushed to 3.18.x, will be in 3.18.10.