Skip to content

[DependencyInjection] Fix support for inner collections when using <bind> #50061

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

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

zerustech
Copy link
Contributor

Q A
Branch? 6.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #50046
License MIT

@carsonbot carsonbot added this to the 6.2 milestone Apr 19, 2023
@carsonbot carsonbot changed the title Fix issue #50046 [DependencyInjection] Fix issue #50046 Apr 19, 2023
@nicolas-grekas nicolas-grekas changed the title [DependencyInjection] Fix issue #50046 [DependencyInjection] Fix support for inner collections when using <bind> Apr 19, 2023
@@ -276,6 +276,7 @@
<xsd:complexType name="bind" mixed="true">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="bind" type="argument" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="argument" type="argument" minOccurs="0" maxOccurs="unbounded" />
Copy link
Member

@nicolas-grekas nicolas-grekas Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On closer review, I feel like I mislead you: maybe we can just set the type to "bind" on the line above and remove this one.
Yes, that would forbid XML files that use <argument> nested inside <bind>. But these were ignored, isn't it? In that case, I would definitely be fine "breaking" those files, proved they are really misleading, thus broken also at the moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause an XML validation error: since attribute key was optional for argument elements, but is required for bind elements now, any XML file that contains an inner <bind> element without a key attribute will not be parsed successfully.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it thanks! I updated the PR to add a new "bind_argument" complex type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that works perfectly.

@nicolas-grekas
Copy link
Member

Thank you @zerustech.

@nicolas-grekas nicolas-grekas merged commit a79fe36 into symfony:6.2 Apr 19, 2023
@zerustech
Copy link
Contributor Author

No problem.

@fabpot fabpot mentioned this pull request Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants