Skip to content

Commit

Permalink
Merge pull request civicrm#12131 from seamuslee001/custom_field
Browse files Browse the repository at this point in the history
Set Default values on is_active, is_searchable, is_view and is_active…
  • Loading branch information
eileenmcnaughton authored May 15, 2018
2 parents 17e1efd + 110f434 commit 5e5a67c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CRM/Core/DAO/CustomField.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/CustomField.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:6c4ced0a0ac204cde5c048d37aee6057)
* (GenCodeChecksum:dcb494bf3990ce63b66ef13ee47a2d15)
*/

/**
Expand Down Expand Up @@ -475,6 +475,7 @@ public static function &fields() {
'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',
Expand Down
3 changes: 2 additions & 1 deletion CRM/Core/DAO/CustomGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/CustomGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:e0236d574279679e242f45bc73c4680a)
* (GenCodeChecksum:6b88842459aadee0598c08bd4d7518f2)
*/

/**
Expand Down Expand Up @@ -361,6 +361,7 @@ public static function &fields() {
'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',
Expand Down
7 changes: 7 additions & 0 deletions CRM/Upgrade/Incremental/sql/5.3.alpha1.mysql.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 4 additions & 0 deletions xml/schema/Core/CustomField.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@
<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>
<name>is_searchable</name>
<title>Allow Searching on Field?</title>
<type>boolean</type>
<comment>Is this property searchable.</comment>
<default>0</default>
<add>1.1</add>
</field>
<field>
Expand Down Expand Up @@ -171,12 +173,14 @@
<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>
Expand Down

0 comments on commit 5e5a67c

Please sign in to comment.