Skip to content

Page List: Restore view context for editor previews - #86030

Open
elphizu wants to merge 4 commits into
WordPress:trunkfrom
elphizu:fix/page-list-privacy-policy-preview
Open

elphizu wants to merge 4 commits into
WordPress:trunkfrom
elphizu:fix/page-list-privacy-policy-preview

Conversation

@elphizu

@elphizu elphizu commented Oct 30, 2026

Copy link
Copy Markdown

What?

Closes #86019.

Restores context: 'view' when fetching pages for the Page List block’s editor preview.

Why?

Editors see “Page List: Cannot retrieve Pages.” when a published page is assigned as the Privacy Policy page. The frontend continues to render correctly.

The query defaults to edit context, which excludes pages the current user cannot edit. For Editors, this includes the Privacy Policy page. The mismatch between returned records and the reported total causes core-data to treat the results as incomplete.

View context was previously added in #42559 to support users with lower permissions, then appears to have been unintentionally removed during the refactor in #46930.

How?

Explicitly sets context: 'view' in the Page List query. All fields used by the block are available in view context.

Testing Instructions

  1. As an Administrator, publish two pages.
  2. Assign one as the Privacy Policy page under Settings → Privacy.
  3. Sign in as an Editor.
  4. Create a post or page and insert a Page List block.
  5. Confirm the published pages appear, including the Privacy Policy page.
  6. Confirm the frontend still displays the list correctly.
  7. As an Administrator, check the parent-page selector and detach a Page List inside a Navigation block to confirm conversion still works.

Testing Instructions for Keyboard

Using only the keyboard, create a post, type /page list, and select the Page List block. Confirm the published pages appear without the retrieval error.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-6.1 Sol (light)
Used for: To investigate the issue and Git history and draft this PR description.

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

👋 Welcome

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @elphizu! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: elphizu <suryakantupadhyay@git.wordpress.org>
Co-authored-by: hiroshisatoy <hiroshisato@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

@github-actions github-actions Bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Oct 30, 2026
Synchronize the site editor loading queries and add Editor regression coverage for a published Privacy Policy page.

Credit to @flynn-eye for the related query synchronization and regression coverage in WordPress#86028.
…acy-policy-preview

# Conflicts:
#	packages/block-library/CHANGELOG.md
@github-actions github-actions Bot added the [Package] Edit Site /packages/edit-site label Oct 30, 2026
@elphizu

elphizu commented Oct 30, 2026 •

Copy link
Copy Markdown
Author

Thanks, @flynn-eye, for the related work in #86028

I'm not sure why that PR was closed, but it highlighted the matching queries in both site editors and the need for regression coverage.

I've included those query updates in this PR, along with a regression test for an Editor with a published Privacy Policy page.

@elphizu
elphizu marked this pull request as ready for review October 30, 2026 09:34
@elphizu
elphizu requested a review from fabiankaegy as a code owner October 30, 2026 09:34

This branch has not been deployed

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

Labels

First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Block library /packages/block-library [Package] Edit Site /packages/edit-site

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Page List shows "Cannot retrieve Pages" for Editors with a published Privacy Policy page

1 participant