We need to print event badges in alphabetical order instead of the date registered order that you initially get from a participant search. The PDF creation completes successfully with the default sort, but after changing to alphabetical order, you get a yellow screen DB Error: unknown error. Is there a way around this? Thanks!

We are on CiviCRM 5.4.0 on Drupal 7.63

  • Could you please edit your question to say what version of CiviCRM you're using? Thanks! Feb 20, 2019 at 21:12
  • Thanks Larry! One more thing to help folks help you: Go to Administer menu » System Settings » Debugging and Error Handling. Turn on both "debug mode" and "backtrace", then repeat the steps that caused the error. The error will become much more detailed. Edit your question to include the extra details (as text, not a screenshot please!). The extra detail will help us know what's going on! Feb 20, 2019 at 22:01
  • Just tried on dmaster.demo.civicrm.org Find participants- event name=???? From results- click on participants heading to order by participant name Select all Print name badge Badges print in search result order. Just double-checking Is that your process? Issue may be fixed in upgrade, or the debug/backtrace may point to another issue in your set up. Feb 21, 2019 at 17:15
  • Yes, Craig Almond, that's what I was doing.
    – Larry K.
    Feb 22, 2019 at 2:03
  • #4..(575): DB_Error->__construct(-1, 16, (Array:2), "SELECT contact_a.id as contact_id, contact_a.image_URL as image_URL, contac...") #5..[internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, NULL, NULL, "SELECT contact_a.id as contact_id, contact_a.image_URL as image_URL, contac...", "DB_Error", TRUE) #8..1907): PEAR->raiseError(NULL, -1, NULL, NULL, "SELECT contact_a.id as contact_id, contact_a.image_URL as image_URL, contac...", "DB_Error", TRUE) #9..(933): DB_common->raiseError(-1, NULL, NULL, NULL, "1052 ** Column 'sort_name' in order clause is ambiguous")
    – Larry K.
    Feb 22, 2019 at 2:13

1 Answer 1


I confirmed that this is caused by having a name badge layout with a spacer field and sorting the participants by name prior to generating name badges. My work-around for now is to instead of using a spacer in the badge layout, to insert an unused blank field, and I can now print alphabetically sorted badges.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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