NOW MANAGED ON CODEBERG
Fixed chapter description not showing in book exports
Dan Brown35e6635379d8
diff --git a/resources/views/books/export.blade.php b/resources/views/books/export.blade.phpindex e1fabd800..61c16c72d 100644--- a/resources/views/books/export.blade.php+++ b/resources/views/books/export.blade.php@@ -58,7 +58,7 @@<h1 id="{{$bookChild->getType()}}-{{$bookChild->id}}">{{ $bookChild->name }}</h1>@if($bookChild->isA('chapter'))- <p>{{ $bookChild->description }}</p>+ <p>{{ $bookChild->text }}</p>@if(count($bookChild->pages) > 0)@foreach($bookChild->pages as $page)diff --git a/tests/Entity/ExportTest.php b/tests/Entity/ExportTest.phpindex fdcd83366..683f23674 100644--- a/tests/Entity/ExportTest.php+++ b/tests/Entity/ExportTest.php@@ -76,6 +76,20 @@ class ExportTest extends TestCase$resp->assertHeader('Content-Disposition', 'attachment; filename="' . $book->slug . '.html"');}+ public function test_book_html_export_shows_chapter_descriptions()+ {+ $chapterDesc = 'My custom test chapter description ' . str_random(12);+ $chapter = Chapter::query()->first();+ $chapter->description = $chapterDesc;+ $chapter->save();++ $book = $chapter->book;+ $this->asEditor();++ $resp = $this->get($book->getUrl('/export/html'));+ $resp->assertSee($chapterDesc);+ }+public function test_chapter_text_export(){$chapter = Chapter::first();