Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.0, 3.4.1, 4.0.0, 4.0.1
-
Fix Version/s: 3.4.2
-
Component/s: None
-
Labels:None
Description
if address custom fields exist in a system, they are added to the token list but the name of the token is not constructed properly for the display. reproducible on sandbox.
try adding an email and opening the token list:
http://drupal.demo.civicrm.org/civicrm/activity/pdf/add?action=add&reset=1&cid=102&selectedChild=activity&atype=22
note that the first two are blank. if you insert them, they do work. the labels just aren't created
the issue is with CRM_Core_SelectValues::contactTokens()
we retrieve Individual custom fields and then cycle through the export list to construct the appropriate label. the address fields are available, but are not part of the Indiv custom tokens so the label isn't constructed.
around line 576 I think we should do:
$customFieldsIndiv = CRM_Core_BAO_CustomField::getFields('Individual');
$customFieldsAddress = CRM_Core_BAO_CustomField::getFields('Address');
$customFields = $customFieldsIndiv + $customFieldsAddress;
that constructs the complete customFields array and the labels are built correctly.