Skip to content

Commit

Permalink
Merge pull request #7838 from laboro/fix/BAP-11039_1.9
Browse files Browse the repository at this point in the history
BAP-11039: Integrity constraint violation during IMAP synchronization
  • Loading branch information
Krushelnitskiy authored Jul 12, 2016
2 parents f3f8b9f + ec62d3f commit 71faea5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,10 @@ protected function removeImapEmailReference(ImapEmail $imapEmail)

$emailUser = $imapEmail->getEmail()->getEmailUserByFolder($imapEmail->getImapFolder()->getFolder());
if ($emailUser != null) {
$imapEmail->getEmail()->getEmailUsers()->removeElement($emailUser);
$emailUser->removeFolder($imapEmail->getImapFolder()->getFolder());
if (!$emailUser->getFolders()->count()) {
$imapEmail->getEmail()->getEmailUsers()->removeElement($emailUser);
}
}
$this->em->remove($imapEmail);
}
Expand Down

0 comments on commit 71faea5

Please sign in to comment.