Ticket #2552 (closed defect: duplicate)

Opened 3 years ago

Last modified 1 year ago

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

Reported by: mdawaffe Assigned to: mdawaffe
Priority: normal Milestone:
Component: Administration Version: 2.0.1
Severity: normal Keywords: AJAX list-management bg|has-patch bg|2nd-opinion bg|commit
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

2552.diff (6.5 kB) - added by mdawaffe on 03/10/06 07:42:07.
list-management for edit.php and href bug fix
2552-debug.diff (6.8 kB) - added by mdawaffe on 03/11/06 21:57:32.
ghetto debugging

Change History

03/10/06 07:42:07 changed by mdawaffe

  • attachment 2552.diff added.

list-management for edit.php and href bug fix

03/10/06 07:49:20 changed by westi

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

03/10/06 17:19:44 changed by davidhouse

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.

03/10/06 17:24:16 changed by davidhouse

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

03/10/06 18:56:34 changed by mdawaffe

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?

03/10/06 20:29:39 changed by ringmaster

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.

03/10/06 20:30:06 changed by ringmaster

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

03/10/06 21:49:08 changed by davidhouse

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.

03/10/06 23:07:10 changed by mdawaffe

  • 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.

03/11/06 00:13:22 changed by mdawaffe

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.

03/11/06 21:26:14 changed by davidhouse

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?

03/11/06 21:27:38 changed by davidhouse

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]

03/11/06 21:48:54 changed by davidhouse

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]

03/11/06 21:57:32 changed by mdawaffe

  • attachment 2552-debug.diff added.

ghetto debugging

03/11/06 22:21:49 changed by davidhouse

  • keywords changed from AJAX list-management bg|has-patch bg|2nd-opinion to AJAX list-management bg|has-patch bg|2nd-opinion bg|commit.

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

03/13/06 01:58:35 changed by mdawaffe

  • status changed from assigned to closed.
  • resolution set to duplicate.

I will encorporate this patch into #2561.

06/20/07 13:42:08 changed by Nazgul

  • milestone deleted.