Fixes towards CRM-13107. This commit fixes create and edit modes. View mode is still...
authorDave Greenberg <dave@civicrm.org>
Wed, 24 Jul 2013 02:21:35 +0000 (19:21 -0700)
committerDave Greenberg <dave@civicrm.org>
Wed, 24 Jul 2013 02:21:35 +0000 (19:21 -0700)
----------------------------------------
* 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 3755d2be4ac097fba5c93d18ba70a022ed70422c..918ef11f21a791bccf32e8c3398f740206f4eb06 100644 (file)
@@ -1835,7 +1835,7 @@ AND    ( entity_id IS NULL OR entity_id <= 0 )
           '' => ts('- select -')) + CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'), $required
       );
     }
-    elseif ($fieldName === 'gender') {
+    elseif ($fieldName === 'gender_id') {
       $genderOptions = array();
       $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
       foreach ($gender as $key => $var) {
@@ -1846,13 +1846,13 @@ AND    ( entity_id IS NULL OR entity_id <= 0 )
         $form->addRule($name, ts('%1 is a required field.', array(1 => $title)), 'required');
       }
     }
-    elseif ($fieldName === 'individual_prefix') {
+    elseif ($fieldName === 'prefix_id') {
       $form->add('select', $name, $title,
         array(
           '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id'), $required
       );
     }
-    elseif ($fieldName === 'individual_suffix') {
+    elseif ($fieldName === 'suffix_id') {
       $form->add('select', $name, $title,
         array(
           '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id'), $required