Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DomCrawler] disabled form fields not reachable anymore #35923

Copy link
Copy link
Closed
@dmaicher

Description

@dmaicher
Issue body actions

Symfony version(s) affected: 3.4.38, 4.4.5, 5.0.5

Description
It seems since #34059 a disabled form field is not added to the form anymore at all which seems odd.

In one of my tests I was retrieving a disabled form field and checking its value. This is not possible anymore now.

How to reproduce

<?php

use Symfony\Component\DomCrawler\Crawler;

$html = <<<HTML
<html>
    <form>
        <input type="text" name="foo" value="bar" disabled />
    </form>
</html>
HTML;

$crawler = new Crawler($html, 'http://localhost/');

dump($crawler->filter('form')->form()->get('foo')->getValue());

Works with 4.4.4 and breaks with 4.4.5: InvalidArgumentException: Unreachable field "foo"

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.