Description
openedon Aug 20, 2022
Quick summary
If you add the Table of Contents block to a new page, when you publish the page, the links don't work properly and instead open a new page with a Page not found error. The URL is retaining an auto-draft
in it. If you edit and Update the page, the links will then work properly. Alternatively, if you publish the page first, then add the Table of Contents block, they will work correctly.
Screen.Capture.on.2022-08-20.at.10-40-21.mp4
Steps to reproduce
- Create a new page
- Add content, with headings, and the Table of Content block
- Publish the page
- View the page
- Try the TOC links
- Return to the editor and make a change
- Update the published page
- View the page
- The TOC links now work
What you expected to happen
I expected the links to work when I first published the page with the content and TOC block in place.
What actually happened
The TOC links open a new page with a Page not found error.
Context
Discovered while explaining to a customer how the Table of Contents block works. Worth noting that as per regular anchor links, the TOC links also don't work if the page is saved as a draft. Would be worth including a notice of this and adding it to the support documentation.
Platform (Simple, Atomic, or both?)
Simple, Atomic
Theme-specific issue?
No response
Browser, operating system and other notes
No response
Reproducibility
Consistent
Severity
All
Available workarounds?
Yes, difficult to implement
Workaround details
The work around isn't "difficult" per se, but it's not intuitive and users won't think to try it. You either need to publish the page "before" adding the TOC block, OR you need to make a change and update the page again after publishing it. This feels like a pretty high priority to fix for a brand new block.
Metadata
Assignees
Labels
Type
Projects
Status
Triaged
Status
Gutenberg / WP Core