Skip to content

Commit

Permalink
Solve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoran Kabic committed Mar 22, 2024
2 parents c82ffc8 + c986278 commit 6ba6cc6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ public function overrideSlugIfNeeded(ArticleEvent $event): void

if ($previousRoute && $overrideSlugOnCorrection && null !== $article->getSlug()) {
$this->savePreviousRelativeUrl($article, $previousRoute);
$article->setSlug($package->getSlugline() ?? Transliterator::urlize($article->getTitle()));
}else if ($previousRoute) {
$slug = empty($package->getSlugline()) ?
$package->getSlugline() : Transliterator::urlize($article->getTitle());
$article->setSlug($slug);
} elseif ($previousRoute) {
$this->savePreviousRelativeUrl($article, $previousRoute);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

namespace SWP\Bundle\CoreBundle\MessageHandler;

use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Doctrine\DBAL\Exception\NotNullConstraintViolationException;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\NonUniqueResultException;
Expand Down Expand Up @@ -88,6 +89,14 @@ public function execute(int $tenantId, PackageInterface $package): void
}

$this->doExecute($tenantId, $package);
} catch (UniqueConstraintViolationException $e) {
$this->logException($e, $package, 'UniqueConstraintViolationException exception');

$cacheDriver = $this->packageObjectManager->getConfiguration()->getMetadataCacheImpl();
$cacheDriver->flushAll();

throw $e;

} catch (NonUniqueResultException | NotNullConstraintViolationException $e) {
$this->logException($e, $package, 'Unhandled NonUnique or NotNullConstraint exception');

Expand Down

0 comments on commit 6ba6cc6

Please sign in to comment.