DbResourcePage: Avoid showing a default charset for pgsql

fixes #1035
This commit is contained in:
Johannes Meyer 2024-07-25 09:43:38 +02:00
parent 6f44fb1139
commit 8afbb7385d

View file

@ -58,8 +58,27 @@ class DbResourcePage extends Form
]
);
$charsetElement = $this->getElement('charset');
if (! isset($formData['db']) || $formData['db'] === 'mysql') {
$this->getElement('charset')->setValue('utf8mb4');
$charsetElement->setValue('utf8mb4')->addDecorator(
['preserveDefault' => 'HtmlTag'],
[
'tag' => 'input',
'type' => 'hidden',
'name' => 'charset' . static::DEFAULT_SUFFIX,
'value' => 'utf8mb4'
]
);
} else {
$charsetElement->addDecorator(
['preserveDefault' => 'HtmlTag'],
[
'tag' => 'input',
'type' => 'hidden',
'name' => 'charset' . static::DEFAULT_SUFFIX,
'value' => ''
]
);
}
}