We have a 3rd party event manager who scans bar codes, so it is great that civiCRM renders barcodes on events.

Our problem is that the 3rd party cannot process a barcode that contains a hyphen. For the event badge, we see that the barcode contains the contactID-registrationID

How can we remove the hyphen from the barcode?

We running version 4.7.16 on Joomla 3.6.5


A better approach would probably to use the Barcode hook and alter the value in there instead of overriding the core file.



I found on the page /administrator/components/com_civicrm/civicrm/CRM/Badge/BAO/Badge.php

line 273:

$data['current_value'] = $formattedRow['values']['contact_id'] . '-' . $formattedRow['values']['participant_id'];

I changed that to:

$data['current_value'] = $formattedRow['values']['contact_id'] . $formattedRow['values']['participant_id'];

removing the hyphen '-'.

I realize that is a hack since it affects core...

Any suggestions for a better approach?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.