*
* Generated from xml/schema/CRM/Core/CustomGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0c41f19103b41d2f82bcd3b60aaf2165)
+ * (GenCodeChecksum:979bca796163b9af253a7860d9d4a01d)
*/
/**
'unique' => TRUE,
'sig' => 'civicrm_custom_group::1::title::extends',
],
- 'UI_name_extends' => [
- 'name' => 'UI_name_extends',
+ 'UI_name' => [
+ 'name' => 'UI_name',
'field' => [
0 => 'name',
- 1 => 'extends',
],
'localizable' => FALSE,
'unique' => TRUE,
- 'sig' => 'civicrm_custom_group::1::name::extends',
+ 'sig' => 'civicrm_custom_group::1::name',
],
];
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
$preUpgradeMessage .= '<p>' . ts('The contact field preferred mail format is being phased out. Modern email clients can handle receiving both formats so CiviCRM is moving towards always sending both and the field will be incrementally removed from the UI.')
. ' <a href="https://lab.civicrm.org/dev/core/-/issues/2866">' . ts('See the issue for more detail') . '</a></p>';
}
+ // Check for custom groups with duplicate names
+ $dupes = CRM_Core_DAO::singleValueQuery('SELECT COUNT(g1.id) FROM civicrm_custom_group g1, civicrm_custom_group g2 WHERE g1.name = g2.name AND g1.id > g2.id');
+ if ($dupes) {
+ $preUpgradeMessage .= '<p>' .
+ ts('Your system has custom field groups with duplicate internal names. To ensure data integrity, the internal names will be automatically changed; user-facing titles will not be affected. Please review any custom code you may be using which relies on custom field group names.') .
+ '</p>';
+ }
}
}
'civicrm_event', 'event_tz', "text NULL DEFAULT NULL COMMENT 'Event\'s native time zone'"
);
$this->addTask('core-issue#2122 - Set the timezone to the default for existing Events', 'setEventTZDefault');
+ $this->addTask('Drop CustomGroup UI_name_extends index', 'dropIndex', 'civicrm_custom_group', 'UI_name_extends');
+ $this->addTask('Add CustomGroup UI_name index', 'addIndex', 'civicrm_custom_group', ['name'], 'UI');
}
/**
MODIFY COLUMN `end_date` timestamp NULL DEFAULT NULL COMMENT 'Date and time that event ends. May be NULL if no defined end date/time',
MODIFY COLUMN `registration_start_date` timestamp NULL DEFAULT NULL COMMENT 'Date and time that online registration starts.',
MODIFY COLUMN `registration_end_date` timestamp NULL DEFAULT NULL COMMENT 'Date and time that online registration ends.';
+
+{* Ensure CustomGroup.name is unique *}
+UPDATE civicrm_custom_group g1, civicrm_custom_group g2 SET g1.name = CONCAT(g1.name, '_1') WHERE g1.name = g2.name AND g1.id > g2.id;
* @throws \CRM_Core_Exception
*/
public function testCreateGetFieldsWithCustom(): void {
- $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__);
- $idsContact = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, 'ContactTest.php');
+ $ids = $this->entityCustomGroupWithSingleFieldCreate('ContributionCustomFields', __FILE__);
+ $idsContact = $this->entityCustomGroupWithSingleFieldCreate('ContactCustomFields', 'ContactTest.php');
$result = $this->callAPISuccess('Contribution', 'getfields', []);
$this->assertArrayHasKey('custom_' . $ids['custom_field_id'], $result['values']);
$this->assertArrayNotHasKey('custom_' . $idsContact['custom_field_id'], $result['values']);
<add>2.1</add>
</index>
<index>
- <name>UI_name_extends</name>
+ <name>UI_name</name>
<fieldName>name</fieldName>
- <fieldName>extends</fieldName>
<unique>true</unique>
- <add>2.1</add>
+ <add>5.47</add>
</index>
<field>
<name>created_id</name>