[wp-trac] [WordPress Trac] #7544: Multiple Category Handling Wrong

WordPress Trac wp-trac at lists.automattic.com
Tue Aug 19 05:21:08 GMT 2008


#7544: Multiple Category Handling Wrong
------------------------+---------------------------------------------------
 Reporter:  zackdesign  |       Owner:  anonymous                                          
     Type:  defect      |      Status:  new                                                
 Priority:  normal      |   Milestone:  2.6.2                                              
Component:  General     |     Version:  2.6.1                                              
 Severity:  major       |    Keywords:  category, query_posts, categories, multiple, select
------------------------+---------------------------------------------------
 To create this problem I was doing the following:

 1. I created a plugin
 2. This plugin has an action call to 'init'
 3. The init function runs and then based upon a POST variable runs the
 following code:

 query_posts(array('category__in' => array($sql)));

 4. I've checked and tested $sql variable to ensure that it's passing the
 correct values.
 5. Testing further, it would appear that the implementation of
 category__in is extremely haphazard. Sometimes it works, sometimes it
 doesn't. I'd like to request that this get fixed soon so that I don't have
 to resort to doing a custom query...!

 What I want is for the user to select a set of categories and only show
 posts that span every single one of those categories. At the moment it
 shows the correct output sometimes and then other times shows the post
 even if there is one category it hasn't been added to. I have a setup of
 parent and child categories, with child categories used for the testing
 across parents.

 e.g.

 parent 1

    sub 1
    sub 2

 parent 2

    sub2 1
    sub2 2

 I test across more than two parents and using categories like so: sub 1,
 sub2 2. I never choose multiple child categories under the one parent.

 Hopefully this describes my problem in enough detail! You can see it an
 action currently at http://skopelostopos.net/ (see the drop-downs under
 Properties).

 By the time you see it I may or may not have 1) fixed it using custom
 queries or 2) upgraded wordpress to the fix that I hope this ticket will
 engender...

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7544>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list