Answers.Body: <p>Create a new view. </p>
  
  <p>Give the view a name</p>
  
  <p>Show CiviCRM Participants</p>
  
  <p>Create a page view perhaps, make sure there is a path</p>
  
  <p>Continue</p>
  
  <p>Add some fields, maybe you want the contact display name for instance
  The custom field will be available in a group "CiviCRM Custom [custom_group_name]"
  Add your custom fields...</p>
  
  <p>Maybe you want only those participants for a given event?</p>
  
  <p>Number of ways to do this, but lets just describe one way. </p>
  
  <p>so lets say your View is at path "/event-participant-listing"
  Lets use a contextual filter, and filter by event id, so that
  "/event-participant-listing/1" would list participants for event with id 1</p>
  
  <p>editing your view, Click the Advanced fieldset in the right column</p>
  
  <p>Add a contextual filter
  "CiviCRM Events: Event ID"</p>
  
  <p>Maybe set "When the filter value is NOT in the URL" to 'Display contents of "No results found"'</p>
  
  <p>Make sure if you choose that to add a "Global: Text Area" to the "No Results Behavior"</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-25T14:50:28.860Z
Answers.Text: I've tried, but I don't have any "CiviCRM Custom[...]. I think that I need to give some autorisations, but I don't find where.
Answers.UserDisplayName: olivier
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-25T01:10:24.610Z
Answers.LastActivityDate: 2017-02-25T01:10:24.610Z
Answers.UserDisplayName: jackrabbithanna
Answers.Body: <p>This is a regression in 4.7. See issue <a href="http://issues.civicrm.org/jira/browse/CRM-20194" rel="nofollow noreferrer">CRM-20194</a>:
  Only 'Contact' is treated at the end of civicrm/drupal/modules/views/components/civicrm.core.inc :
  $extendsContactSubtype = (('Contact'=== $dao->extends)  &amp;&amp; !empty($dao->extends_entity_column_value));
  Replacing this line by :
      $extendsContactSubtype = (!empty($dao->extends) &amp;&amp; !empty($dao->extends_entity_column_value));
  seem to work (but I've not full tested).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-25T09:45:07.043Z
Answers.Text: I don't know if this relates, but you can see https://civicrm.stackexchange.com/questions/27466/how-to-display-individual-custom-fields-in-a-participants-view for more explanations (not solutions)
Answers.UserDisplayName: Jacques-Marie Moranne
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-01T19:17:31.020Z
Answers.LastActivityDate: 2017-03-01T21:35:05.910Z
Answers.LastEditDate: 2017-03-01T21:35:05.910Z
Answers.UserDisplayName: olivier
Answers.Body: <p>There was a bug with this recently. Update to latest civi to solve. I posted a q about this (on phone or I'd link you)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-25T16:46:51.113Z
Answers.Text: I am now on 5.6.0, but the bug seems to remain ; do you think that 5.7.1 has fixed it ?
Answers.UserDisplayName: Jacques-Marie Moranne
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-26T01:34:15.190Z
Answers.Text: No, sorry. If you've overridden some PHP files that might explain it. I added some code to let Participants be added to Events.
Answers.UserDisplayName: JohnFF
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-27T06:36:32.730Z
Answers.Text: Can you be more explicit : I personaly did not override any php file ; could the upgrade to 5.6.0 do that ? On an other hand, fuzion made some developments for me (search paramerization), which affected CRM/Contribute/Form/Search.php, 
  CRM/Event/Form/Search.php, 
  CRM/Member/Form/Search.php, 
  CRM/Activity/BAO/Query.php, 
  CRM/Activity/Form/Search.php, Those should be (or may have already)  integrated in the core : could it be an explanation ?
Answers.UserDisplayName: Jacques-Marie Moranne
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-01T21:18:10.357Z
Answers.LastActivityDate: 2017-03-01T21:18:10.357Z
Answers.UserDisplayName: JohnFF
Body: <p>I have events with custom fields.
  I want to show participants with the corresponding custom fields in a View.
  I can't find how to retrieve custom datas.</p>
  
  <p>Is somebody have already created this kind of View?</p>
  
  <p>Using Drupal 7.54 and Civicrm 4.7.16.</p>
  
  <p>Thank you for your help.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-26T05:06:39.487Z
Comments.Text: Is your civicrm database part of your drupal database or separate. if separate then you have to add any new custom field groups you create to your settings.php file
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-26T09:54:44.797Z
Comments.Text: All datas are in the same database, and settings.php content the custom field groups. When I create à view of custom fields or groups, I see them.
Comments.UserDisplayName: olivier
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-26T19:37:59.117Z
Comments.Text: Your responses here and to jack (mark) below leave me confused. Are you saying that you see custom fields belonging to some entities, eg Contacts, Contributions, but not for specifically Participants? You may need to paste an export of your View to help folk understand your issue
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-26T19:39:05.577Z
Comments.Text: Also if your drupal and civi is in the same db then you don't need to be adding the custom groups to settings.php
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-26T20:04:00.020Z
Comments.Text: I begin to understand... It seems that only custom field active for ALL events are seen in Views. In my case, custom groups are for specifics  event, and they don't appears in View. If I define a custom group for ALL events, it appear in View menu. So I think that the question should be : "How to use custom field affected to specific event ?"
Comments.UserDisplayName: olivier
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-26T20:16:14.040Z
Comments.Text: To explain, I've made some [screenshot of this test](http://www.olivier.byethost13.com/owncloud/index.php/s/BwwTgFp9ypoanqr)
Comments.UserDisplayName: olivier
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-26T23:39:01.637Z
Comments.Text: Yep that helps. Does the problem resolve itself if you set a Filter for Event Type to Assemblée... and Repas... ?   ps it help if you can be very specific with your language. IN the above comments it would help if you said "It seems that only custom field active for PARTICIPANTS on ALL events TYPES are seen in Views" to avoid possible confusion
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-27T15:52:57.040Z
Comments.Text: This is starting to smell of a bug or regression in 4.7 along the way somewhere.  I know this is working in 4.6 LTS. I would think that proper behavior in Views would be to show the groups, and only for a certain type, return no value in those cases, the groups should be there....Although this could have become a "feature" at some point...
Comments.UserDisplayName: jackrabbithanna
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-27T15:54:27.597Z
Comments.Text: since the group doesn't show, somewhere in the logic of civicrm_views_data() there would be code excluding exposure to Views
Comments.UserDisplayName: jackrabbithanna
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-27T20:50:46.943Z
Comments.Text: I've installed CiviCRM 4.6.26, and all custom groups are shown in Views. I've also installed all Drupal modules used in 4.7 environement to be sure that the problem is not coming from a module. So it's perhaps a bug in 4.7. I'll search if there is an issue already opened.
Comments.UserDisplayName: olivier
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-27T20:59:59.827Z
Comments.Text: There is CRM-19545 wich seem similare : Custom field groups which do not directly extend the base 'Contact' disappear from Drupal view after applying patch CRM-18776
Comments.UserDisplayName: olivier
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-27T21:21:21.837Z
Comments.Text: But this issue is for contact, not participants!!!
Comments.UserDisplayName: olivier
Tags: <civievent><custom-fields><drupal-views>
Title: How to create Drupal View of Participants with custom fields
ThreadText: # How to create Drupal View of Participants with custom fields
  
  (Asked by: username_0 on 2017-02-25)
  
  I have events with custom fields.
  I want to show participants with the corresponding custom fields in a View.
  I can't find how to retrieve custom datas.
  
  Is somebody have already created this kind of View?
  
  Using Drupal 7.54 and Civicrm 4.7.16.
  
  Thank you for your help.
  
  **Tags:** civievent, custom-fields, drupal-views
  
  > **Comments:**
  > **username_1**: Is your civicrm database part of your drupal database or separate. if separate then you have to add any new custom field groups you create to your settings.php file  
  > **username_0**: All datas are in the same database, and settings.php content the custom field groups. When I create à view of custom fields or groups, I see them.  
  > **username_1**: Your responses here and to jack (mark) below leave me confused. Are you saying that you see custom fields belonging to some entities, eg Contacts, Contributions, but not for specifically Participants? You may need to paste an export of your View to help folk understand your issue  
  > **username_1**: Also if your drupal and civi is in the same db then you don't need to be adding the custom groups to settings.php  
  > **username_0**: I begin to understand... It seems that only custom field active for ALL events are seen in Views. In my case, custom groups are for specifics  event, and they don't appears in View. If I define a custom group for ALL events, it appear in View menu. So I think that the question should be : "How to use custom field affected to specific event ?"  
  > **username_0**: To explain, I've made some [screenshot of this test](http://www.username_0.byethost13.com/owncloud/index.php/s/BwwTgFp9ypoanqr)  
  > **username_1**: Yep that helps. Does the problem resolve itself if you set a Filter for Event Type to Assemblée... and Repas... ?   ps it help if you can be very specific with your language. IN the above comments it would help if you said "It seems that only custom field active for PARTICIPANTS on ALL events TYPES are seen in Views" to avoid possible confusion  
  > **username_2**: This is starting to smell of a bug or regression in 4.7 along the way somewhere.  I know this is working in 4.6 LTS. I would think that proper behavior in Views would be to show the groups, and only for a certain type, return no value in those cases, the groups should be there....Although this could have become a "feature" at some point...  
  > **username_2**: since the group doesn't show, somewhere in the logic of civicrm_views_data() there would be code excluding exposure to Views  
  > **username_0**: I've installed CiviCRM 4.6.26, and all custom groups are shown in Views. I've also installed all Drupal modules used in 4.7 environement to be sure that the problem is not coming from a module. So it's perhaps a bug in 4.7. I'll search if there is an issue already opened.  
  > **username_0**: There is CRM-19545 wich seem similare : Custom field groups which do not directly extend the base 'Contact' disappear from Drupal view after applying patch CRM-18776  
  > **username_0**: But this issue is for contact, not participants!!!  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2017-02-25. Score: 1
  
  Create a new view.
  
  Give the view a name
  
  Show CiviCRM Participants
  
  Create a page view perhaps, make sure there is a path
  
  Continue
  
  Add some fields, maybe you want the contact display name for instance
  The custom field will be available in a group "CiviCRM Custom [custom\_group\_name]"
  Add your custom fields...
  
  Maybe you want only those participants for a given event?
  
  Number of ways to do this, but lets just describe one way.
  
  so lets say your View is at path "/event-participant-listing"
  Lets use a contextual filter, and filter by event id, so that
  "/event-participant-listing/1" would list participants for event with id 1
  
  editing your view, Click the Advanced fieldset in the right column
  
  Add a contextual filter
  "CiviCRM Events: Event ID"
  
  Maybe set "When the filter value is NOT in the URL" to 'Display contents of "No results found"'
  
  Make sure if you choose that to add a "Global: Text Area" to the "No Results Behavior"
  
  > **Comments:**
  > **username_0**: I've tried, but I don't have any "CiviCRM Custom[...]. I think that I need to give some autorisations, but I don't find where.  
  
  ---
  
  ### Answer by username_0 on 2017-03-01. Score: 0
  
  This is a regression in 4.7. See issue [CRM-20194](http://issues.civicrm.org/jira/browse/CRM-20194):
  Only 'Contact' is treated at the end of civicrm/drupal/modules/views/components/civicrm.core.inc :
  $extendsContactSubtype = (('Contact'=== $dao->extends) && !empty($dao->extends\_entity\_column\_value));
  Replacing this line by :
  $extendsContactSubtype = (!empty($dao->extends) && !empty($dao->extends\_entity\_column\_value));
  seem to work (but I've not full tested).
  
  > **Comments:**
  > **username_3**: I don't know if this relates, but you can see https://civicrm.stackexchange.com/questions/27466/how-to-display-individual-custom-fields-in-a-participants-view for more explanations (not solutions)  
  
  ---
  
  ### Answer by username_4 on 2017-03-01. Score: 0
  
  There was a bug with this recently. Update to latest civi to solve. I posted a q about this (on phone or I'd link you)
  
  > **Comments:**
  > **username_3**: I am now on 5.6.0, but the bug seems to remain ; do you think that 5.7.1 has fixed it ?  
  > **username_4**: No, sorry. If you've overridden some PHP files that might explain it. I added some code to let Participants be added to Events.  
  > **username_3**: Can you be more explicit : I personaly did not override any php file ; could the upgrade to 5.6.0 do that ? On an other hand, username_1 made some developments for me (search paramerization), which affected CRM/Contribute/Form/Search.php,  CRM/Event/Form/Search.php,  CRM/Member/Form/Search.php,  CRM/Activity/BAO/Query.php,  CRM/Activity/Form/Search.php, Those should be (or may have already)  integrated in the core : could it be an explanation ?  
  
  ---
  
  