It seems that the module doesn't work properly for UPC-A barcodes. All I did was enter "123456789012", and the resulting image shows up as "234567890128", even though the original number shows up correctly when I hover my mouse over the image.

So I tried the same thing with an EAN-13 barcode, entering "1234567890123", and verified that the resulting image does show up properly as "1234567890123", exactly the same as when I hover my mouse over the image. This is to verify that the module works properly for at least one type of barcode, and that it wasn't something that I did wrong on my end.

I attached a couple of screenshots for reference. Am I the only one having a problem with UPC-A barcodes?

Comments

wwwjaylee created an issue. See original summary.

skyredwang’s picture

Category: Bug report » Support request

The 12th digit of UPC-A is reserved for the sum. You are supposed to only input the first 11 digits.

jay.lee.bio’s picture

@skyredwang, it won't let me input 11 digits. I get the following error message instead:

"UPC-A code must have 12 digits."

Any ideas?

brandonratz’s picture

@wwwjaylee Are you still having this issue? I confirm, UPC-A is removing the first number when generating a png/gif/jpeg. The code both scans incorrectly and prints incorrectly.

12 digits is required in the UPC-A code field.

brandonratz’s picture

The functionality here is correct.

Researching UPC-A code spec you'll find that the barcode itself displays 12 digits. However, the data input required to achieve the correct barcode output includes the "identifying numbering system" being used. This is the first number in the string of numbers. For example, 0 implies a "regular UPC code". Simply adding "0" to the front of my existing UPC-A codes generates the codes correctly.

http://www.makebarcode.com/specs/upc_a.html

Update:
Since the field requires no more than 12 digits I had to adjust the module code to allow for the 13th digit (the first 0). I'll report back with the exact change.

It is my belief the UPC-A code input should be the same code in the generated barcode. This was not the case throughout my testing without adding the "suffix" digit of "0".

jay.lee.bio’s picture

@brandonratz, yes I'm still having this issue. The module should just spit out the same output as the input, period. If a user inputs the numbers wrong so that the 12th digit doesn't match whatever it should be, then the module should just spit out an error message until the user gets them right. Otherwise I think there will always be a UI / UX issue.

tr’s picture

Status: Active » Closed (won't fix)

This module is no longer supported. I suggest you try using the Barcodes module instead (https://www.drupal.org/project/barcodes)

Barcodes is very similar to this module, and is supported for Drupal 7, 8, and 9.