[Bug 21123] New: Patron card create doesn't print barcodes with Code39 + Modulo
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21123 Bug ID: 21123 Summary: Patron card create doesn't print barcodes with Code39 + Modulo Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Label/patron card printing Assignee: cnighswonger@foundations.edu Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org I've tested in 16.11, 17.11 and on master and Code39+Module43 and Code39+Modulo10 are not printing for me, while just Code39 works fine. When exporting, the PDF is not created, instead a yellow error message is shown: WARNING: Error while creating PDF file. Batch: 1 Layout: 22 Template: 26 Please have your system administrator check the error log for details. koha-plack-err does show a lot of those: CGI::param called in list context from package Template::Document line 20, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436. CGI::param called in list context from package Template::Document line 13, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436. CGI::param called in list context from package Template::Document line 14, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436. I've tested with the sample patrons, who have numerical cardnumbers like: Pamela Bennett, 23529000318858 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21123 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Patron card create doesn't |Patron card creator doesn't |print barcodes with Code39 |print barcodes with Code39 |+ Modulo |+ Modulo -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21123 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=20084 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21123 --- Comment #1 from Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> --- Created attachment 202135 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202135&action=edit Bug 21123: Fix patron card creator crash on CODE39MOD/CODE39MOD10 barcodes C4::Patroncards::Patroncard::_draw_barcode() calls CheckDigits('code_39') and CheckDigits('siret') for the CODE39MOD and CODE39MOD10 barcode types but the module never imports Algorithm::CheckDigits (compare C4::Labels::Label, which does). Both calls sit outside the internal eval guarding the PDF::Reuse::Barcode call, so selecting either checksum barcode type in a patron card layout dies at runtime: Undefined subroutine &C4::Patroncards::Patroncard::CheckDigits called at C4/Patroncards/Patroncard.pm line 435. Add the missing import. Test plan: 1) Without this patch, apply Bug 41719 and run: prove t/db_dependent/Patroncards/t_Patroncard.t -- the draw_barcode() subtest fails on CODE39MOD and CODE39MOD10 with the "Undefined subroutine" error above 2) Apply this patch and re-run -- all tests pass 3) Or reproduce manually: create a patron card layout using barcode type CODE39MOD (or CODE39MOD10) and export a batch; without this patch the export dies, with it the PDF renders AI Assistance: The defect was surfaced by Claude Fable 5 (Anthropic) during review of the Bug 41719 rendering test coverage, which found the unimported CheckDigits calls by comparing the Labels and Patroncards barcode paths. Claude Fable 5 drafted this fix and verified it against the Bug 41719 test suite in koha-testing-docker. Human author reviewed and approved the change. Assisted-by: Claude Fable 5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21123 --- Comment #2 from Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> --- Reproduced on current main in koha-testing-docker (PDF::Reuse 0.43), using the same code path patroncards/create-pdf.pl takes (Patroncard->new + draw_barcode): CODE39 draw_barcode: OK pdf bytes: 2861 CODE39MOD draw_barcode: DIES Undefined subroutine &C4::Patroncards::Patroncard::CheckDigits called at C4/Patroncards/Patroncard.pm line 434. CODE39MOD10 draw_barcode: DIES same, line 437 Root cause: C4::Patroncards::Patroncard calls CheckDigits() for the two checksum barcode types but never imports Algorithm::CheckDigits (C4::Labels::Label has the import; Patroncard.pm does not). The die aborts create-pdf.pl before the PDF is written, which matches comment 0 exactly: plain Code39 fine, both Modulo variants produce no PDF and the yellow "Error while creating PDF file" warning. The import was already missing in the 2016-2018 trees, so this is the same defect Katrin reported. With the missing import added, all three variants render (verified in the same environment; the checksum types produce a 3079-byte PDF vs 2861 for plain Code39, consistent with the added check digit). Patch attached. Test coverage for this code path is added by Bug 41719, whose patroncard draw_barcode() subtest fails on exactly these two types until this fix is applied. Bug 43095, which I filed for this defect before finding this older report, will be marked as a duplicate of this bug. (Reproduction and patch developed with AI assistance; full disclosure in the commit message.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21123 Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris.nighswonger@veritassu | |peraitsolutions.com --- Comment #3 from Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> --- *** Bug 43095 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21123 Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21123 Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41719 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41719 [Bug 41719] Add rendering test coverage for Labels and Patroncards -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21123 --- Comment #4 from Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> --- For the QA audit trail: the attached patch was staged and reviewed internally at https://github.com/cnighswonger/koha-wip/pull/2 (opened under the duplicate Bug 43095's number before this older report was found). -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org