Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomFields - Drop unused column 'mask' #25396

Merged
merged 1 commit into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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