[wp-trac] [WordPress Trac] #11575: Category search bug

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 24 23:35:31 UTC 2010


#11575: Category search bug
--------------------------+-------------------------------------------------
 Reporter:  arena         |       Owner:  dd32                    
     Type:  defect (bug)  |      Status:  accepted                
 Priority:  normal        |   Milestone:  3.0                     
Component:  Taxonomy      |     Version:  2.9                     
 Severity:  major         |    Keywords:  2nd-opinion dev-feedback
--------------------------+-------------------------------------------------

Comment(by arena):

 @dd32

 First, do you want this code to work for any taxonomy (with hierarchy or
 not) ?

 Current rule :
 in wp 2.9.1 in _cat_rows there is a comment :
 // If the page starts in a subtree, print the parents.

 Reminder :
 A sub category can have the same name with different parents (not the same
 slug !!)

 Your approach :
 Searching this sub category  would retrieve two rows without the ability
 to identifed them (unless i memorized the slug, who does!)

 Other points on 2.9.1 code :
 1) The search is performed correctly and retrieves the categories matching
 the search criterias. The point is that the recursive code is a mess, and
 parent and childs are not displayed properly (see OnTheFly014.jpg in that
 ticket).
 2) Not sure current code handles correctly a hierarchy of more than 20
 parents (current list limit), as all categories displayed are tallied
 (counted).

 My approach :
 a) based on the retrieved list of categories (with or without search =>
 get_categories function),
 b) the retrieved array is sliced (for pagination)
 c) all found categories have an attribute added : _found
 d) parent categories not in the sliced array are added.
 e) then the recursive process does its job.
 f) so the retrieved list can have more than 20 rows but that is necessary
 to allow full identification of the hierarchy.

 @ nacin

 Your proposal would only apply when searching categories ! not sure Jane
 would appreciate this !

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


More information about the wp-trac mailing list