[Bug 27045] New: Tabulation in CSV profile for lost items doesn't export correctly
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Bug ID: 27045 Summary: Tabulation in CSV profile for lost items doesn't export correctly Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Reports Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org When choosing tabulation as the delimiter on a CSV profile for the lost item report, it's exported as shown below: title\tauthor\tstocknumber\tcallnumber "E Street shuffle :"\"Heylin, Clinton."\\ Tabs works best as default for Excel, so it would be great to see this fixed. Reads similar like other older closed bugs like bug 17590 and bug 7251. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Originally found in 20.05.03, but confirmed in master now. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 113890 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113890&action=edit Bug 27045: Fix items lost report export if delimiter is tab -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 113891 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113891&action=edit Bug 27045: Fix other exports -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Hum, I lost myself. I first thought it was because we were not using Text::CSV::Encoded. But found (after I rewrote itemslost.pl export) that it was because of the way we handle "\t". I think those 2 patches fixes the problem for all the CSV exports, but have only tried with itemslost so far. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=17590, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=7251 CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Is this ready for testing now? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I don't know, see previous comment. Feel free to test it! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #7 from Fridolin Somers <fridolin.somers@biblibre.com> --- my $delimiter = $csv_profile->csv_separator; $delimiter = "\t" if $delimiter eq "\\t"; Ah strange : In system preference stored value is string "tabulation" : https://git.koha-community.org/Koha-community/Koha/src/commit/99c10bf4484635... We see in other places : $delimiter = "\t" if $delimiter eq 'tabulation'; https://git.koha-community.org/Koha-community/Koha/src/commit/65542edbe021d5... Looks like use of CSVdelimiter is wrong in many places where preference is fetched in TT. I create a new bug report for that. Maybe we shoud add a method C4::Context->csv_delimiter() ? And add a method to TT plugin. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28327 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- In this case it's independent of the preference - for CSV profile the delimiter is chosen in configuration. But in general both (pref and CSV profiles) need fixing. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113890|0 |1 is obsolete| | --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 137790 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137790&action=edit Bug 27045: Fix items lost report export if delimiter is tab When choosing tabulation as the delimiter for a CSV profile for the lost item report, the tabs appear in the file as \t instead of as proper tabs. title\tauthor\tstocknumber\tcallnumber "E Street shuffle :"\"Heylin, Clinton."\\ To test: * Upate the existing sample lost item CSV profile to use tabs as separator * Make sure you have some lost items in your database or create some * Go to Reports > Lost items * Run the report * Check all or some of the checkboxes in the result list * Export using the link on top and the CSV profile * Verify the tabs are not exported correctly * Apply patch * Verify tabs now are proper tabs instead of \t -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 137791 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137791&action=edit Bug 27045: Fix other exports using CSV profiles This patch corrects the export of the 2 other reports using CSV profiles: * Late issues (serials) * Basket (acquisitions) To test: 1) Late issues * Update the late issues sample report to use tab as separator * Create a subscription * Go to serial collection and 'generate next' to get some late issues * Go to Claims * Export the late issues and verify format is correct * Verify exported file has tabs 2) Basket summary * Create an order with several order lines * Create an SQL type CSV profile for basket export using tab as separator Example: aqorders.quantity|aqordres.listprice|Title=biblio.title * Export the basket using your configured CSV profile * Verify exported file has tabs -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113891|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Joubu, I've rebased the patch set, cleaned up the descriptions and added test plans. There is only one problem: this works almost perfectly, but the header rows for the basket and late serial issues still show the \t, while the data has the proper tabs. Example: aqorders.quantity\taqordres.listprice\tTitle 1 12.000000 "Perl best practices /" Could you help? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart+koha@gmail. |ity.org |com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137790|0 |1 is obsolete| | --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 137792 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137792&action=edit Bug 27045: Fix items lost report export if delimiter is tab When choosing tabulation as the delimiter for a CSV profile for the lost item report, the tabs appear in the file as \t instead of as proper tabs. title\tauthor\tstocknumber\tcallnumber "E Street shuffle :"\"Heylin, Clinton."\\ To test: * Upate the existing sample lost item CSV profile to use tabs as separator * Make sure you have some lost items in your database or create some * Go to Reports > Lost items * Run the report * Check all or some of the checkboxes in the result list * Export using the link on top and the CSV profile * Verify the tabs are not exported correctly * Apply patch * Verify tabs now are proper tabs instead of \t Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137791|0 |1 is obsolete| | --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 137793 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137793&action=edit Bug 27045: Fix other exports using CSV profiles This patch corrects the export of the 2 other reports using CSV profiles: * Late issues (serials) * Basket (acquisitions) To test: 1) Late issues * Update the late issues sample report to use tab as separator * Create a subscription * Go to serial collection and 'generate next' to get some late issues * Go to Claims * Export the late issues and verify format is correct * Verify exported file has tabs 2) Basket summary * Create an order with several order lines * Create an SQL type CSV profile for basket export using tab as separator Example: aqorders.quantity|aqordres.listprice|Title=biblio.title * Export the basket using your configured CSV profile * Verify exported file has tabs Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 137794 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137794&action=edit Bug 27045: (follow-up) Fix delimiter in header rows The header rows still showed \t because the newly defined variable wasn't used there. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Katrin Fischer from comment #11)
Hi Joubu,
I've rebased the patch set, cleaned up the descriptions and added test plans. There is only one problem: this works almost perfectly, but the header rows for the basket and late serial issues still show the \t, while the data has the proper tabs.
Could you help?
Never mind - found the fix myself :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Tabulation in CSV profile |Exports using CSV profiles |for lost items doesn't |with tab as separator don't |export correctly |work correctly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137792|0 |1 is obsolete| | Attachment #137793|0 |1 is obsolete| | Attachment #137794|0 |1 is obsolete| | --- Comment #16 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 137933 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137933&action=edit Bug 27045: Fix items lost report export if delimiter is tab When choosing tabulation as the delimiter for a CSV profile for the lost item report, the tabs appear in the file as \t instead of as proper tabs. title\tauthor\tstocknumber\tcallnumber "E Street shuffle :"\"Heylin, Clinton."\\ To test: * Upate the existing sample lost item CSV profile to use tabs as separator * Make sure you have some lost items in your database or create some * Go to Reports > Lost items * Run the report * Check all or some of the checkboxes in the result list * Export using the link on top and the CSV profile * Verify the tabs are not exported correctly * Apply patch * Verify tabs now are proper tabs instead of \t Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #17 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 137934 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137934&action=edit Bug 27045: Fix other exports using CSV profiles This patch corrects the export of the 2 other reports using CSV profiles: * Late issues (serials) * Basket (acquisitions) To test: 1) Late issues * Update the late issues sample report to use tab as separator * Create a subscription * Go to serial collection and 'generate next' to get some late issues * Go to Claims * Export the late issues and verify format is correct * Verify exported file has tabs 2) Basket summary * Create an order with several order lines * Create an SQL type CSV profile for basket export using tab as separator Example: aqorders.quantity|aqordres.listprice|Title=biblio.title * Export the basket using your configured CSV profile * Verify exported file has tabs Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #18 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 137935 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137935&action=edit Bug 27045: (follow-up) Fix delimiter in header rows The header rows still showed \t because the newly defined variable wasn't used there. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #20 from Fridolin Somers <fridolin.somers@biblibre.com> --- Please have a look at Bug 28327 where I try to centralize the tabulation special case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Fridolin Somers from comment #20)
Please have a look at Bug 28327 where I try to centralize the tabulation special case.
This doesn't depend on the pref, but is a per CSV profile setting. So my impresison was they complement each other. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #22 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Katrin Fischer from comment #21)
(In reply to Fridolin Somers from comment #20)
Please have a look at Bug 28327 where I try to centralize the tabulation special case.
This doesn't depend on the pref, but is a per CSV profile setting. So my impresison was they complement each other.
In Bug 28327 I add a method csv_delimiter() that take a value to convert and fallsback to syspref if no value. So it may be used for CSV profiles. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |lucas@bywatersolutions.com Version(s)|22.11.00 |22.11.00, 22.05.05 released in| | --- Comment #23 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for 22.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00, 22.05.05 |22.11.00, 22.05.05, released in| |21.11.12 CC| |arthur.suzuki@biblibre.com Status|Pushed to stable |Pushed to oldstable --- Comment #24 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- thx pushed to 21.11.x for 21.11.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED CC| |victor@tuxayo.net --- Comment #25 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document, marking resolved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #26 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Victor Grousset/tuxayo from comment #25)
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.
Nothing to document, marking resolved.
It's needed, we noticed this in 20.11 :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 --- Comment #27 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Ok, will backport before next release :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27045 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00, 22.05.05, |22.11.00, 22.05.05, released in|21.11.12 |21.11.12, 21.05.19 --- Comment #28 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Backported: Pushed to 21.05.x branch for 21.05.19 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org