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.
Created attachment 168951 [details] [review] Proposed patch
This might also fix Bug 21123 (not tested).
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.
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.
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?
Created attachment 169011 [details] [review] Proposed patch Fixed missing CheckDigits for CODE39 (forgot import), tested that Bug 21123 is now also solved.
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.