Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page List: If no parent page is set, still render all children #45967

Merged
merged 3 commits into from
Nov 22, 2022

Conversation

scruffian
Copy link
Contributor

What?

Changes the condition to display child pages, to assume that NULL is not a valid parentPageID value.

Why?

If no parentPageID attribute is set, then we should display all the child pages.

How?

Change !==0 to 0<. This is maybe not ideal, as it makes some assumptions about the default value of parentPageID. Alternatively we could add an is_empty check.

Testing Instructions

  1. Add a Page List block to your post without a parent ID
  2. Check the front end display all page.

@scruffian scruffian added the [Block] Page List Affects the Page List Block label Nov 22, 2022
@scruffian scruffian requested a review from draganescu November 22, 2022 11:24
@scruffian scruffian self-assigned this Nov 22, 2022
@codesandbox
Copy link

codesandbox bot commented Nov 22, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

…e new parentPageID attribute.

Co-authored-by: Ben Dwyer <[email protected]>
Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the problem was that the PHP renderer did not find the attribute b/c of a bad rename commit. Fixed in this PR.

@scruffian scruffian enabled auto-merge (squash) November 22, 2022 12:41
@scruffian scruffian merged commit 367c180 into trunk Nov 22, 2022
@scruffian scruffian deleted the fix/page-list-render branch November 22, 2022 13:02
@github-actions github-actions bot added this to the Gutenberg 14.7 milestone Nov 22, 2022
@DaisyOlsen DaisyOlsen added the [Type] Bug An existing feature does not function as intended label Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Page List Affects the Page List Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants