From 79ccecf579c345802dd0bcb2e44fecfffff43766 Mon Sep 17 00:00:00 2001 From: salam Date: Wed, 20 May 2026 08:43:22 +0200 Subject: [PATCH] =?UTF-8?q?fix=20bug=20in=20verwaltung=20textbl=C3=B6cke?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Actions/Create/CreateProjektInhaltsverzeichnis.php | 5 ++++- resources/views/pages/textblock.blade.php | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/Actions/Create/CreateProjektInhaltsverzeichnis.php b/app/Actions/Create/CreateProjektInhaltsverzeichnis.php index b003a18..a50dabb 100644 --- a/app/Actions/Create/CreateProjektInhaltsverzeichnis.php +++ b/app/Actions/Create/CreateProjektInhaltsverzeichnis.php @@ -17,7 +17,6 @@ class CreateProjektInhaltsverzeichnis foreach ($inhaltsverzeichnis as $key => $value) { $key++; - $text = Textblock::where('id', $value->textblock_id)->first(); $inhalt = new ProjektInhaltsverzeichnis; $inhalt->projekte_id = $record->id; $inhalt->inhaltsverzeichnis_id = $value->id; @@ -32,8 +31,12 @@ class CreateProjektInhaltsverzeichnis $inhalt->neue_seite = $value->neue_seite; $inhalt->no_edit = $value->no_edit; $inhalt->textblock_name = $text->name ?? ''; + + $text = Textblock::where('id', $value->textblock_id)->first(); + $inhalt->textblock = $text->textblock ?? ''; $inhalt->textblock2 = $text->textblock2 ?? ''; + $inhalt->save(); } diff --git a/resources/views/pages/textblock.blade.php b/resources/views/pages/textblock.blade.php index 26a02c3..05bd6e0 100644 --- a/resources/views/pages/textblock.blade.php +++ b/resources/views/pages/textblock.blade.php @@ -20,7 +20,9 @@ use Illuminate\Support\HtmlString; @endif - {{ new HtmlString(RichContentRenderer::make($record->textblock)->toHtml()) }} + @if (isset($record->textblock)) + {{ new HtmlString(RichContentRenderer::make($record->textblock)->toHtml()) }} + @endif textblock2 != ""){ @@ -35,7 +37,9 @@ if($record->textblock2 != ""){ Textblock Abschnitt B @endif - {{ new HtmlString(RichContentRenderer::make($record->textblock2)->toHtml()) }} + @if (isset($record->textblock2)) + {{ new HtmlString(RichContentRenderer::make($record->textblock2)->toHtml()) }} + @endif