Skip to content

Commit

Permalink
Merge pull request #25396 from colemanw/customMaskDrop
Browse files Browse the repository at this point in the history
CustomFields - Drop unused column 'mask'
  • Loading branch information
yashodha committed Jan 25, 2023
2 parents 1ab1e1b + 7cd7503 commit 7439108
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 29 deletions.
25 changes: 1 addition & 24 deletions 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:b36f8202db0be873208f1895f3b3dc87)
* (GenCodeChecksum:f102cd2c666ba101ff0933c9fdac92ce)
*/

/**
Expand Down Expand Up @@ -167,15 +167,6 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO {
*/
public $help_post;

/**
* Optional format instructions for specific field types, like date types.
*
* @var string|null
* (SQL type: varchar(64))
* Note that values will be retrieved from the database as a string.
*/
public $mask;

/**
* Store collection of type-appropriate attributes, e.g. textarea needs rows/cols attributes
*
Expand Down Expand Up @@ -578,20 +569,6 @@ public static function &fields() {
'localizable' => 1,
'add' => '1.1',
],
'mask' => [
'name' => 'mask',
'type' => CRM_Utils_Type::T_STRING,
'title' => ts('Custom Field Formatting'),
'description' => ts('Optional format instructions for specific field types, like date types.'),
'maxlength' => 64,
'size' => CRM_Utils_Type::BIG,
'where' => 'civicrm_custom_field.mask',
'table_name' => 'civicrm_custom_field',
'entity' => 'CustomField',
'bao' => 'CRM_Core_BAO_CustomField',
'localizable' => 0,
'add' => '1.1',
],
'attributes' => [
'name' => 'attributes',
'type' => CRM_Utils_Type::T_STRING,
Expand Down
8 changes: 3 additions & 5 deletions CRM/Custom/Form/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
'File' => ['File'],
'Link' => ['Link'],
'ContactReference' => ['Autocomplete-Select'],
'EntityReference' => ['Autocomplete-Select'],
];

/**
Expand Down Expand Up @@ -417,7 +418,7 @@ public function buildQuickForm() {
$this->add('number', 'options_per_line', ts('Options Per Line'), ['min' => 0]);
$this->addRule('options_per_line', ts('must be a numeric value'), 'numeric');

// default value, help pre, help post, mask, attributes, javascript ?
// default value, help pre, help post
$this->add('text', 'default_value', ts('Default Value'),
$attributes['default_value']
);
Expand All @@ -427,9 +428,6 @@ public function buildQuickForm() {
$this->add('textarea', 'help_post', ts('Field Post Help'),
$attributes['help_post']
);
$this->add('text', 'mask', ts('Mask'),
$attributes['mask']
);

// is active ?
$this->add('advcheckbox', 'is_active', ts('Active?'));
Expand Down Expand Up @@ -740,7 +738,7 @@ public static function formRule($fields, $files, $self) {
}
}
elseif (in_array($htmlType, self::$htmlTypesWithOptions) &&
!in_array($dataType, ['Boolean', 'Country', 'StateProvince', 'ContactReference'])
!in_array($dataType, ['Boolean', 'Country', 'StateProvince', 'ContactReference', 'EntityReference'])
) {
if (!$fields['option_group_id']) {
$errors['option_group_id'] = ts('You must select a Multiple Choice Option set if you chose Reuse an existing set.');
Expand Down
1 change: 1 addition & 0 deletions CRM/Upgrade/Incremental/php/FiveFiftyNine.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class CRM_Upgrade_Incremental_php_FiveFiftyNine extends CRM_Upgrade_Incremental_
*/
public function upgrade_5_59_alpha1($rev): void {
$this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
$this->addTask('Drop column civicrm_custom_field.mask', 'dropColumn', 'civicrm_custom_field', 'mask');
}

}
1 change: 1 addition & 0 deletions xml/schema/Core/CustomField.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
<length>64</length>
<comment>Optional format instructions for specific field types, like date types.</comment>
<add>1.1</add>
<drop>5.59</drop>
</field>
<field>
<name>attributes</name>
Expand Down

0 comments on commit 7439108

Please sign in to comment.