Chapter description is not exported during the book export (PDF) #1199

Closed
opened 2026-02-05 00:14:06 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @heroin-moose on GitHub (May 24, 2019).

Describe the bug
When I have a chapter with a manually written description, I can't see the description in the PDF file if I export the whole book. If I just export one chapter, I can see it just fine. I don't think that this issue is related to the PDF exporting engine (I use wkhtmltopdf) as I see empty <p></p> instead of <p>DESCRIPTION HERE</p> in the intermediate HTML file. Also this issue is reproducible on the demo site.

Steps To Reproduce

  1. Create a new book named "Test"
  2. Create a chapter named "TESTING" with a description "HURR DURR TESTING STUFF"
  3. Export the book to PDF
  4. Search for "HURR DURR" without any luck
  5. Export the chapter to PDF
  6. Succesfully search for "HURR DURR"

Expected behavior
A manually written chapter description should be visible in the PDF file when exporting a book.

Your Configuration (please complete the following information):

  • Demo site (24 May 2019)
Originally created by @heroin-moose on GitHub (May 24, 2019). **Describe the bug** When I have a chapter with a manually written description, I can't see the description in the PDF file if I export the whole book. If I just export one chapter, I can see it just fine. I don't think that this issue is related to the PDF exporting engine (I use wkhtmltopdf) as I see empty \<p>\</p> instead of \<p>DESCRIPTION HERE\</p> in the intermediate HTML file. Also this issue is reproducible on the demo site. **Steps To Reproduce** 1. Create a new book named "Test" 2. Create a chapter named "TESTING" with a description "HURR DURR TESTING STUFF" 3. Export the book to PDF 4. Search for "HURR DURR" without any luck 5. Export the chapter to PDF 6. Succesfully search for "HURR DURR" **Expected behavior** A manually written chapter description should be visible in the PDF file when exporting a book. **Your Configuration (please complete the following information):** - Demo site (24 May 2019)
OVERLORD added the 🔍 Pending Validation label 2026-02-05 00:14:06 +03:00
Author
Owner

@heroin-moose commented on GitHub (May 24, 2019):

I am not a real web-developer, but it seems like the issue may be coming from bookChildrenQuery() function which in turn calls Chapter's entityRawQuery() function that does not return the description field at all.

The call chain looks like this:

bookToPdf() 
    -> $this->entityRepo->getBookChildren($book, true, true)
        -> $this->permissionService->bookChildrenQuery($book->id, $filterDrafts, $renderPages)
            -> $this->db->table('chapters')->selectRaw($entities->chapter->entityRawQuery())
@heroin-moose commented on GitHub (May 24, 2019): I am not a real web-developer, but it seems like the issue __may__ be coming from `bookChildrenQuery()` function which in turn calls Chapter's `entityRawQuery()` function that does not return the description field at all. The call chain looks like this: ``` bookToPdf() -> $this->entityRepo->getBookChildren($book, true, true) -> $this->permissionService->bookChildrenQuery($book->id, $filterDrafts, $renderPages) -> $this->db->table('chapters')->selectRaw($entities->chapter->entityRawQuery()) ```
Author
Owner

@ssddanbrown commented on GitHub (May 25, 2019):

Thanks for reporting @heroin-moose and also thanks for going to some effort to find the cause.

You were pretty close, The entityRawQuery() function does return the description content but it renames the field to text in the result. Just needed a name change in the export template. Added a test to cover: 35e6635379

This will be in the next patch release.

@ssddanbrown commented on GitHub (May 25, 2019): Thanks for reporting @heroin-moose and also thanks for going to some effort to find the cause. You were pretty close, The `entityRawQuery()` function does return the description content but it renames the field to `text` in the result. Just needed a name change in the export template. Added a test to cover: 35e6635379d8a4027ddba559a9ff51eb7f83969e This will be in the next patch release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1199