[wp-trac] [WordPress Trac] #5581: some diff which needs to be incorporated into wporg

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 4 19:13:34 GMT 2008


#5581: some diff which needs to be incorporated into wporg
---------------------+------------------------------------------------------
 Reporter:  hailin   |       Owner:  anonymous
     Type:  defect   |      Status:  new      
 Priority:  normal   |   Milestone:  2.5      
Component:  General  |     Version:           
 Severity:  normal   |    Keywords:           
---------------------+------------------------------------------------------
 I discovered this inconsistency, partly due to merge, between wporg and
 wpcom, and believe they should be incorporated into wporg.

 In function display_element in Walk class.
    i should be set to –1 in after the recursive call returns.

 Consider the following example:
 E1
 - e2
 - - e3
 - - - e4

 And suppose children has order: e3, e2, e4 in the children array.

 First we call display_element(E1), it will traverse children array, and
 find e2 as E1’s child; and the resulting array becomes e3, e4.

 On the next recursive call, we are trying to find the child of e2 from the
 remaining children array.

 Yet, with i--, it will start with e4, missing e3.

 So this is a tricky case that is a little hard to imagine.
 However, we already saw this happening with very complicated page
 hierarchy in wpcom.

 Therefore, we have to reset index i to –1 so that on next call, it begins
 with index 0.


 The catch and repair bad page diff is self-explanatory.

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


More information about the wp-trac mailing list