Skip to content

Navigation Block: cannot "Add all pages" when directly editing a Template Part #29236

@mattwiebe

Description

@mattwiebe

Description

Upon adding a Navigation Block while directly editing a Template Part (eg Appearance → Template Parts), clicking "Add all pages" will produce the error Error loading block: Invalid parameter(s): post_id

Note that the error does not appear directly in the full Site Editor, even when the Navigation Block is added to a Template Part within that context.

Step-by-step reproduction instructions

  1. Go to Appearance → Template Parts with a FSE-enabled theme active
  2. Create a new Template Part (or edit existing)
  3. Add a Navigation block (either horizontal or vertical)
  4. Click "Add all pages"
  5. Note the error Error loading block: Invalid parameter(s): post_id

Expected behaviour

All pages added

Actual behaviour

Error

Screenshots or screen recording (optional)

image

Code snippet (optional)

The error happens in this REST API request:

/wp-json/wp/v2/block-renderer/core/page-list?context=edit&post_id=q%2F%2Ftemplate-part-5&_locale=user

That post_id looks fishy indeed. It's omitted in the Site Editor context.

WordPress information

  • WordPress version: 5.6.2
  • Gutenberg version: 10.0.1
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? No

Device information

  • Device: Desktop
  • Operating system: macOS 11.2.1
  • Browser: Chrome 88

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions