Bug 33050 - Allow to specify quote char in runreport.pl
Summary: Allow to specify quote char in runreport.pl
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Fridolin Somers
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 33285
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-23 06:19 UTC by Fridolin Somers
Modified: 2023-12-18 20:49 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/795
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.06
Circulation function:


Attachments
Bug 33050: More args for misc/cronjobs/runreport.pl (2.31 KB, patch)
2023-02-23 06:43 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 33050: More args for misc/cronjobs/runreport.pl (1.71 KB, patch)
2023-02-23 06:57 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 33050: Allow to specify quote char in runreport.pl (2.59 KB, patch)
2023-06-21 08:23 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 33050: Allow to specify quote char in runreport.pl (2.64 KB, patch)
2023-09-24 06:20 UTC, David Nind
Details | Diff | Splinter Review
Bug 33050: Allow to specify quote char in runreport.pl (2.70 KB, patch)
2023-11-01 18:41 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33050: Perltidy (3.01 KB, patch)
2023-11-01 18:42 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 Fridolin Somers 2023-02-23 06:19:21 UTC
Add to script misc/cronjobs/runreport.pl args for CSV : separator and quote
Comment 1 Fridolin Somers 2023-02-23 06:25:07 UTC
cf https://metacpan.org/pod/Text::CSV#new
Comment 2 Fridolin Somers 2023-02-23 06:43:07 UTC
Created attachment 147187 [details] [review]
Bug 33050: More args for misc/cronjobs/runreport.pl

Add to script misc/cronjobs/runreport.pl args for CSV :
  * separator character
  * quote character
  * no quote (by default double quote)

See perl doc https://metacpan.org/pod/Text::CSV#new

Test plan :
Play with each arg and compare results of runreport.pl
Comment 3 Fridolin Somers 2023-02-23 06:57:41 UTC
Created attachment 147188 [details] [review]
Bug 33050: More args for misc/cronjobs/runreport.pl

Add to script misc/cronjobs/runreport.pl args for CSV :
  * separator character
  * quote character

See perl doc https://metacpan.org/pod/Text::CSV#new

Test plan :
Play with each arg and compare results of runreport.pl
Comment 4 Fridolin Somers 2023-03-31 20:25:40 UTC
I will change this to deal only with quote once Bug 33285 is pushed
Comment 5 Fridolin Somers 2023-06-21 08:23:48 UTC
Created attachment 152499 [details] [review]
Bug 33050: Allow to specify quote char in runreport.pl

Add to script misc/cronjobs/runreport.pl quote char arg (only for CSV).
See perl doc https://metacpan.org/pod/Text::CSV#new

This patch also adds missing '--separator' in POD.

Test plan :
1 - Write a SQL report
2 - perl misc/cronjobs/runreport.pl --format csv 1 (or correct report number)
3 - Note you get double quotes
4 - Apply patch
5 - Repeat #2 - no change
6 - perl misc/cronjobs/runreport.pl --format csv --quote "'" 1
7 - Now it is single quote delimited
8 - perl misc/cronjobs/runreport.pl --format tsv --separator "'" 1
9 - Error is reported, you cannot set quote unless csv
10 - Try empty string as quote
Comment 6 Fridolin Somers 2023-06-21 08:24:56 UTC
Patch revisited and better test plan
Comment 7 David Nind 2023-09-24 06:20:20 UTC
Created attachment 156133 [details] [review]
Bug 33050: Allow to specify quote char in runreport.pl

Add to script misc/cronjobs/runreport.pl quote char arg (only for CSV).
See perl doc https://metacpan.org/pod/Text::CSV#new

This patch also adds missing '--separator' in POD.

Test plan :
1 - Write a SQL report
2 - perl misc/cronjobs/runreport.pl --format csv 1 (or correct report number)
3 - Note you get double quotes
4 - Apply patch
5 - Repeat #2 - no change
6 - perl misc/cronjobs/runreport.pl --format csv --quote "'" 1
7 - Now it is single quote delimited
8 - perl misc/cronjobs/runreport.pl --format tsv --separator "'" 1
9 - Error is reported, you cannot set quote unless csv
10 - Try empty string as quote

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 Katrin Fischer 2023-11-01 18:41:59 UTC
Created attachment 158207 [details] [review]
Bug 33050: Allow to specify quote char in runreport.pl

Add to script misc/cronjobs/runreport.pl quote char arg (only for CSV).
See perl doc https://metacpan.org/pod/Text::CSV#new

This patch also adds missing '--separator' in POD.

Test plan :
1 - Write a SQL report
2 - perl misc/cronjobs/runreport.pl --format csv 1 (or correct report number)
3 - Note you get double quotes
4 - Apply patch
5 - Repeat #2 - no change
6 - perl misc/cronjobs/runreport.pl --format csv --quote "'" 1
7 - Now it is single quote delimited
8 - perl misc/cronjobs/runreport.pl --format tsv --separator "'" 1
9 - Error is reported, you cannot set quote unless csv
10 - Try empty string as quote

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2023-11-01 18:42:01 UTC
Created attachment 158208 [details] [review]
Bug 33050: Perltidy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Tomás Cohen Arazi (tcohen) 2023-11-08 13:06:47 UTC
Comment on attachment 158208 [details] [review]
Bug 33050: Perltidy

Skipping commit that tidies all the file.
Comment 11 Tomás Cohen Arazi (tcohen) 2023-11-08 14:42:32 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 12 Fridolin Somers 2023-11-10 21:07:51 UTC
Small enhancement, I choose to backport.

Pushed to 23.05.x for 23.05.06