Bug 37356 - Patroncards barcode do not support EAN13
Summary: Patroncards barcode do not support EAN13
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Chris Nighswonger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-14 19:59 UTC by wolfgang.apolinarski
Modified: 2024-07-15 17:51 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Proposed patch (19.46 KB, patch)
2024-07-14 20:15 UTC, wolfgang.apolinarski
Details | Diff | Splinter Review
Proposed patch (19.67 KB, patch)
2024-07-15 16:53 UTC, wolfgang.apolinarski
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description wolfgang.apolinarski 2024-07-14 19:59:37 UTC
While testing and installing Koha, I figured out that while EAN13 works on labels of items in the catalog (like books), it does not work for patron cards at all.

When looking at the code, I saw that the barcode generation code is duplicated in label printing and patron card printing.

Because of that EAN13 is not supported with patron card printing, yet.

I created a patch to fix that, because of my very limited Perl skills someone has to look at it, first. I tested it successfully in my Koha instance.
Comment 1 wolfgang.apolinarski 2024-07-14 20:15:59 UTC
Created attachment 168951 [details] [review]
Proposed patch
Comment 2 wolfgang.apolinarski 2024-07-14 20:17:51 UTC
This might also fix Bug 21123 (not tested).
Comment 3 Chris Nighswonger 2024-07-14 20:34:38 UTC
I'm not sure I understand the need for the proposed refactor. EAN13 is supported for both labels and cards.

Plaese add more details as to how to reproduce the problem you are having.
Comment 4 Chris Nighswonger 2024-07-14 20:49:35 UTC
Okay. EAN13 isn't supported in patron cards. My bad. EAN13 was added to labels after my work.

However, it would be better at this point to duplicate the EAN13 code from label.pm in patroncards.pm as this touches much less code.

There's a lot of cut and paste between these two scripts and they both need refactoring extensively.
Comment 5 wolfgang.apolinarski 2024-07-14 20:54:24 UTC
Thank you for your fast reaction!

Should I just copy the code then from one class to the other? I actually considered that bad practice that is why I did not want to do that.

Or would you create a patch, since you are the expert anyway?
Comment 6 wolfgang.apolinarski 2024-07-15 16:53:06 UTC
Created attachment 169011 [details] [review]
Proposed patch

Fixed missing CheckDigits for CODE39 (forgot import), tested that Bug 21123 is now also solved.
Comment 7 Chris Nighswonger 2024-07-15 17:51:34 UTC
This still introduces complication and provides an incomplete solution.

If we are going to extract the barcode drawing code, we should be consistent and port this to the patron card code as well.

All things considered, it is less complicated and less likely to introduce unintentional bugs to just paste over the small code block from labels to address the EAN13 option in patron cards.