[wp-trac] Re: [WordPress Trac] #8731: Taxonomies set $post_status_join = true seems unnecessarily

WordPress Trac wp-trac at lists.automattic.com
Mon May 25 05:11:17 GMT 2009


#8731: Taxonomies set $post_status_join = true seems unnecessarily
--------------------------+-------------------------------------------------
 Reporter:  bkrausz       |        Owner:  ryan    
     Type:  defect (bug)  |       Status:  reopened
 Priority:  normal        |    Milestone:  2.8     
Component:  Taxonomy      |      Version:  2.7     
 Severity:  major         |   Resolution:          
 Keywords:  has-patch     |  
--------------------------+-------------------------------------------------

Comment(by gortsleigh):

 I have had time again to test this using the 'test-taxonomies.php'
 attachment above, and it is still broken.

 I have verified a simple reproducible set of steps to show the error.
 These steps are not showing the generated wp_rules or the query, simply
 the results you see in the browser.


 To reproduce:

  1. Install WP trunk from SVN (2.8-bleeding)
  2. Copy test-taxonomies.php to plugins; activate the plugin
  3. Set permalinks to 'Day and name'
  4. Add a post: Title 'My first thing'; Assign it a 'Things' term of
 'first'; publish
  5. Add a post: Title 'My second thing'; Assign it a 'Things' term of
 'second'; publish
  6. Visit the site URL '/thing/second/' .. result: 404
  7. In wp-includes/query.php ca. line 1961, change to read:
 '$post_status_join = false'
  8. re-visit URL '/thing/second/'  .. result: the post 'My second thing'
 is displayed.

 I get the same results whether the post has attachments or not.  The
 fault, as before, lies in the join
 {{{
 JOIN ON (wp_posts.post_parent = p2.ID)
 }}}

 Is it possible that the join is only correct when post_type ==
 'attachment' ?? If so, $post_status_join should only be set to true when
 $where is set to select that type, eg near line 324 of query.php

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


More information about the wp-trac mailing list