[wp-trac] Re: [WordPress Trac] #9200: comment widget links draft articles

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 22 01:33:36 GMT 2009


#9200: comment widget links draft articles
--------------------------+-------------------------------------------------
 Reporter:  hakre         |        Owner:  anonymous
     Type:  defect (bug)  |       Status:  reopened 
 Priority:  normal        |    Milestone:           
Component:  General       |      Version:  2.7      
 Severity:  normal        |   Resolution:           
 Keywords:                |  
--------------------------+-------------------------------------------------

Comment(by hakre):

 Just took a look in the source: Nothing is checked in the widgets, it's
 aboslutely independent from the posts table, it's onyl about comments.

 information about posts is looked up only afterwards while iterating over
 the results from the comments database queries.

 what is needed is a join on the posts table to gain the posts status for
 the post the comment is related to.

 luckily comment_post_ID and post_status are indexed so that using a join
 in this query should do the job without any further notice. only a check
 for post_status: 'draft' has to be added.

 next to patching the database query a fix for the user would be to set the
 comments not being approved (comment_approved: '0'). this could be done
 just in case in the article editor while saving a draft.

 the last might be a nicer fix then changing the query in the widget.

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


More information about the wp-trac mailing list