Opened 9 years ago
Closed 9 years ago
#35519 closed defect (bug) (fixed)
Dashboard At a Glance: comment counter isn't updated if to approve comment
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | minor | Version: | 4.1 |
Component: | Comments | Keywords: | has-screenshots has-patch commit |
Focuses: | ui | Cc: |
Description
STEPS TO REPRODUCE:
Log in as administrator, create new post, log out,
log in as subscriber user, create new comment for created post, log out,
log in as administrator, approve subscriber's comment on Dashboard page in "Activity" group box using hidden menu item "Approve".
EXPECTED RESULT: subscriber's comment became approved, link "View", total comments counter is updated.
ACTUAL RESULT: subscriber's comment became approved, there is no total comments counter (see attachment).
Attachments (3)
Change History (13)
#2
in reply to:
↑ 1
@
9 years ago
Replying to antonrinas:
Tried to reproduce the error. System worked as expected, no problems. Do you have any plugins activated? If so, can you retry with a clean installation?
#3
@
9 years ago
- Focuses ui added
- Keywords has-patch has-screenshots added
This happens only when there are 0 approved comments. The comment counts in wp_dashboard_right_now()
should probably be displayed also in the rare, initial, condition when there are 0 approved comments and only pending comments.
Fixing this initial condition, then the AJAX count update works fine, as far as I see.
#4
follow-up:
↓ 8
@
9 years ago
- Keywords needs-refresh added
- Milestone changed from Awaiting Review to Future Release
- Version changed from 4.4.1 to 4.1
@afercia Looks like your approach in 35519.patch goes against [29785], so the "fix" here would have to be done with JS.
See #26738
#5
@
9 years ago
@rachelbaker if I remember correctly, the displayed number will be always the one of approved comments. We just need to print out the element to update via JS even when there are "0" comments approved.
#7
@
9 years ago
- Keywords needs-refresh removed
@afercia It looks to me as though we should just remove the conditional check if ( $num_comm && $num_comm->approved )
, see 35519.2.patch. Any reason you would prefer your approach?
#8
in reply to:
↑ 4
@
9 years ago
BTW: I was incorrect here:
@afercia Looks like your approach in 35519.patch goes against [29785], so the "fix" here would have to be done with JS.
See #26738
because you were only adding to the conditional, you didn't change the displayed property. Sorry about that.
#9
@
9 years ago
- Keywords commit added
After a Slack discussion with @afercia and sleeping on it, I believe 35519.patch is the better approach because it provides sanity checks for the filterable result of wp_count_comments()
.
Dashboard screenshot