Skip to content

Commit

Permalink
DbResourcePage: Avoid showing a default charset for pgsql
Browse files Browse the repository at this point in the history
fixes #1035
  • Loading branch information
nilmerg committed Jul 26, 2024
1 parent 6f44fb1 commit 8afbb73
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion library/Icingadb/Setup/DbResourcePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,27 @@ public function createElements(array $formData)
]
);

$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' => ''
]
);
}
}

Expand Down

0 comments on commit 8afbb73

Please sign in to comment.