#27329 closed defect (bug) (fixed)
js errors while moderating comments
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | Comments | Keywords: | has-patch commit |
Focuses: | javascript, administration | Cc: |
Description
When trashing or marking as spam in edit-comments.php:
[Error] Error: Syntax error, unrecognized expression: [object Object] error (jquery.js, line 2) ob (jquery.js, line 2) xb (jquery.js, line 2) db (jquery.js, line 2) find (jquery.js, line 2) init (jquery.js, line 2) init (jquery-migrate.js, line 225) n (jquery.js, line 2) add (wp-lists.js, line 312) ajaxAdd (wp-lists.js, line 83) (anonymous function) (wp-lists.js, line 455) delAfter (edit-comments.js, line 240) (anonymous function) (wp-lists.js, line 209) dequeue (jquery.js, line 3) (anonymous function) (jquery.js, line 3) each (jquery.js, line 2) each (jquery.js, line 2) queue (jquery.js, line 3) complete (wp-lists.js, line 207) j (jquery.js, line 2) fireWith (jquery.js, line 2) x (jquery.js, line 4) b (jquery.js, line 4)
Visual behaviour: the undo message has two avatars.
When trashing, (un)approving or marking as spam in index.php:
[Error] TypeError: 'undefined' is not an object (evaluating 'el.html().replace') getCount (edit-comments.js, line 127) dashboardTotals (edit-comments.js, line 118) delAfter (edit-comments.js, line 210) (anonymous function) (wp-lists.js, line 209) dequeue (jquery.js, line 3) (anonymous function) (jquery.js, line 3) each (jquery.js, line 2) each (jquery.js, line 2) dequeue (jquery.js, line 3) complete (wp-lists.js, line 210) j (jquery.js, line 2) fireWith (jquery.js, line 2) x (jquery.js, line 4) b (jquery.js, line 4)
Visual behaviour: comment disappears after trashing, but doesn't reappear after undoing it.
Tested in trunk and 3.8.1.
Attachments (6)
Change History (25)
#1
@
11 years ago
It appears that the last error has to do with the fact that there's no span with a total-count class anywhere.
Line 116 of edit-comments.js: total = $('span.total-count', dash);
.
#2
@
11 years ago
- Milestone changed from Awaiting Review to 3.9
Confirmed both issues. <span class="total-count">
was removed in [26144].
#3
@
11 years ago
So, the dashboardTotals()
function is broken since [26144].
I'd suggest removing it completely, as it can show "1 Comments" or "2 Comment", and we can't properly localize this (as previously noted in #18809). We still have live-updating counts at the bottom of the Activity meta box, and they work fine.
27329.patch fixes the dashboard issue for me.
The Edit Comments screen issue appears to be caused by wpList.add()
in lines 239 and 282:
tags/3.8.1/src/wp-admin/js/edit-comments.js#L239
#4
@
11 years ago
- Keywords has-patch commit added
The Edit Comments screen issue was introduced in [25546].
We're calling $.trim( e )
without first verifying that e
is a string (it can also be a jQuery object).
27329.2.patch fixes both issues for me.
#5
@
11 years ago
- Milestone changed from 3.9 to 3.8.2
- Version changed from 3.8.1 to 3.8
It's a regression, moving to 3.8.2.
#6
follow-up:
↓ 8
@
11 years ago
The errors are gone with Sergey's patch, however, undoing marking a comment as spam on the dashboard still doesn't make the comment reappear. In edit comments, I still get the double avatars when trashing a comment.
#8
in reply to:
↑ 6
@
11 years ago
- Keywords commit removed
Replying to avryl:
The errors are gone with Sergey's patch, however, undoing marking a comment as spam on the dashboard still doesn't make the comment reappear. In edit comments, I still get the double avatars when trashing a comment.
Hmm, undoing marking a comment as spam on dashboard always makes the comment reappear for me with the patch. I can reproduce the double avatars issue though.
#10
@
11 years ago
$('.avatar', el)
gives you two elements, not sure why, but using first()
solves the problem.
#11
@
11 years ago
- Keywords commit added
The double avatars issue was introduced in [26961], where we added hidden comment author info, only visible at narrow screen sizes.
#13
@
11 years ago
No worries :) I was contemplating between adjusting the selector and using first()
. The latter seems more future-proof.
#14
@
11 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
In 27759:
#15
@
11 years ago
- Keywords fixed-major added
- Resolution fixed deleted
- Status changed from closed to reopened
Double avatars.