Skip to content

Query Pagination Previous block appears incorrectly when navigating to page outside of the query's range. #67748

@michalczaplinski

Description

@michalczaplinski

Description

This is a standard Query Loop block in the TT5 theme. We still show the Query Pagination Previous block whenever a user navigates to a page outside the query's range. However, as there are no results, the block does not make much sense to be shown.

Step-by-step reproduction instructions

  1. Add a Query Loop block to a page or post.
  2. Make sure that the Post Template block of the Query Loop includes a Pagination Previous block.
  3. Save your post/page.
  4. Open your post/page on the frontend.
  5. Navigate to a page that is outside of the range of the query. e.g.: http://example.com&query-5-page=99999999
  6. Note that the Previous button is visible and it works but it does not make sense to show it in this context.

Screenshots, screen recording, code snippet

Screen.Recording.2024-12-05.at.13.47.07.mov

Environment info

  • 6.8-alpha-59477
  • TT5 theme
  • Chrome
  • Gutenberg trunk

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] Query LoopAffects the Query Loop Block[Block] Query PaginationAffects the Query Pagination Block - used for pagination within the Query Loop Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions