From ee3c1400433a553274a7b7444aa8dc7ef4fea32e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20de=20Dios=20Fern=C3=A1ndez?= Date: Mon, 22 Jan 2024 17:20:22 +0100 Subject: [PATCH 1/2] Set list_format in ContentEditController save function --- src/Controller/Backend/ContentEditController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Controller/Backend/ContentEditController.php b/src/Controller/Backend/ContentEditController.php index a960dd472..b5efac584 100644 --- a/src/Controller/Backend/ContentEditController.php +++ b/src/Controller/Backend/ContentEditController.php @@ -214,6 +214,12 @@ public function save(?Content $originalContent = null, ?ContentValidatorInterfac $this->em->persist($content); $this->em->flush(); + // Set the list_format of the Record in the bolt_content table. This has to be done in a 2nd iteration because + // $content does not have id set untill the Entity Manager is flushed. + $content->setListFormat(); + $this->em->persist($content); + $this->em->flush(); + $urlParams = [ 'id' => $content->getId(), 'edit_locale' => $this->getEditLocale($content) ?: null, From abd9e2ea77d5da734e4e35ce993a2c95cffde999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20de=20Dios=20Fern=C3=A1ndez?= Date: Mon, 29 Jan 2024 09:41:14 +0100 Subject: [PATCH 2/2] Set $this->format empty instead of $this->title --- src/Entity/Content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entity/Content.php b/src/Entity/Content.php index 1f1471dff..24ae8e3f0 100644 --- a/src/Entity/Content.php +++ b/src/Entity/Content.php @@ -911,7 +911,7 @@ public function setListFormat(): self if ($this->contentExtension instanceof ContentExtension) { $this->listFormat = Excerpt::getExcerpt($this->getExtras()['listFormat'], 191); } else { - $this->title = ''; + $this->listFormat = ''; } return $this;