Detach invalid entity
[MAILPOET-4104]
This commit is contained in:
@@ -229,8 +229,14 @@ class SubscriberSaveController {
|
|||||||
// wipe any unconfirmed data at this point
|
// wipe any unconfirmed data at this point
|
||||||
$subscriber->setUnconfirmedData(null);
|
$subscriber->setUnconfirmedData(null);
|
||||||
|
|
||||||
|
try {
|
||||||
$this->subscribersRepository->persist($subscriber);
|
$this->subscribersRepository->persist($subscriber);
|
||||||
$this->subscribersRepository->flush();
|
$this->subscribersRepository->flush();
|
||||||
|
} catch (ValidationException $exception) {
|
||||||
|
// detach invalid entity because it can block another work with doctrine
|
||||||
|
$this->subscribersRepository->detach($subscriber);
|
||||||
|
throw $exception;
|
||||||
|
}
|
||||||
|
|
||||||
return $subscriber;
|
return $subscriber;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user