pressbooks-book icon indicating copy to clipboard operation
pressbooks-book copied to clipboard

Front/back matter and numberless chapters without titles can't be accessed from ToC

Open richard015ar opened this issue 3 years ago • 2 comments

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: Screenshot from 2021-08-26 08-10-42 Screenshot from 2021-08-26 08-10-26

Steps to Reproduce

  1. Add a back and/or front matter with an empty title
  2. Go to the main page of the book and try to access to it. You should not be able to access to it.
  3. 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.

richard015ar avatar Aug 26 '21 12:08 richard015ar

See https://wordpress.stackexchange.com/a/65274/130805 for one possible approach.

SteelWagstaff avatar Sep 01 '21 21:09 SteelWagstaff

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.

SteelWagstaff avatar Sep 09 '21 15:09 SteelWagstaff