-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DomCrawler] Fails in PHP7.2 for same name fields, different types #28179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could it be the order of nodes is changed? Because im amazed that this did work in PHP7.0. I looked at the changelog for php but couldnt find anything. What i could imagine is that the order changed, and that before we had the select first, and than the input. Which would make the input override the select. |
I think we should just exclude disabled form elements when searching for form elements |
So changing to ignore the disabled fields. Just like PHP would do, and just like we do when requesting the values in
Guess this would also mean we could dump the |
This PR was merged into the 3.4 branch. Discussion ---------- [DomCrawler] Skip disabled fields processing in Form | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #28179 | License | MIT Commits ------- c73b042 bug #28179 [DomCrawler] Skip disabled fields processing in Form
* 3.4: [Phpunit] Fix running skipped tests expecting only deprecations [DependencyInjection] #35505 Fix typo in test name [Yaml][Inline] Fail properly on empty object tag and empty const tag Check non-null type for numeric type Check value isset to avoid PHP notice bug #28179 [DomCrawler] Skip disabled fields processing in Form
* 4.4: [Phpunit] Fix running skipped tests expecting only deprecations Fix merge [Config] dont catch instances of Error [HttpClient] fix HttpClientDataCollector when handling canceled responses [DependencyInjection] #35505 Fix typo in test name [Yaml][Inline] Fail properly on empty object tag and empty const tag Check non-null type for numeric type Check value isset to avoid PHP notice bug #28179 [DomCrawler] Skip disabled fields processing in Form
* 5.0: [Phpunit] Fix running skipped tests expecting only deprecations Fix merge [Config] dont catch instances of Error [HttpClient] fix HttpClientDataCollector when handling canceled responses [FrameworkBundle] remove mention of the old Controller class [DependencyInjection] #35505 Fix typo in test name [Yaml][Inline] Fail properly on empty object tag and empty const tag Check non-null type for numeric type Check value isset to avoid PHP notice bug #28179 [DomCrawler] Skip disabled fields processing in Form
…g in Form" This reverts commit c73b042.
…ssing in Form" (dmaicher) This PR was merged into the 3.4 branch. Discussion ---------- Revert "bug #28179 [DomCrawler] Skip disabled fields processing in Form" | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #35923 | License | MIT | Doc PR | - Reverts #34059 See #35923 Commits ------- af17f5a Revert "bug #28179 [DomCrawler] Skip disabled fields processing in Form"
* 3.4: [Yaml] fix dumping strings containing CRs [DI] Fix XmlFileLoader bad error message Tweak message improve PlaintextPasswordEncoder docBlock summary [Validator] Add two missing translations for the Arabic (ar) locale Use some PHP 5.4 constants unconditionally Revert "bug #28179 [DomCrawler] Skip disabled fields processing in Form" Add Spanish translation Fix typo [Validator] add Japanese translation Fix typo Add Polish translation [SecurityBundle] Minor fixes in configuration tree builder bumped Symfony version to 3.4.39 updated VERSION for 3.4.38 update CONTRIBUTORS for 3.4.38 updated CHANGELOG for 3.4.38
Symfony version(s) affected: x.y.z
"name": "symfony/dom-crawler",
"version": "v2.7.49",
Description
Codeception/Codeception#5119
#11689
#11692
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 theinput
field. This is not what PHP would do. Because the field is disabled, thePOST
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
The text was updated successfully, but these errors were encountered: