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 CiviEvent (Moderator: Yashodha Chaku) »
  • Exporting multiple Participants from one Contact with CiviEvent in CiviCRM 3.4
Pages: [1]

Author Topic: Exporting multiple Participants from one Contact with CiviEvent in CiviCRM 3.4  (Read 1006 times)

rjlang

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 1
  • CiviCRM version: 4.2.8
  • CMS version: Drupal 6
  • MySQL version: 5.0.77
  • PHP version: 5.3.19
Exporting multiple Participants from one Contact with CiviEvent in CiviCRM 3.4
July 25, 2011, 08:45:02 pm
We have CiviEvent configured to allow multiple Participants from a single Contact (i.e., one person can sign up for the same event multiple times). The Event search properly shows the multiple Participants, but when we try to export the Participant records, only the first record for each contact shows up in the export set. So, for example, the search results might show two Participant records for the same contact, but the export set will only contain a single row.

This worked in CiviCRM 3.3, (IIRC), but is definitely not working in 3.4, and seems to have been alluded to in this comment from a year ago:
http://forum.civicrm.org/index.php/topic,15711.msg67291.html

Any suggestions?

Thanks,

Robert

rjlang

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 1
  • CiviCRM version: 4.2.8
  • CMS version: Drupal 6
  • MySQL version: 5.0.77
  • PHP version: 5.3.19
Re: Exporting multiple Participants from one Contact with CiviEvent in CiviCRM 3.4
July 26, 2011, 03:17:35 pm
I have reproduced this behavior on the demo site by creating a test event with two participants from the same contact:

http://drupal.demo.civicrm.org/civicrm/event/search?reset=1&force=1&status=true&event=10

If you select "all records" and attempt to Export Participants, the export set contains one, not two, rows. Exporting, for example, the Participant ID field (which clearly should be two distinct numbers) only exports one of the two records.

Robert

rjlang

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 1
  • CiviCRM version: 4.2.8
  • CMS version: Drupal 6
  • MySQL version: 5.0.77
  • PHP version: 5.3.19
Re: Exporting multiple Participants from one Contact with CiviEvent in CiviCRM 3.4
July 26, 2011, 06:05:13 pm
I think I can narrow down the problem here, code-wise. What appears to be happening is that the db query is selecting for DISTINCT contact IDs when it performs the query. That should not be done for a Participant export. Tracing this behavior back through the call chain leads to the following lines in CRM/Contact/BAO/Query.php, starting at line 3420:

            // regenerate fromClause since permission might have added tables
            if ( $permission ) {
                //fix for row count in qill (in contribute/membership find)
                if (! $count ) {
                    $this->_useDistinct = true;
                }

That assignment of $this->_useDistinct = true is what causes the bug in a Participant export. Commenting it out causes the Export Participants to run properly -- at least, for this scenario. But I have no idea what other side effects that simple fix might cause in other circumstances. Perhaps someone who's more familiar with this bit of code could comment on what the cleanest fix would be?

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: Exporting multiple Participants from one Contact with CiviEvent in CiviCRM 3.4
July 27, 2011, 12:25:51 am

Can you file an issue and link to this forum post. Seems like this is a new bug in component export (someone else pointed this out for contributions also). We'll take a look and fix for a future release

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

rjlang

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 1
  • CiviCRM version: 4.2.8
  • CMS version: Drupal 6
  • MySQL version: 5.0.77
  • PHP version: 5.3.19
Re: Exporting multiple Participants from one Contact with CiviEvent in CiviCRM 3.4
July 27, 2011, 07:23:49 am
Done:

http://issues.civicrm.org/jira/browse/CRM-8572

There seems to be a related problem with the Custom Search titled "Price Set Details for Event Participants" aka "Price Set Export". In the same situation (multiple Participant records per contact), the listing of records displayed on-screen is missing records, but the CSV export file contains all records.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Exporting multiple Participants from one Contact with CiviEvent in CiviCRM 3.4

This forum was archived on 2017-11-26.