Ref #16977 - Fix selected value for enum get values route
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
15dfab25ee
commit
1bd76fc474
@ -269,9 +269,12 @@ class SqlController extends AbstractController
|
||||
return;
|
||||
}
|
||||
|
||||
// Converts characters of $curr_value to HTML entities.
|
||||
$convertedCurrentValue = htmlentities($curr_value, ENT_COMPAT, 'UTF-8');
|
||||
|
||||
$dropdown = $this->template->render('sql/enum_column_dropdown', [
|
||||
'values' => $values,
|
||||
'selected_values' => [$curr_value],
|
||||
'selected_values' => [$convertedCurrentValue],
|
||||
]);
|
||||
|
||||
$this->response->addJSON('dropdown', $dropdown);
|
||||
|
||||
@ -195,7 +195,7 @@ class SqlControllerTest extends AbstractTestCase
|
||||
'dropdown' => '<select>' . "\n"
|
||||
. ' <option value=""> </option>' . "\n"
|
||||
. ' <option value="a&b">a&b</option>' . "\n"
|
||||
. ' <option value="b&c">b&c</option>' . "\n"
|
||||
. ' <option value="b&c" selected>b&c</option>' . "\n"
|
||||
. ' <option value="vrai&amp">vrai&amp</option>' . "\n"
|
||||
. ' <option value=""></option>' . "\n"
|
||||
. ' </select>' . "\n",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user