CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Event Participant List Report and Contact Reference Fields
Pages: [1]

Author Topic: Event Participant List Report and Contact Reference Fields  (Read 1345 times)

madelynnk

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.3.8 & 4.4.4
  • CMS version: Drupal 6.31
  • MySQL version: 5.1
  • PHP version: 5.4
Event Participant List Report and Contact Reference Fields
June 12, 2012, 09:54:41 am
I've been working for a while to solve a problem I've been having with the above listed report. It was returning a db error:
[nativecode=1052 ** Column 'sort_name' in field list is ambiguous] (I posted on the forum over 30 days ago, but never received a reply).

I had two sets of custom data exposed for this report, both of which included Contact Reference/Auto-Complete fields. Upon disabling these fields, the report no longer returns the error above.

My question is this: is it not possible to use Contact Reference fields in reports? Or is this a bug?


britebyte

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 2
  • CiviCRM version: Several 3.4+, 4.1+
  • CMS version: Drupal 6, Drupal7
  • MySQL version: Several 5.1+
  • PHP version: Several 5.2+
Re: Event Participant List Report and Contact Reference Fields
June 25, 2012, 10:31:21 am
If you are referring to the built in report: "Event Participant Report (List)   Provides lists of participants for an event." then I'm pretty sure it is a bug or current limitation in the report.
When those fields are pulled into the report it uses a pre-defined flag _customGroupExtends to tell Civi to make those fields appear in the listing.
You can probably replicate the error on the civicrm demo by creating similar custom groups and running the report. I would try to do that and then file the steps to do so in a bug report.

madelynnk

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.3.8 & 4.4.4
  • CMS version: Drupal 6.31
  • MySQL version: 5.1
  • PHP version: 5.4
Re: Event Participant List Report and Contact Reference Fields
June 25, 2012, 11:20:16 am
Thanks for your reply. It was a bug in CiviCRM. I actually hired someone to troubleshoot and fix, which they have posted on their blog. But I'll post the solution here as well, in case anyone else is having the same problem:

The solution is to change a line of code in:
/sites/all/modules/civicrm/CRM/Report/Form/Event/ParticipantListing.php
Modify line 65:

'dbAlias' => 'sort_name'),

changed to:

'dbAlias' => 'contact_civireport.sort_name'),

britebyte

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 2
  • CiviCRM version: Several 3.4+, 4.1+
  • CMS version: Drupal 6, Drupal7
  • MySQL version: Several 5.1+
  • PHP version: Several 5.2+
Re: Event Participant List Report and Contact Reference Fields
June 25, 2012, 12:27:46 pm
Thanks for posting your solution!
It gave me some insight into the use of that report option. It means that dbalias becomes the full alias for the field and no table alias is automatically prefixed to it. I think this would mean that as a Civireport developer a best practice is: If using the dbalias array option then we should also manually specify the alias array option for the table and repeat it as part of the dbalias.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Event Participant List Report and Contact Reference Fields
June 25, 2012, 01:11:21 pm

can you please file an issue for this and link to this forum topic. would be good to get this fixed for 4.2

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

madelynnk

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.3.8 & 4.4.4
  • CMS version: Drupal 6.31
  • MySQL version: 5.1
  • PHP version: 5.4
Re: Event Participant List Report and Contact Reference Fields
June 26, 2012, 07:40:40 am
Done.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Event Participant List Report and Contact Reference Fields

This forum was archived on 2017-11-26.