fix bug in verwaltung textblöcke

This commit is contained in:
salam committed 2026-05-20 08:43:22 +02:00
1 parent 731a2d8aee
commit 79ccecf579
2 files changed
+10 -3

No files matched your search

@@ -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();
}
+6 -2
View File
@@ -20,7 +20,9 @@ use Illuminate\Support\HtmlString;
@endif
</x-slot>
{{ new HtmlString(RichContentRenderer::make($record->textblock)->toHtml()) }}
@if (isset($record->textblock))
{{ new HtmlString(RichContentRenderer::make($record->textblock)->toHtml()) }}
@endif
</x-filament::fieldset>
<?php
if($record->textblock2 != ""){
@@ -35,7 +37,9 @@ if($record->textblock2 != ""){
<span class="text-blue-600 dark:text-blue-400">Textblock Abschnitt B</span>
@endif
</x-slot>
{{ new HtmlString(RichContentRenderer::make($record->textblock2)->toHtml()) }}
@if (isset($record->textblock2))
{{ new HtmlString(RichContentRenderer::make($record->textblock2)->toHtml()) }}
@endif
</x-filament::fieldset>
<?php
}