WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#2552 closed defect (bug) (duplicate)

AJAX list manipulation of post's comments in wp-admin/edit.php

Reported by: mdawaffe Owned by: mdawaffe
Milestone: Priority: normal
Severity: normal Version: 2.0.1
Component: Administration Keywords: AJAX list-management bg|has-patch bg|2nd-opinion bg|commit
Focuses: Cc:

Description

Viewing a post's comments in wp-admin/edit.php allows the user to manage only those comments for a particular post. However, list-management.* don't handle this situation. This means that every time a comment is deleted or unapproved, the page has to reload.

Additionally, the approve/unapprove links point to post.php instead of comments.php.

The attached puts this portion of edit.php under list-management and fixes the above bug.

Attachments (2)

2552.diff (6.5 KB) - added by mdawaffe 8 years ago.
list-management for edit.php and href bug fix
2552-debug.diff (6.8 KB) - added by mdawaffe 8 years ago.
ghetto debugging

Download all attachments as: .zip

Change History (17)

mdawaffe8 years ago

list-management for edit.php and href bug fix

comment:1 westi8 years ago

This looks like a good idea.

Would be nice if it was done for Mass-Edit Mode at the same time as per this trac ticket #1810

comment:2 davidhouse8 years ago

Confirm bug. Confirm patch fixes AJAX problem.

However, the 'unapprove' links still don't work: they put the 'Processing data' message up, but it gets stuck there and the comment isn't unapproved.

comment:3 davidhouse8 years ago

Westi, it would also be nice if you produced code for the tickets you've accepted ;)

comment:4 mdawaffe8 years ago

davidhouse, what browser, OS? Do you see both Approve and Unapprove links for the same comment (bad) or just one for each (good, as long as it's the correct one :))?

Any chance you have a JS debugger running and can tell me if you get an error message?

comment:5 ringmaster8 years ago

I was having the same problem and found that the list-manipulation.js file gets stuck in cache. Force a reload and things work right.

However... Is WP supposed to re-send email notification when you unapprove and reapprove a comment? Not a big deal (or even related, I guess), just curious.

comment:6 ringmaster8 years ago

I should have specifically mentioned "All working for me".

comment:7 davidhouse8 years ago

Firefox 1.0.7, Ubuntu Linux.

Nope. Still not working after Ctrl+F5'ing and manually clearing the cache through Edit -> Preferences. Same effect as above.

comment:8 mdawaffe8 years ago

  • Status changed from new to assigned

In FF, open up Tool->JavaScript Console, hit clear, and then try testing the behavior again. The console might spit out some sort of error message.

Also, do you see both "Unapproave" AND "Approve" for each comment, or just one or the other.

comment:9 mdawaffe8 years ago

I've tested this in the following environments and everything works as intended.

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060124 Firefox/1.5.0.1: CentOS release 3.6 (Final)

Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7: Mac OS X 10.3.9 (7W98)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7: WinXP Pro

Safari 1.3.1 (v312.3.1): Mac OS X 10.3.9 (7W98)

IE 6.0.2900.2180.xpsp_sp2_gdr.050301-159: Win XP Pro

I do not have access to a box with Opera on it at the moment. I assume it also works on more recent versions of FF and Safari.

I'm not sure what could be wrong, davidhouse. Do you have any admin skinning plugins enabled, perhaps? I had to change the markup of edit.php a little bit.

comment:10 davidhouse8 years ago

Firefox 1.07, Ubuntu linux.

I only see 'Unapprove' for approved comments and 'Approved' for unapproved comments. No admin skinning plugins applied. Error given in JS console:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS) [nsIXPCComponents.lookupMethod]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: chrome://global/content/XPCNativeWrapper.js :: anonymous :: line 91"  data: no]

I'm thinking this is a firefox bug. Anyone replicate?

comment:11 davidhouse8 years ago

Eww, I shouldn't have used code markup for that. Let's try again.

Error: uncaught exception: [Exception... "Component returned failure code: 0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS) [nsIXPCComponents.lookupMethod]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: chrome://global/content/XPCNativeWrapper.js :: anonymous :: line 91" data: no]

comment:12 davidhouse8 years ago

Eww, I shouldn't have used code markup for that. Let's try again.

Error: uncaught exception: [Exception... "Component returned failure code: 0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS) [nsIXPCComponents.lookupMethod]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: chrome://global/content/XPCNativeWrapper.js :: anonymous :: line 91" data: no]

mdawaffe8 years ago

ghetto debugging

comment:13 davidhouse8 years ago

  • Keywords bg|commit added

Works after a svn up. Sorry. Thought I was up to date.

comment:14 mdawaffe8 years ago

  • Resolution set to duplicate
  • Status changed from assigned to closed

I will encorporate this patch into #2561.

comment:15 Nazgul7 years ago

  • Milestone 2.1 deleted
Note: See TracTickets for help on using tickets.