Skip to content

HTML mismatch in Dropdown with allowMultiple #1738

@mkrecek234

Description

@mkrecek234

Steps to reproduce:

  1. 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>']
                );
  1. 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 &lt;user@emaildomain.de&gt;

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions