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

Undefined array key "paged" in comments-pagination-previous.php #65424

Closed
michalczaplinski opened this issue Sep 17, 2024 · 0 comments · Fixed by #65435
Closed

Undefined array key "paged" in comments-pagination-previous.php #65424

michalczaplinski opened this issue Sep 17, 2024 · 0 comments · Fixed by #65435
Assignees
Labels
[Block] Comment Pagination Next Affects the Comments Pagination Next Block [Block] Comments Pagination Previous Affects the Comments Pagination Previous Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@michalczaplinski
Copy link
Contributor

michalczaplinski commented Sep 17, 2024

Description

I encountered the following error while working on #64067 (the problem itself is unrelated to that PR).

( ! ) Warning: Undefined array key "paged" in /Users/czapla/Projects/gutenberg/build/block-library/blocks/comments-pagination-previous.php on line 33

This issue is likely related to the recent changes in this PR: #63698.

It appears that the paged property of the $comment_vars can be undefined because it's not always included in the output of build_comment_query_vars_from_block() :

https://github.com/WordPress/wordpress-develop/blob/4dafd584c91524f0cfd743f728d5f334df761e11/src/wp-includes/blocks.php#L2553-L2572

Step-by-step reproduction instructions

The issue appears on any post/page the contains the comments pagination previous/next block.

@michalczaplinski michalczaplinski added [Type] Bug An existing feature does not function as intended [Block] Comments Pagination Previous Affects the Comments Pagination Previous Block [Block] Comment Pagination Next Affects the Comments Pagination Next Block labels Sep 17, 2024
@michalczaplinski michalczaplinski changed the title Undefined array key "paged" in comments-pagination-previous.php on line 33 Undefined array key "paged" in comments-pagination-previous.php Sep 17, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Comment Pagination Next Affects the Comments Pagination Next Block [Block] Comments Pagination Previous Affects the Comments Pagination Previous Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants