Skip to content

Commit 391fceb

Browse files
committed
Allow null value encrypted property on insert.
1 parent 8ce9518 commit 391fceb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Subscribers/DoctrineEncryptSubscriber.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,13 @@ protected function processFields(object $entity, EntityManagerInterface $em, boo
199199
}
200200
}
201201

202-
if ($isInsert) {
202+
if ($isInsert && isset($this->rawValues[$oid])) {
203203
// Restore the decrypted values after the change set update
204204
foreach ($this->rawValues[$oid] as $prop => $rawValue) {
205205
$refProperty = $meta->getReflectionProperty($prop);
206206
$refProperty->setValue($entity, $rawValue);
207207
}
208+
208209
unset($this->rawValues[$oid]);
209210
}
210211

0 commit comments

Comments
 (0)