-
Notifications
You must be signed in to change notification settings - Fork 111
HTML mismatch in Dropdown with allowMultiple #1738
Copy link
Copy link
Closed
Labels
Description
Steps to reproduce:
- Add a Dropdown with isMultiple support
$recipient = $form->addControl('recipient',
[\Atk4\Ui\Form\Control\Dropdown::class,
'isMultiple' => true,
'dropdownOptions' => ['allowAdditions' => true, 'forceSelection' => false]
], ['default' => 'Username <user@emaildomain.de>']
);
- In the most recent versions (tested in develop but probably since 3.1) on Submit (POST) wrong data is submitted and thus also saved:
Username <user@emaildomain.de>, Username <user@emaildomain.de>
You can see this already on rendering of the form, that the hidden <input...> for that dropdown contains the wrong comma-separated two values with original string and htmlencoded string erroneously.
Bad workaround: you submit already the htmlspecialchars('Username user@emaildomain.de') as a default, then it would not happen. Probably an issue with typecasting.
Expected result:
The non-html-encoded string is received on POST/saved into the database, rather that the double-entry list with one htmldecoded, one encoded element string.
Username <user@emaildomain.de>
Reactions are currently unavailable