2

Timezone is one of the fields in the address table. I'd like to add it to a data entry profile but it's not listed in any of the dropdown menus. How can I add it to the profile even if it's not in the dropdown?

  • Is this a custom field for address? – Pradeep Nayak Jul 27 '19 at 22:12
  • @PradeepNayak, no. Timezone is a standard (not custom) field in the address table in the database. – rgilman Jul 28 '19 at 23:35
2

This is not supported by CiviCRM but you can do a small change in your existing CiviCRM file as shown below and clear civicrm cache, the profile form should then should allow you to add timezone field of address.

diff --git a/CRM/Core/DAO/Address.php b/CRM/Core/DAO/Address.php
index b1e00a83dc..ee9bf2d945 100644
--- a/CRM/Core/DAO/Address.php
+++ b/CRM/Core/DAO/Address.php
@@ -731,6 +731,7 @@ class CRM_Core_DAO_Address extends CRM_Core_DAO {
           'table_name' => 'civicrm_address',
           'entity' => 'Address',
           'bao' => 'CRM_Core_BAO_Address',
+          'import' => TRUE,
           'localizable' => 0,
           'html' => [
             'type' => 'Text',
  • Thanks, @PradeepNayak. Works great! Might it also be useful to add 'export' => TRUE,? I notice all of the other fields that are normally included in the Profile dropdown also that. – rgilman Jul 30 '19 at 1:30
  • Looks like I responded to soon. The timecode field is in the Profile dropdown but data entered into that field doesn't get saved in the address table. – rgilman Jul 30 '19 at 1:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.