Answers.Body: <p>This was considered a feature by some folks, other folks maybe not. </p>
  
  <p>You need a small custom module to change this...
  It should implement hook_entity_info_alter(&amp;$entity_info)</p>
  
  <p><a href="https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_entity_info_alter/7.x" rel="nofollow noreferrer">https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_entity_info_alter/7.x</a></p>
  
  <p>you would need this code:</p>
  
  <pre><code>function YOURMODULE_entity_info_alter(&amp;$entity_info) {
    unset($entity_info['civicrm_contact']['label callback']);
  }
  </code></pre>
  
  <p>Install your module, clear caches.</p>
  
  <p>That will make CiviCRM Entity default the contact entity label to just the display_name, which in your case would be the organization name.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-08T20:08:32.587Z
Answers.Text: Thanks! It does seem to me that exposing email addresses by default like this is not a good feature.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-08T02:54:24.470Z
Answers.LastActivityDate: 2018-08-08T02:54:24.470Z
Answers.UserDisplayName: jackrabbithanna
Answers.Body: <p>Congratulations, you're the winner of jackrabbithanna's Friday open source evening random issue choice award!</p>
  
  <p>I've added a configuration option to CiviCRM Entity to be able choose a few options for what the civicrm contact entity label should be. </p>
  
  <p>You'll find a fieldset 'Options' at the configuration page: 'admin/structure/civicrm-entity/settings'</p>
  
  <p>There's a field, "Contact Entity Label"...The default option is "Legacy", which will follow the logic for formatting of the contact entity label that existed previously to this update. Users who upgrade and don't choose an option will have it behave as it did before.</p>
  
  <p>You can also choose, "Display Name only", "Display Name + email", "Display Name + phone", or "Display Name + IM"..</p>
  
  <p>It's available in the 7.x-2.x-dev version right now, will be in version 2.2</p>
  
  <p>Or apply the code updates in this pull request:
  <a href="https://github.com/eileenmcnaughton/civicrm_entity/pull/165/files" rel="nofollow noreferrer">https://github.com/eileenmcnaughton/civicrm_entity/pull/165/files</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-12T17:56:31.973Z
Answers.Text: This is a good feature!  Thank you so much!
Answers.UserDisplayName: Kaitlyn B
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-11T00:17:42.467Z
Answers.LastActivityDate: 2018-08-11T00:17:42.467Z
Answers.UserDisplayName: jackrabbithanna
Body: <p>I have a content type in Drupal ('Event') that uses an entity reference autocomplete field to search the name of the submitting organization.  The entity reference field only displays contacts that meet a filter criteria, as set in the entity reference view.</p>
  
  <p>When the content type with the entity reference field was originally set up, it functioned as expected.  About a month ago I noticed the display was suddenly showing the submitting organizations' email address in addition to just their name.  The problem is specifically in the display of the event after it has been created (the way the name appears in the autocomplete widget is fine).</p>
  
  <p>The display was originally:
  "<strong>Event facilitator:</strong> Random Organization Name" </p>
  
  <p>Now, it appears like this, with the addition of their email address:
  "<strong>Event facilitator:</strong> Random Organization Name <code>&lt;random@organization.com&gt;</code>"</p>
  
  <p>I'd rather not have their email addresses be displayed.</p>
  
  <p>Thinking that it might have had something to do with an update, we downgraded  CiviCRM Entity back to version 7.x-2.0-beta11, but the problem persists.</p>
  
  <p>Has anybody experienced this issue?  Any help or insight is greatly appreciated.</p>
  
  <p>Using CiviCRM 5.3.1.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-03T16:31:56.623Z
Comments.Text: I can help you with this, will provide answer this weekend.
Comments.UserDisplayName: jackrabbithanna
Tags: <civicrm-entity>
Title: CiviCRM Entity display shows email addresses - should only show display name
ThreadText: # CiviCRM Entity display shows email addresses - should only show display name
  
  (Asked by: username_0 on 2018-07-31)
  
  I have a content type in Drupal ('Event') that uses an entity reference autocomplete field to search the name of the submitting organization. The entity reference field only displays contacts that meet a filter criteria, as set in the entity reference view.
  
  When the content type with the entity reference field was originally set up, it functioned as expected. About a month ago I noticed the display was suddenly showing the submitting organizations' email address in addition to just their name. The problem is specifically in the display of the event after it has been created (the way the name appears in the autocomplete widget is fine).
  
  The display was originally:
  "**Event facilitator:** Random Organization Name"
  
  Now, it appears like this, with the addition of their email address:
  "**Event facilitator:** Random Organization Name `<random@organization.com>`"
  
  I'd rather not have their email addresses be displayed.
  
  Thinking that it might have had something to do with an update, we downgraded CiviCRM Entity back to version 7.x-2.0-beta11, but the problem persists.
  
  Has anybody experienced this issue? Any help or insight is greatly appreciated.
  
  Using CiviCRM 5.3.1.
  
  **Tags:** civicrm-entity
  
  > **Comments:**
  > **username_1**: I can help you with this, will provide answer this weekend.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-08-08. Score: 1 | Accepted answer
  
  This was considered a feature by some folks, other folks maybe not.
  
  You need a small custom module to change this...
  It should implement hook\_entity\_info\_alter(&$entity\_info)
  
  <https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_entity_info_alter/7.x>
  
  you would need this code:
  
  ```
  function YOURMODULE_entity_info_alter(&$entity_info) {
    unset($entity_info['civicrm_contact']['label callback']);
  }
  
  ```
  
  Install your module, clear caches.
  
  That will make CiviCRM Entity default the contact entity label to just the display\_name, which in your case would be the organization name.
  
  > **Comments:**
  > **username_2**: Thanks! It does seem to me that exposing email addresses by default like this is not a good feature.  
  
  ---
  
  ### Answer by username_1 on 2018-08-11. Score: 4
  
  Congratulations, you're the winner of username_1's Friday open source evening random issue choice award!
  
  I've added a configuration option to CiviCRM Entity to be able choose a few options for what the civicrm contact entity label should be.
  
  You'll find a fieldset 'Options' at the configuration page: 'admin/structure/civicrm-entity/settings'
  
  There's a field, "Contact Entity Label"...The default option is "Legacy", which will follow the logic for formatting of the contact entity label that existed previously to this update. Users who upgrade and don't choose an option will have it behave as it did before.
  
  You can also choose, "Display Name only", "Display Name + email", "Display Name + phone", or "Display Name + IM"..
  
  It's available in the 7.x-2.x-dev version right now, will be in version 2.2
  
  Or apply the code updates in this pull request:
  <https://github.com/eileenmcnaughton/civicrm_entity/pull/165/files>
  
  > **Comments:**
  > **username_0**: This is a good feature!  Thank you so much!  
  
  ---
  
  