Skip to content

[DomCrawler] Fails in PHP7.2 for same name fields, different types #28179

@michsk

Description

@michsk

Symfony version(s) affected: x.y.z
"name": "symfony/dom-crawler",
"version": "v2.7.49",

Description
Codeception/Codeception#5119
#11689
#11692

<form id="form" action="/index.php" method="post">
<input type="text" id="originator" class="alpha form-control" name="form[origin]" value="thisshouldbeinpost" placeholder="Afzender" maxLength="18">
<select id="originator" name="form[origin]" disabled>
<option value="one">one</option>
<option value="two">two</option>
<option value="tree">tree</option>
</select>
<input type="submit">
</form>

So it seems that the fix mentioned above does not work for PHP7.2. In the above example. The field of the disabled select is chosen over the input field. This is not what PHP would do. Because the field is disabled, the POST does not contain the field.

Possible Solution
Investigate on how to allow different types to be used as well in \Symfony\Component\DomCrawler\Form::addField

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions