Skip to content

Commit

Permalink
Merge pull request #1253 from superdesk/SWP-2282
Browse files Browse the repository at this point in the history
Output control loading fixes as part of SWP-2282
  • Loading branch information
IvanJelicSF authored Mar 25, 2024
2 parents b110482 + fb7e441 commit e3fcb36
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public function overrideSlugIfNeeded(ArticleEvent $event): void

if ($overrideSlugOnCorrection && null !== $article->getSlug()) {
$this->savePreviousRelativeUrl($article);
$article->setSlug($package->getSlugline() ?? Transliterator::urlize($article->getTitle()));
$slug = !empty($package->getSlugline()) ?
$package->getSlugline() : Transliterator::urlize($article->getTitle());
$article->setSlug($slug);
}
}

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 @@ -86,6 +87,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 e3fcb36

Please sign in to comment.