[wp-trac] [WordPress Trac] #23931: wp_insert_comment should require comment_post_ID

WordPress Trac noreply at wordpress.org
Wed Aug 28 21:47:05 UTC 2013


#23931: wp_insert_comment should require comment_post_ID
--------------------------+------------------------------
 Reporter:  markoheijnen  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Comments      |     Version:  2.0
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by jdgrimes):

 Something does need to happen here. At the very least, the tests should
 set `comment_post_ID` to `0` by default. That will keep it from erroring.
 If we're going to force `comment_post_ID` to be valid though, we should
 make `WP_UnitTest_Factory_For_Comment` automatically create a post if
 `comment_post_ID` isn't set. I think that makes more sense then having to
 create one each time like in
 [http://core.trac.wordpress.org/attachment/ticket/23931/tests-comment-
 query.2.php#L15 your patch].

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


More information about the wp-trac mailing list