DoctrineEncryptBundle icon indicating copy to clipboard operation
DoctrineEncryptBundle copied to clipboard

Empty field value throws exception

Open binarious opened this issue 12 years ago • 5 comments

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.

binarious avatar Jun 25 '13 09:06 binarious

FYI. This does not seem to be an issue with the MongoDB support as Doctrine just removes the offending field.

westinpigott avatar Oct 02 '13 22:10 westinpigott

@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?

binarious avatar Oct 04 '13 07:10 binarious

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?

westinpigott avatar Oct 04 '13 11:10 westinpigott

I can't take all the credit for #18. One of my coworkers, @epacetd did most of the hard work and then I refactored.

westinpigott avatar Oct 04 '13 11:10 westinpigott

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.

josecelano avatar May 02 '14 20:05 josecelano