Detach invalid entity
[MAILPOET-4104]
This commit is contained in:
@ -229,8 +229,14 @@ class SubscriberSaveController {
|
||||
// wipe any unconfirmed data at this point
|
||||
$subscriber->setUnconfirmedData(null);
|
||||
|
||||
$this->subscribersRepository->persist($subscriber);
|
||||
$this->subscribersRepository->flush();
|
||||
try {
|
||||
$this->subscribersRepository->persist($subscriber);
|
||||
$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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user