Summary: | Fix item search CSV export | ||
---|---|---|---|
Product: | Koha | Reporter: | Fridolin Somers <fridolin.somers> |
Component: | Cataloging | Assignee: | Fridolin Somers <fridolin.somers> |
Status: | CLOSED FIXED | QA Contact: | Victor Grousset/tuxayo <victor> |
Severity: | normal | ||
Priority: | P5 - low | CC: | 1joynelson, andrew, caroline.cyr-la-rose, m.de.rooy, maura.stephens, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.05.00,20.11.02,20.05.08
|
|
Circulation function: | |||
Attachments: |
Bug 27164: Double quotes everywhere in item search CSV export
Bug 27164: Fix item search CSV export Bug 27164: Fix item search CSV export item search export Bug 27164: Fix item search CSV export Bug 27164: Fix item search CSV export Bug 27164: Fix item search CSV export Bug 27164: Fix item search CSV export |
Description
Fridolin Somers
2020-12-07 15:59:29 UTC
Created attachment 114233 [details] [review] Bug 27164: Double quotes everywhere in item search CSV export In item search CSV export, data cells are exported with double quotes. There should also be double quotes in header cells. Also some spaces can be removed. This may help to open the CSV with any table/calc software. Test plan : 1.0) Without patch 1.1) Perform an item search 1.2) Export as a CSV file and save the file locally 1.3) Open the file with a table/calc software 2.0) Apply patch 2.1) Perform same item search 2.2) Export as a CSV file and save the file locally 2.3) Open the file with a table/calc software 3.0) Compare files with diff/meld => you see only double quotes arround header cells and removal of space after coma 3.1) In table/calc software they should look the same Oh there are more problems Created attachment 114261 [details] [review] Bug 27164: Fix item search CSV export In item search CSV export, data cells are exported with double quotes. There should also be double quotes in header cells. Also some spaces can be removed. Delimiter must be from system preference 'delimiter'. TT filter must be $raw not html, only double quotes must be espaped by duplication of it. This may help to open the CSV with any table/calc software. Test plan : 1.0) Create a record with title : Laurel & "Hardy" 1.2) Create an item on this record 2.0) Without patch 2.1) Perform an item search on title 'Laurel' 2.2) Export as a CSV file and save the file locally 2.3) Open the file with a table/calc software 3.0) Apply patch 3.1) Perform same item search 3.2) Export as a CSV file and save the file locally 3.3) Open the file with a table/calc software 4.0) Compare files with diff/meld => you see only double quotes arround header cells and removal of space after coma 4.1) Check that delimiter is from system preference 'delimiter' 4.2) In table/calc software they should look the same Created attachment 114262 [details] [review] Bug 27164: Fix item search CSV export In item search CSV export, data cells are exported with double quotes. There should also be double quotes in header cells. Also some spaces can be removed. Delimiter must be from system preference 'delimiter'. TT filter must be $raw not html, only double quotes must be espaped by duplication of it. This may help to open the CSV with any table/calc software. Test plan : 1.0) Create a record with title : Laurel & "Hardy" 1.2) Create an item on this record 2.0) Without patch 2.1) Perform an item search on title 'Laurel' 2.2) Export as a CSV file and save the file locally 2.3) Open the file with a table/calc software 3.0) Apply patch 3.1) Perform same item search 3.2) Export as a CSV file and save the file locally 3.3) Open the file with a table/calc software 4.0) Compare files with diff/meld => you see only double quotes arround header cells and removal of space after coma 4.1) Check that delimiter is from system preference 'delimiter' 4.2) In table/calc software they should look the same Created attachment 114268 [details]
item search export
I'm still getting double quotes around everything in my export. The delimiter changed, though!
*** Bug 14169 has been marked as a duplicate of this bug. *** You have : "Laurel & ""Hardy""";"";"";"";"q35y";"";"Centerville";... What is wrong ? delimiter was hardcoded "," now its from system preference named "delimiter". Looks like you have ";" in this preference. Thanks a lot for testing BTW :D > 4.0) Compare files with diff/meld
> => you see only double quotes arround header cells
> and removal of space after coma
I thought from your test plan that I should not have double quotes around each data field after the patch. I was expecting:
"Title";"Publication date";"Publisher"; ...
Laurel & "Hardy";;;...
Did I just misunderstand the plan?
Created attachment 114315 [details] [review] Bug 27164: Fix item search CSV export In item search CSV export, data cells are exported with double quotes. There should also be double quotes in header cells. Also some spaces can be removed. Delimiter must be from system preference 'delimiter'. TT filter must be $raw not html, only double quotes must be espaped by duplication of it. This may help to open the CSV with any table/calc software. Test plan : 1.0) Create a record with title : Laurel & "Hardy" 1.2) Create an item on this record 2.0) Without patch 2.1) Perform an item search on title 'Laurel' 2.2) Export as a CSV file and save the file locally 2.3) Open the file with a table/calc software 3.0) Apply patch 3.1) Perform same item search 3.2) Export as a CSV file and save the file locally 3.3) Open the file with a table/calc software 4.0) Compare files with diff/meld => you see double quotes arround header cells and removal of space after coma 4.1) Check that delimiter is from system preference 'delimiter' 4.2) In table/calc software they should look the same My bad ;) Test plan fixed : 4.0) Compare files with diff/meld => you see double quotes arround header cells Created attachment 114687 [details] [review] Bug 27164: Fix item search CSV export In item search CSV export, data cells are exported with double quotes. There should also be double quotes in header cells. Also some spaces can be removed. Delimiter must be from system preference 'delimiter'. TT filter must be $raw not html, only double quotes must be espaped by duplication of it. This may help to open the CSV with any table/calc software. Test plan : 1.0) Create a record with title : Laurel & "Hardy" 1.2) Create an item on this record 2.0) Without patch 2.1) Perform an item search on title 'Laurel' 2.2) Export as a CSV file and save the file locally 2.3) Open the file with a table/calc software 3.0) Apply patch 3.1) Perform same item search 3.2) Export as a CSV file and save the file locally 3.3) Open the file with a table/calc software 4.0) Compare files with diff/meld => you see double quotes arround header cells and removal of space after coma 4.1) Check that delimiter is from system preference 'delimiter' 4.2) In table/calc software they should look the same Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Thanks for clarifying! Hi :) Much needed improvements and I get better results by default on LibreOffice. The only issue found is about removing the space between title and author. Here is an example: "Laurel & ""Hardy""Hammarberg, Marcus." without quotes to Hardy, I would get "Laurel & HardyHammarberg, Marcus." Other examples 'More fruitful than the soil' :Mackillop, Andrew. "A Hegel dictionary /Inwood, Michael," "A tribute to Jack JohnsonDavis, Miles," The table HTML view and the detail page of the record insert a space between title and author. So it seems pretty sure we need to have that here. Which also means the "by" in UNIMARC case don't need a space before and after, otherwise the space will be duplicated. Created attachment 114776 [details] [review] Bug 27164: Fix item search CSV export In item search CSV export, data cells are exported with double quotes. There should also be double quotes in header cells. Also some spaces can be removed. Delimiter must be from system preference 'delimiter'. TT filter must be $raw not html, only double quotes must be espaped by duplication of it. This may help to open the CSV with any table/calc software. Test plan : 1.0) Create a record with title : Laurel & "Hardy" 1.2) Create an item on this record 2.0) Without patch 2.1) Perform an item search on title 'Laurel' 2.2) Export as a CSV file and save the file locally 2.3) Open the file with a table/calc software 3.0) Apply patch 3.1) Perform same item search 3.2) Export as a CSV file and save the file locally 3.3) Open the file with a table/calc software 4.0) Compare files with diff/meld => you see double quotes arround header cells and removal of space after coma 4.1) Check that delimiter is from system preference 'delimiter' 4.2) In table/calc software they should look the same (In reply to Victor Grousset/tuxayo from comment #15) > Hi :) > > Much needed improvements and I get better results by default on LibreOffice. > > The only issue found is about removing the space between title and author. > > Here is an example: > "Laurel & ""Hardy""Hammarberg, Marcus." > without quotes to Hardy, I would get > "Laurel & HardyHammarberg, Marcus." > > Other examples > > 'More fruitful than the soil' :Mackillop, Andrew. > "A Hegel dictionary /Inwood, Michael," > "A tribute to Jack JohnsonDavis, Miles," > > The table HTML view and the detail page of the record insert a space between > title and author. So it seems pretty sure we need to have that here. > Which also means the "by" in UNIMARC case don't need a space before and > after, otherwise the space will be duplicated. Good catch, I see it in my patch indeed. Trival change so I changed the main patch and went to "Signed Off" Created attachment 114934 [details] [review] Bug 27164: Fix item search CSV export In item search CSV export, data cells are exported with double quotes. There should also be double quotes in header cells. Also some spaces can be removed. Delimiter must be from system preference 'delimiter'. TT filter must be $raw not html, only double quotes must be espaped by duplication of it. This may help to open the CSV with any table/calc software. Test plan : 1.0) Create a record with title : Laurel & "Hardy" 1.2) Create an item on this record 2.0) Without patch 2.1) Perform an item search on title 'Laurel' 2.2) Export as a CSV file and save the file locally 2.3) Open the file with a table/calc software 3.0) Apply patch 3.1) Perform same item search 3.2) Export as a CSV file and save the file locally 3.3) Open the file with a table/calc software 4.0) Compare files with diff/meld => you see double quotes arround header cells and removal of space after coma 4.1) Check that delimiter is from system preference 'delimiter' 4.2) In table/calc software they should look the same Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.02 Pushed to 20.05.x for 20.05.08 Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. |