Skip to content

Table of contents block – links don't work on initial save #66781

Open

Description

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

  1. Create a new page
  2. Add content, with headings, and the Table of Content block
  3. Publish the page
  4. View the page
  5. Try the TOC links
  6. Return to the editor and make a change
  7. Update the published page
  8. View the page
  9. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions