Skip to content
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

[ResourceBundle] Prevent overriding existing association mappings #7367

Merged
merged 1 commit into from
Jan 30, 2017
Merged

[ResourceBundle] Prevent overriding existing association mappings #7367

merged 1 commit into from
Jan 30, 2017

Conversation

vntw
Copy link
Contributor

@vntw vntw commented Jan 30, 2017

Q A
Bug fix? yes
New feature? no
BC breaks? no
License MIT

If the metadata already has existing association mappings for the given field, we won't override anything and leave it as is.

Example:
In our bundle, we define our own product entity and want to add an order-by to the association mapping of an existing field. So we copy the field definition from Product.orm.xml to our own configuration and modify it to our needs.

The current code will always override our custom association mappings for a given field. So the fix is to check if the field has custom association mappings and only apply them if none are configured.

Also renamed the hasRelation method since it's really checking if it is a relation.

If the metadata already has existing association mappings for the given
field, we won't override anything and leave it as is.
@pjedrzejewski pjedrzejewski merged commit bfc782c into Sylius:master Jan 30, 2017
@pjedrzejewski
Copy link
Member

Thanks @venyii, this is a great improvement! :)

@vntw vntw deleted the fix-mappedsuperclass-subscriber branch January 30, 2017 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants