-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix: pattern rendering issue #66022
Fix: pattern rendering issue #66022
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed the bug occurs regardless of view type (grid, table). So long as you paginate from all patterns and then switch to the templates view, it'll be empty.
This PR fixes all that. Thank you very much, @dhruvang21!
Before
2024-10-11.13.53.14.mp4
After
2024-10-11.13.53.36.mp4
I updated the variable name to camelCase and marked this PR to auto-merge. Great work @dhruvang21 ! |
When navigating between the "All Patterns" tab (specifically on page 2) and the "Template Parts" tab, the patterns fail to load correctly, and a "No Results" message is displayed. This commit checks for a previous post type, and, if different, resets the pagination to page 1 to ensure the first page of new post types are shown. --------- Co-authored-by: dhruvang21 <dhruvang21@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
I just cherry-picked this PR to the wp/6.7 branch to get it included in the next release: 6b5994a |
When navigating between the "All Patterns" tab (specifically on page 2) and the "Template Parts" tab, the patterns fail to load correctly, and a "No Results" message is displayed. This commit checks for a previous post type, and, if different, resets the pagination to page 1 to ensure the first page of new post types are shown. --------- Co-authored-by: dhruvang21 <dhruvang21@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
When navigating between the "All Patterns" tab (specifically on page 2) and the "Template Parts" tab, the patterns fail to load correctly, and a "No Results" message is displayed. This commit checks for a previous post type, and, if different, resets the pagination to page 1 to ensure the first page of new post types are shown. --------- Co-authored-by: dhruvang21 <dhruvang21@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
What?
part of #66009
Why?
Fixes:- #66009
How?
I’ve tracked down the issue and identified that it occurs because the page is not reset to page 1 when switching tabs. This happens due to the condition failure in the file index.js#L124. When switching tabs between wp_block post type and wp_template_part, neither has a category, so the categoryId defaults to PATTERN_DEFAULT_CATEGORY. As a result, both the previous and current categories are the same, causing the condition to fail. I have added a condition using the same logic for the post type, which resolves the issue
Testing Instructions
Screenshots or screencast
fix-66009.mp4