DoctrineEncryptBundle
DoctrineEncryptBundle copied to clipboard
Empty field value throws exception
When I want to encrypt an optional field which can be null, I get the following error:
Field "myField" is not a valid field of the entity "XXX\XXXBundle\Entity\MyEntity" in PreUpdateEventArgs.
FYI. This does not seem to be an issue with the MongoDB support as Doctrine just removes the offending field.
@westinpigott, first: +1 for PR #18 The problem occours when you save the entity twice in the same request. Does it work with your MongoDB implementation?
I will have to check. You are saying that I need to change a value, flush, change another value on the same document, then flush again, correct?
I can't take all the credit for #18. One of my coworkers, @epacetd did most of the hard work and then I refactored.
I have the same problem:
Field "myField" is not a valid field of the entity "XXX\XXXBundle\Entity\MyEntity" in PreUpdateEventArgs.
The problem occours when I save another entity in the same request before saving the entity that casuses the problem. The field value is not empty.
I use Doctrine+MySQL.
If I do a test saving the entoty without saving the previous entity (other class) there is no problem.