From: Kurund Jalmi Date: Thu, 18 Jul 2013 16:46:25 +0000 (+0530) Subject: setdefaults fixes for date time custom data in profile X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fd933dc5af1976f9cc053cd3e8a91b8d47eea7ea;p=civicrm-core.git setdefaults fixes for date time custom data in profile --- diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index d8e5315d53..3755d2be4a 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -2289,11 +2289,11 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) case 'Select Date': // CRM-6681, set defult values according to date and time format (if any). $dateFormat = NULL; - if (CRM_Utils_Array::value('date_format', $field)) { - $dateFormat = $field['date_format']; + if (CRM_Utils_Array::value('date_format', $customFields[$customFieldId])) { + $dateFormat = $customFields[$customFieldId]['date_format']; } - if (!CRM_Utils_Array::value('time_format', $field)) { + if (!CRM_Utils_Array::value('time_format', $customFields[$customFieldId])) { list($defaults[$fldName]) = CRM_Utils_Date::setDateDefaults($details[$name], NULL, $dateFormat ); @@ -2303,7 +2303,8 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) if (substr($fldName, -1) == ']') { $timeElement = substr($fldName, 0, -1) . '_time]'; } - list($defaults[$fldName], $defaults[$timeElement]) = CRM_Utils_Date::setDateDefaults($details[$name], NULL, $dateFormat, $field['time_format']); + list($defaults[$fldName], $defaults[$timeElement]) = CRM_Utils_Date::setDateDefaults($details[$name], + NULL, $dateFormat, $customFields[$customFieldId]['time_format']); } break;