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

dev/core#334 Use the current in use collation and character sets when… #18642

Merged
merged 1 commit into from
Sep 30, 2020
Merged
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
7 changes: 6 additions & 1 deletion CRM/Core/BAO/CustomField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1610,10 +1610,15 @@ public static function formatCustomField(
*/
public static function defaultCustomTableSchema($params) {
// add the id and extends_id
$collation = CRM_Core_BAO_SchemaHandler::getInUseCollation();
$characterSet = 'utf8';
if (stripos($collation, 'utf8mb4') !== FALSE) {
$characterSet = 'utf8mb4';
}
$table = [
'name' => $params['name'],
'is_multiple' => $params['is_multiple'],
'attributes' => "ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci",
'attributes' => "ENGINE=InnoDB DEFAULT CHARACTER SET {$characterSet} COLLATE {$collation}",
'fields' => [
[
'name' => 'id',
Expand Down