#56186 closed defect (bug) (invalid)
get_page_of_comment doesn't work on descending order for comments
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.1 |
Component: | Comments | Keywords: | has-patch |
Focuses: | Cc: |
Description
In the code of the function the date_query's argument is always before. As a result it always returns the page number based on ascending order, but it should be conditional to the option comment_order. Obviously using after for descending order will fix this.
Change History (9)
This ticket was mentioned in PR #2959 on WordPress/wordpress-develop by christinavoudouris.
3 years ago
#1
- Keywords has-patch added
#2
follow-up:
↓ 3
@
3 years ago
Hey, so I thought this would be a quick fix but many checks pertaining to unit tests were not successful. I don't really have experience writing tests unfortunately...and am open to other suggestions.
#3
in reply to:
↑ 2
;
follow-up:
↓ 4
@
3 years ago
Replying to christinavoudouris:
Hey, so I thought this would be a quick fix but many checks pertaining to unit tests were not successful. I don't really have experience writing tests unfortunately...and am open to other suggestions.
Hi @christinavoudouris
I saw your commit, you just changed before to after. But it had to be conditional.
#4
in reply to:
↑ 3
@
3 years ago
Thanks for checking in. I'm a new contributor looking to help how I can, and am not too familiar with the codebase. I did consider your entire post, but I'm not sure how to do what you're describing. I do know programming fundamentals, though.
If you can write out the code you want, and where, I can work with you to add another commit to this PR.
Replying to ali11007:
Replying to christinavoudouris:
Hey, so I thought this would be a quick fix but many checks pertaining to unit tests were not successful. I don't really have experience writing tests unfortunately...and am open to other suggestions.
Hi @christinavoudouris
I saw your commit, you just changed before to after. But it had to be conditional.
This ticket was mentioned in PR #2993 on WordPress/wordpress-develop by ali11007.
3 years ago
#5
As the creator of Trac ticket, I found this bug and the solution is to change the hardcoded time_key before to dynamic value based on the option comment_order
Trac ticket: https://core.trac.wordpress.org/ticket/56186
christinavoudouris commented on PR #2959:
3 years ago
#7
The trac ticket was closed, so I'm closing this PR and will let the owner or someone else handle the problem. I needed more info and a solution was not given.
#8
@
3 years ago
@ali11007 Did you intend to close this ticket? I am trying to figure out if the bug still exists?
#9
@
3 years ago
- Milestone Awaiting Review deleted
Ali reached out via Slack. Given #39280 and #31101 it seems that the comment pagination is working as expected, even if it is a little counter intuitive.
In order for get_comment_link()
to return permanent, consistent values that page numbers need to be the same regardless of how the display is ordered: oldest first or newest first.
Trac ticket: #56186