Set Default values on is_active, is_searchable, is_view and is_active on civicrm_cust...
authorSeamus Lee <seamuslee001@gmail.com>
Mon, 14 May 2018 21:54:14 +0000 (07:54 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Mon, 14 May 2018 21:54:14 +0000 (07:54 +1000)
CRM/Core/DAO/CustomField.php
CRM/Core/DAO/CustomGroup.php
CRM/Upgrade/Incremental/sql/5.3.alpha1.mysql.tpl
xml/schema/Core/CustomField.xml

index 23114402d1ac68039999d758a95ebd9b2f4a5cfb..1f48b8858fb3a3370804f161dc5dc76ef471e021 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/CustomField.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6c4ced0a0ac204cde5c048d37aee6057)
+ * (GenCodeChecksum:dcb494bf3990ce63b66ef13ee47a2d15)
  */
 
 /**
@@ -475,6 +475,7 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Custom Field Is Active?'),
           'description' => 'Is this property active?',
+          'default' => '1',
           'table_name' => 'civicrm_custom_field',
           'entity' => 'CustomField',
           'bao' => 'CRM_Core_BAO_CustomField',
index f747321fd9eff8750dd7bbcc77a692302d653077..93d82140553e3dd3207fc9a3e87752bb8ec6546a 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/CustomGroup.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:e0236d574279679e242f45bc73c4680a)
+ * (GenCodeChecksum:6b88842459aadee0598c08bd4d7518f2)
  */
 
 /**
@@ -361,6 +361,7 @@ class CRM_Core_DAO_CustomGroup extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Custom Group Is Active?'),
           'description' => 'Is this property active?',
+          'default' => '1',
           'table_name' => 'civicrm_custom_group',
           'entity' => 'CustomGroup',
           'bao' => 'CRM_Core_BAO_CustomGroup',
index 7f5b095e9501c2426721d6a5fd06e3dcae7e1fd7..29672bcf24a3279fa9221ea98e644f7b3dc76c3a 100644 (file)
@@ -2,3 +2,10 @@
 ALTER TABLE civicrm_custom_group ALTER column is_multiple SET DEFAULT 0;
 UPDATE civicrm_custom_group SET is_multiple = 0 WHERE is_multiple IS NULL;
 ALTER TABLE civicrm_custom_group ALTER column is_active SET DEFAULT 1;
+ALTER TABLE civicrm_custom_field ALTER column is_view SET DEFAULT 0;
+UPDATE civicrm_custom_field SET is_view = 0 WHERE is_view IS NULL;
+ALTER TABLE civicrm_custom_field ALTER column is_required SET DEFAULT 0;
+UPDATE civicrm_custom_field SET is_required = 0 WHERE is_required IS NULL;
+ALTER TABLE civicrm_custom_field ALTER column is_searchable SET DEFAULT 0;
+UPDATE civicrm_custom_field SET is_searchable = 0 WHERE is_required IS NULL;
+ALTER TABLE civicrm_custom_field ALTER column is_active SET DEFAULT 1;
index d9ee5bb74ce72108a4ac746e436dc2be674fd424..0effe4046dbe2e39ed19bb39f9e434f45649460a 100644 (file)
     <title>Custom Field Is Required?</title>
     <type>boolean</type>
     <comment>Is a value required for this property.</comment>
+    <default>0</default>
     <add>1.1</add>
   </field>
   <field>
     <title>Allow Searching on Field?</title>
     <type>boolean</type>
     <comment>Is this property searchable.</comment>
+    <default>0</default>
     <add>1.1</add>
   </field>
   <field>
     <type>boolean</type>
     <title>Custom Field Is Active?</title>
     <comment>Is this property active?</comment>
+    <default>1</default>
     <add>1.1</add>
   </field>
   <field>
     <name>is_view</name>
     <type>boolean</type>
     <title>Field is Viewable</title>
+    <default>0</default>
     <comment>Is this property set by PHP Code? A code field is viewable but not editable</comment>
     <add>1.1</add>
   </field>