From: kurund Date: Mon, 5 Aug 2013 21:02:52 +0000 (+0530) Subject: CRM-13107, fixes for profile view mode X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=37b889c8f5901bea722c8e652a98b88c25eea5b5;p=civicrm-core.git CRM-13107, fixes for profile view mode ---------------------------------------- * CRM-13107: Individual Prefix, Suffix and Gender fields are broken in Profile Create, Edit and View http://issues.civicrm.org/jira/browse/CRM-13107 --- diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 1b6f8cac77..d3705683f0 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -949,10 +949,8 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { // hack for CRM-665 if (isset($details->$name) || $name == 'group' || $name == 'tag') { // to handle gender / suffix / prefix - if (in_array($name, array( - 'gender', 'individual_prefix', 'individual_suffix'))) { - $values[$index] = $details->$name; - $name = $name . '_id'; + if (in_array(substr($name, 0, -3), array('gender', 'prefix', 'suffix'))) { + $values[$index] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $name, $details->$name); $params[$index] = $details->$name; } elseif (in_array($name, CRM_Contact_BAO_Contact::$_greetingTypes)) {