-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] fix handling of nullable XML attributes #11672
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
Conversation
$routeCollection = $loader->load('null_values.xml'); | ||
$route = $routeCollection->get('blog_show'); | ||
|
||
$this->assertNull($route->getDefault('foo')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this alone doesnt test anything since getDefault also return null when it does not exist. so u need to also use hasDefault
@Tobion I didn't add any tests for |
Why not. It's easy and makes sure the implementation does not only check |
As @Tobion pointed out in symfony#11394, true and 1 are valid values in boolean XML attributes. The XmlFileLoader didn't handle 1 values properly.
Okay, added them. |
👍 |
2 similar comments
👍 |
👍 |
Thanks for fixing this bug @xabbuh. |
This PR was merged into the 2.3 branch. Discussion ---------- [Routing] fix handling of nullable XML attributes | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | As @Tobion pointed out in #11394, ``true`` and ``1`` are valid values in boolean XML attributes. The XmlFileLoader didn't handle ``1`` values properly. Commits ------- 7b4d4b6 fix handling of nullable XML attributes
My first merge :) |
@Tobion Thanks for all your feedback! |
As @Tobion pointed out in #11394,
true
and1
are valid values in boolean XML attributes. The XmlFileLoader didn't handle1
values properly.