#5581 closed defect (bug) (fixed)
some diff (index in display_element, and bad page handling) needs to be incorporated into wporg
Reported by: | hailin | Owned by: | |
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
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.
Attachments (1)
Change History (5)
#2
@
17 years ago
- Summary changed from some diff which needs to be incorporated into wporg to some diff (index in display_element, and bad page handling) needs to be incorporated into wporg
patch