[wp-trac] [WordPress Trac] #14452: Duplicate check for comments: Inappropriate errorhandling for xmlrpc

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 6 09:09:59 UTC 2011


#14452: Duplicate check for comments: Inappropriate errorhandling for xmlrpc
--------------------------------------+-----------------------------
 Reporter:  mrutz                     |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Future Release
Component:  XML-RPC                   |     Version:  3.0
 Severity:  normal                    |  Resolution:
 Keywords:  needs-patch dev-feedback  |
--------------------------------------+-----------------------------
Changes (by solarissmoke):

 * keywords:  needs-patch => needs-patch dev-feedback


Comment:

 > Looking at the code I see that there is already the action
 'comment_duplicate_trigger'. I don't know exactly, but I would assume that
 the XMLRPC code should attach to this and handle the duplicate
 appropriate.

 I might be missing something obvious, but I don't think this is possible.
 IXR_Server calls the `wp_newComment()` function when that method is
 invoked. Now, the only way to get a proper error message sent back to the
 client is to have `wp_newComment` return an `IXR_Error` object. Hooking
 into `comment_duplicate_trigger` doesn't help because it's an action and
 not a filter. So you can't use it to tell `wp_newComment()` what to
 return.

 It seems to me that we need something like `DOING_AJAX` to get this to
 work. Or just replicate the check separately in the XML-RPC class (and
 APP, etc).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14452#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list