Opened 5 years ago
Closed 5 years ago
#7697 closed defect (bug) (fixed)
Disallow page from being its own parent
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.7 |
| Component: | Administration | Version: | 2.7 |
| Severity: | normal | Keywords: | page parent |
| Cc: |
Description
I noticed this in the 2.7-hemorrhage branch that the dashboard page editor allows you to set the current page as its own parent. If this happens, many things break as PHP enters an infinite query loop. Two things should be done, not show it in the edit page. Additionally, when reading the parent_id, it should be checked to make sure it is not the same as the current page's ID this prevents the infinite loop from ever occurring from this condition. This was observed in r8822.
Change History (6)
comment:1
mtekk
— 5 years ago
- Summary changed from Disallow page being its own parent to Disallow page from being its own parent
comment:3
mtekk
— 5 years ago
- Version changed from 2.7 to 2.6
Ok for the page problem it looks like wp_dropdown_pages() is being called now instead of using parent_dropdown() and some surrounding code. If parent_dropdown is being depreciated, then wp_dropdown_pages() is going to need to be passed the excluded pages (which will have to be determined before calling it). It looks like even though it is supposed to be passed $post, $post ends up being NULL (so it does not even select the current parent page if there is one).
I'm opening a new ticket for a similar problem with categories as I found the problem exists in 2.6.1.
Looks like categories have this same problem in r8841. I'm going to make some patches for this.