BookManager::recurseTableOfContents truncate length is hard coded

Created on 19 October 2021, over 3 years ago
Updated 31 March 2023, about 2 years ago

Problem/Motivation

Building a table of contents for book pages through BookManager::recurseTableOfContents() now returns an array of truncated book page titles. In some cases 30 characters is not enough. Strange enough the book navigation block does not suffer from this issue so i wonder why titles are truncated in recurseTableOfContents in the first place.

Steps to reproduce

Call BookManager::recurseTableOfContents() from somewhere in your module and print the output to the screen.

Proposed resolution

Option 1 : Make truncating to 30 characters optional and configurable through /admin/structure/book/settings
Option 2 : Remove truncating and leave this to the theming layer

Remaining tasks

- Alter config form in /admin/structure/book/settings to include truncate settings.
- Implement truncate configuration in BookManager::recurseTableOfContents

User interface changes

- One extra configuration option in /admin/structure/book/settings.

API changes

None.

Data model changes

None.

Release notes snippet

Feature request
Status

Needs work

Version

10.1

Component
Book 

Last updated 3 months ago

Created by

🇳🇱Netherlands ericmulder1980

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024