Skip to content

Commit e7cc207

Browse files
committed
minor #1338 Post slug is no longer overridden (ecourtial)
This PR was merged into the main branch. Discussion ---------- Post slug is no longer overridden See #1333 Commits ------- 68b0afe Post slug is no longer overridden
2 parents 681a45d + 68b0afe commit e7cc207

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Form/PostType.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
7979
->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) {
8080
/** @var Post */
8181
$post = $event->getData();
82-
if (null !== $postTitle = $post->getTitle()) {
83-
$post->setSlug($this->slugger->slug($postTitle)->lower());
82+
if (null === $post->getSlug() && null !== $post->getTitle()) {
83+
$post->setSlug($this->slugger->slug($post->getTitle())->lower());
8484
}
8585
})
8686
;

0 commit comments

Comments
 (0)