Skip to main content
Updated with addition information
Source Link
mhawksey
  • 233
  • 1
  • 9

We recently upgraded to CiviCRM 4.7.19 on Drupal 7.52 and for some reason the New Organization button isn't appearing when searching for an unknown organization for a contact's current employer. I can add an organization via CiviCRM > Contacts > New Organisation but our backoffice staff liked being able to add from the person contact page. I've checked the console and there are no errors flagged and isn't a CSS thing as the element holding the button exists but just doesn't have the button markup e.g. instead of:

<div class="crm-entityref-links"> <a class="crm-add-entity crm-hover-button" href="/civicrm/profile/create?reset=1&amp;context=dialog&amp;gid=5"><i class="crm-i fa-building"></i> New Organization</a></div>

the page only has:

<div class="crm-entityref-links"></div>

I've checked permissions and as far as I can tell everything is set ok. Is there a setting I'm missing?

enter image description here

Update

Looking at our l10n-js file I can see that the contactCreate object is not being populated:

CRM.config.entityRef = $.extend({}, {"contactCreate":[]...

Digging into the code I can see this is supposed to be created in Core/Resources.php (line 685):

'contactCreate' => CRM_Core_BAO_UFGroup::getCreateLinks()

Looking at CRM/Core/BAO/UFGroup.php I can see the getCreateLinks() function calls

public static function getCreateLinks($profiles = '', $appendProfiles = array()) {
    // Default to contact profiles
    if (!$profiles) {
      $profiles = array('new_individual', 'new_organization', 'new_household');
    }
    $profiles = (array) $profiles;
    $toGet = array_merge($profiles, (array) $appendProfiles);
    $retrieved = civicrm_api3('uf_group', 'get', array(
      'name' => array('IN' => $toGet),
      'is_active' => 1,
    ));

Running a similar API call on our install:

$result = civicrm_api3('UFGroup', 'get', array(
  'sequential' => 1,
  'name' => array('IN' => array("new_individual", "new_organization")),
));

I get no results, the reason is because the name is actually new_organization_5 not new_organization Still don't know how to fix

We recently upgraded to CiviCRM 4.7.19 on Drupal 7.52 and for some reason the New Organization button isn't appearing when searching for an unknown organization for a contact's current employer. I can add an organization via CiviCRM > Contacts > New Organisation but our backoffice staff liked being able to add from the person contact page. I've checked the console and there are no errors flagged and isn't a CSS thing as the element holding the button exists but just doesn't have the button markup e.g. instead of:

<div class="crm-entityref-links"> <a class="crm-add-entity crm-hover-button" href="/civicrm/profile/create?reset=1&amp;context=dialog&amp;gid=5"><i class="crm-i fa-building"></i> New Organization</a></div>

the page only has:

<div class="crm-entityref-links"></div>

I've checked permissions and as far as I can tell everything is set ok. Is there a setting I'm missing?

enter image description here

We recently upgraded to CiviCRM 4.7.19 on Drupal 7.52 and for some reason the New Organization button isn't appearing when searching for an unknown organization for a contact's current employer. I can add an organization via CiviCRM > Contacts > New Organisation but our backoffice staff liked being able to add from the person contact page. I've checked the console and there are no errors flagged and isn't a CSS thing as the element holding the button exists but just doesn't have the button markup e.g. instead of:

<div class="crm-entityref-links"> <a class="crm-add-entity crm-hover-button" href="/civicrm/profile/create?reset=1&amp;context=dialog&amp;gid=5"><i class="crm-i fa-building"></i> New Organization</a></div>

the page only has:

<div class="crm-entityref-links"></div>

I've checked permissions and as far as I can tell everything is set ok. Is there a setting I'm missing?

enter image description here

Update

Looking at our l10n-js file I can see that the contactCreate object is not being populated:

CRM.config.entityRef = $.extend({}, {"contactCreate":[]...

Digging into the code I can see this is supposed to be created in Core/Resources.php (line 685):

'contactCreate' => CRM_Core_BAO_UFGroup::getCreateLinks()

Looking at CRM/Core/BAO/UFGroup.php I can see the getCreateLinks() function calls

public static function getCreateLinks($profiles = '', $appendProfiles = array()) {
    // Default to contact profiles
    if (!$profiles) {
      $profiles = array('new_individual', 'new_organization', 'new_household');
    }
    $profiles = (array) $profiles;
    $toGet = array_merge($profiles, (array) $appendProfiles);
    $retrieved = civicrm_api3('uf_group', 'get', array(
      'name' => array('IN' => $toGet),
      'is_active' => 1,
    ));

Running a similar API call on our install:

$result = civicrm_api3('UFGroup', 'get', array(
  'sequential' => 1,
  'name' => array('IN' => array("new_individual", "new_organization")),
));

I get no results, the reason is because the name is actually new_organization_5 not new_organization Still don't know how to fix

Source Link
mhawksey
  • 233
  • 1
  • 9

Enabling 'New Organisation' button for Current Employer field in View Contact

We recently upgraded to CiviCRM 4.7.19 on Drupal 7.52 and for some reason the New Organization button isn't appearing when searching for an unknown organization for a contact's current employer. I can add an organization via CiviCRM > Contacts > New Organisation but our backoffice staff liked being able to add from the person contact page. I've checked the console and there are no errors flagged and isn't a CSS thing as the element holding the button exists but just doesn't have the button markup e.g. instead of:

<div class="crm-entityref-links"> <a class="crm-add-entity crm-hover-button" href="/civicrm/profile/create?reset=1&amp;context=dialog&amp;gid=5"><i class="crm-i fa-building"></i> New Organization</a></div>

the page only has:

<div class="crm-entityref-links"></div>

I've checked permissions and as far as I can tell everything is set ok. Is there a setting I'm missing?

enter image description here