[Bug 41625] New: Add Koha::CSV::Labels for label exports
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41625 Bug ID: 41625 Summary: Add Koha::CSV::Labels for label exports Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 41619 Blocks: 41621 This bug adds Koha::CSV::Labels to standardize CSV generation for label exports. Files to update: - labels/label-create-csv.pl Benefits: - Consistent CSV formatting - Proper quote handling - Testable code Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41619 [Bug 41619] Add `Koha::CSV` https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41621 [Bug 41621] Use Koha::CSV everywhere [UMBRELLA] -- 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=41625 Bug 41625 depends on bug 41619, which changed state. Bug 41619 Summary: Add `Koha::CSV` https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41619 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- 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=41625 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Depends on| |41620 Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41620 [Bug 41620] Make itemsearch.pl use Koha::CSV for CSV generation -- 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=41625 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41625 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 203488 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203488&action=edit Bug 41625: Use Koha::CSV for label CSV exports This patch replaces direct Text::CSV_XS usage with Koha::CSV in labels/label-create-csv.pl using the low-level API (combine/string). Benefits: - CSVDelimiter system preference used consistently - formula => empty enforced (prevents formula injection) - binary => 1 always set (UTF-8 safe) - Removes direct Text::CSV_XS dependency from the script - Replaces warn with Koha::Logger The label CSV export has fully dynamic columns determined by the layout format_string at runtime, making the columns() subclass pattern unsuitable. The low-level API is the right fit here. Test plan: 1. Apply patches (depends on bug 41620) 2. Create a label batch with items 3. Go to Tools > Label creator > select batch > Export > CSV => SUCCESS: CSV generated with correct fields 4. Verify delimiter matches CSVDelimiter preference 5. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41625 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add Koha::CSV::Labels for |Use Koha::CSV for label |label exports |exports -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41625 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Failed QA --- Comment #2 from David Nind <david@davidnind.com> --- I've Failed QA. Although things worked, and the CSVDelimiter system preference is taken into account for the export, the output includes a blank line between the rows of data - the same as for Bug 41626. Example (with semicolon delimiter): "Programming Perl /";"Christiansen, Tom.";9780596004927;;Books;39999000011418; "CGI programming with Perl /";"Guelich, Scott.";1565924193;;Books;39999000000498; "Effective Perl programming :";"Hall, Joseph N.,";"9780321496942 (pbk. : alk. paper) | 0321496949 (pbk. : alk. paper)";;Books;39999000005776; "Perl template toolkit /";"Chamberlain, Darren.";0596004761;;Books;39999000011111; "Perl template toolkit /";"Chamberlain, Darren.";0596004761;;Books;39999000011135; Testing notes (using KTD): 1. Before the patch - Step 2: - Cataloging > Tools > Label creator - New > Label batch - Add these barcodes: 39999000011418 39999000000498 39999000005776 39999000011111 39999000011135 - Click "Add items" - Add a batch description (for example, BZ41625) and click "Save description" 2. Before the patch - Step 3: - From Cataloging > Tools > Label creator > Label batches . Select the checkbox for the batch in the table . Click "Export selected" . On the Label export page, select "Export" . Click "Download as CSV" . Open with a text editor - uses a comma to separate fields (quote marks used around some fields) . Repeat again with the CSVDelimiter system preference set to "tabs" - no difference Note: No header column 3. After the patch, the CSVDelimiter system preference is taken into account for the export. However, the output includes a blank line between rows of data. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org