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
[Validator][ConstraintViolation] Implemented Serializable #25386
Conversation
If it's a bugfix it should be in the lower branch where the bug exists. Could you please check why the tests are not passing ? |
Reading the linked issue, I understand why this has been submitted ( |
moving to the 3.4 milestone as the last bugfix release for 3.3 was published today |
Another solution could be to check in FormError if the cause itself is serializable, as @ogizanagi suggest in the linked issue. What do you guys think about that solution ? |
Implementing |
Unfortunately, I don't have much more appart making |
{ | ||
public function testSerializeFormError() | ||
{ | ||
if (!class_exists(ConstraintViolation::class)) { |
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 is not required as symfony/validator
is listed under require-dev
👍 for implementing |
Hey Guys, Couldn't find the reason why tests are failing on travis. If someone has any idea is more than welcome. |
…able and ignore the root property.
193d079
to
85fbae2
Compare
Note you can already serialize the violation list using the Which will work with any |
85fbae2
to
1a796d9
Compare
Do we still need this PR after @ro0NL's comment? |
I missed @ro0NL 's comment on this PR. I might be misinterpreting, but I fail to understand how it relates to the original issue. Yes, constraint violations can be serialized using the Symfony serializer. However, I don't know the use-case, and perhaps what's wrong here is letting users think a |
Deprecating |
Aren't form errors serialised when the profile is written to the filesystem? |
@xabbuh : I don't think that's true anymore. We serialize |
I'm closing here as serializing is not a primary use case of the class. Using VarDumper for cloning is used internally - and should/could be used in similar userland cases IMHO - (using the Serializer component would work also). Thanks @alexmarucci for helping this move forward. |
Implemented serializable and ignore the root property to avoid exception.