From 23aa70df9cd03fbf329e870d279dbe8b6ce8345d Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 3 Dec 2014 12:17:49 -0500 Subject: [PATCH] Add buildForm hook to fix state select box when editing info profile. * memberdashboard.php (memberdashboard_civicrm_buildFrom): New function. --- memberdashboard.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/memberdashboard.php b/memberdashboard.php index bb7e823..8ceed2d 100644 --- a/memberdashboard.php +++ b/memberdashboard.php @@ -164,3 +164,13 @@ function memberdashboard_civicrm_post($op, $objectName, $objectId, &$objectRef) } } } + +function memberdashboard_civicrm_buildForm($formName, &$form) { + // Hack to fix state select box in 4.4.x + if($formName == 'CRM_Profile_Form_Edit') { + $contactId = CRM_Core_Session::singleton()->get('userID'); + $contact = civicrm_api3('contact', 'getsingle', array( 'id' => $contactId )); + $defaults['state_province-1'] = $contact['state_province_id']; + $form->setDefaults($defaults); + } +} -- 2.25.1