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

[Metadata] Fix modifying metadata by serializing it early #4670

Merged
merged 2 commits into from
Apr 6, 2016

Conversation

pamil
Copy link
Contributor

@pamil pamil commented Apr 1, 2016

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #4472
License MIT

Metadata cannot be stored as object ORM type, because objects are
compared (===) by reference, not by value, what means that changes
would not be persisted.

The only working way I have found is to store metadata as text
type and serialize it on MetadataContainer::setMetadata() method
call. However, after every metadata modification we have to use that
method once again, if not - changes won't be persisted.

Metadata cannot be stored as `object` ORM type, because objects are
compared (===) by reference, not by value, what means that changes
would not be persisted.

The only working way I have found is to store metadata as `text`
type and serialize it on MetadataContainer::setMetadata() method
call. However, after every metadata modification we have to use that
method once again, if not - changes won't be persisted.
@pjedrzejewski pjedrzejewski merged commit e07930d into Sylius:master Apr 6, 2016
@pjedrzejewski
Copy link
Member

Thank you Kamil! /cc @peteward

@pamil pamil mentioned this pull request Apr 11, 2016
@pamil pamil deleted the metadata/fix-update branch April 11, 2016 13:29
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.

[Metadata] Update form is broken
2 participants