Make WordPress Core

Opened 15 years ago

Closed 14 years ago

#11047 closed defect (bug) (fixed)

admin edit pages could loop

Reported by: hailin's profile hailin Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 2.7
Component: General Keywords: needs-refresh 2nd-opinion
Focuses: Cc:

Description

This is to continue #11018.

Display_page_row() in wp-admin/includes/template.php could loop forever, causing wp-admin/edit-pages.php not able to load at all.

We should break the loop and fix the pages dynamically when this happens.

Attachments (1)

11047_break_loop.diff (1.7 KB) - added by hailin 15 years ago.
correct patch

Download all attachments as: .zip

Change History (9)

#1 @hailin
15 years ago

westi suggested breaking the loop in _get_post_ancestors.

This patch breaks the loop right in display_page_row, and we've been running this patch on a live site for a week now and verified that it's working correctly.

#2 @hailin
15 years ago

_get_post_ancestors as we have the same bug there and then we can call that and use count() to get the depth we are at.

When there is a loop, we probably can not use count since it will return infinity.
We need to break out somehow, and return a dummy value such as 9999. Not sure it's going to be pretty.

@hailin
15 years ago

correct patch

#3 @hailin
15 years ago

Attached the right patch.

_get_post_ancestors has the following comment:
The post parent will be an ancestor and the parent of the post

  • parent will be an ancestor. There will only be two ancestors at the most.

Based on the above comment, _get_post_ancestors doesn't have loop issue, and it appears that it was designed to have only two ancestors.

Therefore, the correct way to break pages loop is in display_page_row.

#4 @ryan
15 years ago

  • Milestone changed from 2.9 to 3.0

#5 @hakre
15 years ago

Related: #10277

#6 @ocean90
15 years ago

  • Keywords needs-refresh 2nd-opinion added

Related to #12443?

#7 @ryan
15 years ago

  • Milestone changed from 3.0 to 3.1

#8 @nacin
14 years ago

  • Milestone changed from Awaiting Triage to 3.1
  • Resolution set to fixed
  • Status changed from new to closed

Handled in [15758].

Note: See TracTickets for help on using tickets.