[Bug 8168] New: ersatz CSV header in attachment of overdue notices sent to administrator
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Priority: P5 - low Change sponsored?: --- Bug ID: 8168 Assignee: henridamien@koha-fr.org Summary: ersatz CSV header in attachment of overdue notices sent to administrator Severity: minor Classification: Unclassified OS: All Reporter: gmcharlt@gmail.com Hardware: All Status: NEW Version: master Component: Notices Product: Koha overdue_notices.pl sends an email to the Koha admin with any notices that should be printed as an attachment. However, if the attachment contains printable notices, rather than CSV, the first line of the attachment still includes a CSV header: title;name;surname;address1;address2;zipcode;city;email;itemcount;itemsinfo;due_date;issue_date There are two problems with this: [1] This header shouldn't be included unless CSV output was specifically requested (by use of the -csv) switch. [2] The header does not respect the delimiter and tabulation system preferences -- it always uses a semicolon. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nengard@gmail.com --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- *** Bug 8690 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Sophie MEYNIEUX <sophie.meynieux@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sophie.meynieux@biblibre.co | |m --- Comment #2 from Sophie MEYNIEUX <sophie.meynieux@biblibre.com> --- This problem was introduced by http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5098 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Daniel Barker <daniel.barker.nz@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 --- Comment #3 from Daniel Barker <daniel.barker.nz@gmail.com> --- Created attachment 24321 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24321&action=edit Bug:8168 Fixing header of non csv files 1. make some overdues books 2. run the overdue notices script without the -csv 3. check emails notice csv header is in the email 4. apply the patch 5. run the overdue notice again 6. check email notice csv header is absent -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 --- Comment #4 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 24321 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24321 Bug:8168 Fixing header of non csv files Review of attachment 24321: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=8168&attachment=24321) ----------------------------------------------------------------- ::: misc/cronjobs/overdue_notices.pl @@ +628,5 @@
} # Generate the content of the csv with headers + my $content; + if ( defined $csvfilename ) { + $content = join(";", qw(title name surname address1 address2 zipcode city country email itemcount itemsinfo due_date issue_date)) . "\n";
You missed Galen's second comment. The ";" should refer to C4::Context->preference('delimiter') I believe. You also have tab issues. @@ +634,5 @@
+ else { + $content = ""; + } + $content .= join( "\n", @output_chunks ); +
This should be a blank line, not something with a tab or spaces. mtompset@ubuntu:~/kohaclone$ koha-qa.pl -v 2 -c 1 testing 1 commit(s) (applied to 1cc0d7b 'Bug 10907: (follow-up) fix table sort') FAIL misc/cronjobs/overdue_notices.pl OK pod FAIL forbidden patterns forbidden pattern: tab char (line 637) forbidden pattern: tab char (line 633) forbidden pattern: tab char (line 630) forbidden pattern: tab char (line 635) forbidden pattern: tab char (line 631) forbidden pattern: tab char (line 636) forbidden pattern: tab char (line 634) forbidden pattern: tab char (line 632) OK valid OK critic -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24321|0 |1 is obsolete| | --- Comment #5 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24656 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24656&action=edit Bug 8168 - Fixing header of non csv files This determines if the CSV header should be included or not and then generates it as needed using the delimiter specified in the delimiter system preference. TEST PLAN --------- 1. make some overdues books 2. run the overdue notices script without the -csv 3. check emails notice csv header is in the email 4. apply the patch 5. run the overdue notice again 6. check email notice csv header is absent Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #6 from M. Tompsett <mtompset@hotmail.com> --- Since I fixed what I reported wrong, some one else will need to sign off on this. :) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24656|0 |1 is obsolete| | --- Comment #7 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 24665 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24665&action=edit Bug 8168 - Fixing header of non csv files This determines if the CSV header should be included or not and then generates it as needed using the delimiter specified in the delimiter system preference. TEST PLAN --------- 1. make some overdues books 2. run the overdue notices script without the -csv 3. check emails notice csv header is in the email 4. apply the patch 5. run the overdue notice again 6. check email notice csv header is absent Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |jonathan.druart@biblibre.co | |m --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- There is already a call to the syspref delimiter in this script: my $sep_char = C4::Context->preference('delimiter') || ','; vs yours: my $delimiter = C4::Context->preference('delimiter') // ';'; I think we should use the same default delimiter. Marked as Failed QA. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 24675 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24675&action=edit Bug 8168 - Use comma as default delimiter -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 --- Comment #10 from M. Tompsett <mtompset@hotmail.com> --- installer/data/mysql/sysprefs.sql has a default value of semicolon. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24675|0 |1 is obsolete| | --- Comment #11 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24680 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24680&action=edit Bug 8168 - Use semicolon as default delimiter installer/data/mysql/sysprefs.sql has semicolon as default. This fixes both instances to use the same fallback value. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24680|0 |1 is obsolete| | --- Comment #12 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24681 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24681&action=edit Bug 8168 - Use semicolon as default delimiter installer/data/mysql/sysprefs.sql has semicolon as default. This fixes both instances to use the same fallback value. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 wajasu <matted-34813@mypacks.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24665|0 |1 is obsolete| | CC| |matted-34813@mypacks.net --- Comment #13 from wajasu <matted-34813@mypacks.net> --- Created attachment 25874 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25874&action=edit SIGNED-OFF Bug-8168-Fixing-header-of-non-csv-files -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 wajasu <matted-34813@mypacks.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24681|0 |1 is obsolete| | --- Comment #14 from wajasu <matted-34813@mypacks.net> --- Created attachment 25875 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25875&action=edit SIGNED-OFF-Bug-8168-Use-semicolon-as-default-delimit Tested both patches. Observed behavior of what was written to message_queue after running overdue_notices.pl with some overdue checked out books. Default delimeter of semicolon is aligned with sysprefs value; -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 wajasu <matted-34813@mypacks.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Assignee|koha-bugs@lists.koha-commun |daniel.barker.nz@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25874|0 |1 is obsolete| | Attachment #25875|0 |1 is obsolete| | --- Comment #15 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 26413 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26413&action=edit Bug 8168 - Fixing header of non csv files This determines if the CSV header should be included or not and then generates it as needed using the delimiter specified in the delimiter system preference. TEST PLAN --------- 1. make some overdues books 2. run the overdue notices script without the -csv 3. check emails notice csv header is in the email 4. apply the patch 5. run the overdue notice again 6. check email notice csv header is absent Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: wajasu <matted-34813@mypacks.net> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 --- Comment #16 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 26414 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26414&action=edit Bug 8168 - Use semicolon as default delimiter installer/data/mysql/sysprefs.sql has semicolon as default. This fixes both instances to use the same fallback value. It also prevents csv header info from being included in non-CSV messages. Signed-off-by: wajasu <matted-34813@mypacks.net> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #17 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. This appears to be the first patch of yours accepted into Koha master -- congratulations, Daniel! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |fridolyn.somers@biblibre.co | |m --- Comment #18 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Pushed to 3.14.x, will be in 3.14.08 a ; nice ; correction ; thanks ;) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8168 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #19 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 3.12.x, will be in 3.12.13 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org