[Bug 43095] New: Patron card creator dies on CODE39MOD and CODE39MOD10 barcode types (missing Algorithm::CheckDigits import)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43095 Bug ID: 43095 Summary: Patron card creator dies on CODE39MOD and CODE39MOD10 barcode types (missing Algorithm::CheckDigits import) Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Label/patron card printing Assignee: chris.nighswonger@veritassuperaitsolutions.com Reporter: chris.nighswonger@veritassuperaitsolutions.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- C4::Patroncards::Patroncard::_draw_barcode() calls CheckDigits('code_39') and CheckDigits('siret') for the CODE39MOD and CODE39MOD10 barcode types (Patroncard.pm lines 434 and 437), but the module never imports Algorithm::CheckDigits. Compare C4::Labels::Label, which has: use Algorithm::CheckDigits qw( CheckDigits ); at line 7. C4::Patroncards::Patroncard has no such line. Both CheckDigits() calls sit *outside* the internal eval that guards the PDF::Reuse::Barcode call (the eval begins at line 440), 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 434. To reproduce: create a patron card layout with barcode type CODE39MOD (or CODE39MOD10) and print/export a batch, or run the extended t/db_dependent/Patroncards/t_Patroncard.t from Bug 41719, whose draw_barcode() subtest exercises all five supported barcode types and fails on these two. The fix is a one-line import. This was surfaced by the rendering test coverage work on Bug 41719, which will depend on this bug so its barcode-type coverage passes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43095 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=43095 --- Comment #1 from Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> --- Created attachment 202133 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202133&action=edit Bug 43095: 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=43095 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=43095 Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202133|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43095 Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|Needs Signoff |RESOLVED --- Comment #2 from Chris Nighswonger <chris.nighswonger@veritassuperaitsolutions.com> --- Same defect as the much older Bug 21123 (found after filing). Patch re-attached there; marking this as the duplicate. Bug 41719 test coverage now references 21123. *** This bug has been marked as a duplicate of bug 21123 *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43095 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.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org