https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21123

--- Comment #1 from Chris Nighswonger 
<[email protected]> ---
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.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to