Skip to content

Commit 8afbb73

Browse files
committed
DbResourcePage: Avoid showing a default charset for pgsql
fixes #1035
1 parent 6f44fb1 commit 8afbb73

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

library/Icingadb/Setup/DbResourcePage.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,27 @@ public function createElements(array $formData)
5858
]
5959
);
6060

61+
$charsetElement = $this->getElement('charset');
6162
if (! isset($formData['db']) || $formData['db'] === 'mysql') {
62-
$this->getElement('charset')->setValue('utf8mb4');
63+
$charsetElement->setValue('utf8mb4')->addDecorator(
64+
['preserveDefault' => 'HtmlTag'],
65+
[
66+
'tag' => 'input',
67+
'type' => 'hidden',
68+
'name' => 'charset' . static::DEFAULT_SUFFIX,
69+
'value' => 'utf8mb4'
70+
]
71+
);
72+
} else {
73+
$charsetElement->addDecorator(
74+
['preserveDefault' => 'HtmlTag'],
75+
[
76+
'tag' => 'input',
77+
'type' => 'hidden',
78+
'name' => 'charset' . static::DEFAULT_SUFFIX,
79+
'value' => ''
80+
]
81+
);
6382
}
6483
}
6584

0 commit comments

Comments
 (0)