CRM-13107, fixes for profile view mode
authorkurund <kurund@civicrm.org>
Mon, 5 Aug 2013 21:02:52 +0000 (02:32 +0530)
committerkurund <kurund@civicrm.org>
Mon, 5 Aug 2013 21:02:52 +0000 (02:32 +0530)
----------------------------------------
* CRM-13107: Individual Prefix, Suffix and Gender fields are broken in Profile Create, Edit and View
  http://issues.civicrm.org/jira/browse/CRM-13107

CRM/Core/BAO/UFGroup.php

index 1b6f8cac7756aeb506839b96694c624eb04d51fb..d3705683f085749b9307e82a9b98f20b27eae014 100644 (file)
@@ -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)) {