Repository navigation
Page List Block: fix warning error when the parent page has no child pages - #46829
Conversation
|
I want to ask, should pages without children be selectable as a page list in the first place? |
Ideally, only parent pages with child pages would be selectable. But once the block is saved, the child pages of that page may be deleted. I believe this PR is necessary for such cases. Perhaps the selection of pages should be addressed in a future follow-up. |
carolinan
left a comment
There was a problem hiding this comment.
That is a valid point.
I was able to reproduce the issue, and the PR solves it, the PHP notice is no longer present.
|
Thanks for the work here @t-hamano :) Also @carolinan I think the pages with no children should remain selectable as the menu is dynamic and it could be a default setup situation. |
What?
This PR fixes warning error when the parent page has no child pages in te page list block.
Why?
If the parent page that has no child pages is specified, the editor will display a normal alert message in the editor.
However, dynamic rendering treats it as having child pages, resulting in an error that the key does not exist.
How?
If the parent page has no child pages, it stops further processing and renders nothing.
Testing Instructions