-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Fix: Correct 'Displaying 1 – 0 of 0' issue when no results are found #69666
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: Correct 'Displaying 1 – 0 of 0' issue when no results are found #69666
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Manhatthien-98. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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.
Thanks for the PR!
Personally, I think we should ship this PR and backport it to 6.8. This PR just fixes the incorrect numbers.
Whether or not to show this block when there are no search results is another discussion that we can consider in a follow-up.
Let's hear from others: @sarthaknagoshe2002 @fabiankaegy @carolinan
@Sourav61 Could you rebase this PR? It should fix the unit test failure. |
I feel we should think about this too before shipping this PR |
The Query Result block is just a wrapper block and doesn't contain any text by default, right? |
Hey @t-hamano This is my first time rebasing a PR, I have rebased but there are some other changes as well along with the intended changes, please let me know if this is expected? Thanks 🙇 |
@Sourav61 The current PR seems to contain unintended changes. Could you try the following steps?
|
Use Yoda conditions in query block logic for consistency and safety
6188e26
to
391b96a
Compare
This might be an ideal approach, but we can't add enhancements during Beta/RC phase. Therefore, we need to focus only on the bug fix in this PR. |
This would be a temporary fix for this issue which would create another issue. In this case I would recommend that we wait and maybe resolve this bug, make the required enhancements and then ship it. What say? |
I agree with this, but we need to consider whether we should accept the current behavior in WP 6.8. |
@sarthaknagoshe2002, do you mind creating a new issue for your proposal? I agree with @t-hamano; the best we can do in RC/beta cycles is fix the potential issues. |
I understand that, but wouldn’t this create redundant and confusing behavior for users, as mentioned [here] By solving one issue, we might introduce another. Can we find a middle ground that addresses both concerns? |
This PR is just trying to fix the wrong numbers. That is, it just changes from No other behavior is changed. |
…69666) Unlinked contributors: Manhatthien-98. Co-authored-by: Sourav61 <sourav08@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: sarthaknagoshe2002 <sarthaknagoshe2002@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: carolinan <poena@git.wordpress.org>
I just cherry-picked this PR to the wp/6.8 branch to get it included in the next release: e277d50 |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
…ordPress#69666) Unlinked contributors: Manhatthien-98. Co-authored-by: Sourav61 <sourav08@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: sarthaknagoshe2002 <sarthaknagoshe2002@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: carolinan <poena@git.wordpress.org>
What?
Closes #69662
Fixes the incorrect display of "Displaying 1 – 0 of 0" when no results are found by correctly setting the start value to 0.
Why?
When no posts are found, the display incorrectly shows "Displaying 1 – 0 of 0". This change ensures that it correctly shows "Displaying 0 – 0 of 0", providing a more accurate representation of empty results.
How?
Testing Instructions
Screenshots or screencast