pressbooks-book
pressbooks-book copied to clipboard
Front/back matter and numberless chapters without titles can't be accessed from ToC
Description
When a back/front matter is created with an empty title, or a numberless chapter is created without a title, is not possible to click and access to it in the Contents menu or contents list in the book's home page.
See:
Steps to Reproduce
- Add a back and/or front matter with an empty title
- Go to the main page of the book and try to access to it. You should not be able to access to it.
- Go to any chapter and go to the top-left content menu and try to access to the back or front matter created in the point 1. You should not be able to access to it.
Expected behavior: Does not allow to create back or front matter with empty title, or add an access to the menu and contents list.
Actual behavior: An empty item in the menu and in the contents list is created, without any link to access to the content.
See https://wordpress.stackexchange.com/a/65274/130805 for one possible approach.
Proposed solution: add a pre-update/save check to require a title. If one is not present, display an error message 'This content could not be saved without a title.' and focus should be moved to the title field.