[wp-trac] [WordPress Trac] #11018: display_page_row loops forever
WordPress Trac
wp-trac at lists.automattic.com
Fri Oct 30 00:53:16 UTC 2009
#11018: display_page_row loops forever
--------------------------+-------------------------------------------------
Reporter: hailin | Owner: hailin
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.9
Component: Template | Version: 2.7
Severity: normal | Keywords: needs-patch
--------------------------+-------------------------------------------------
Comment(by hailin):
Thanks for the hints, Westi.
Here is a patch that fixes the root cause, and prevents the loop from
happening in the first place. The calling sequence for editing page parent
is:
edit_post() => wp_update_post() => wp_insert_post()
I think it's better to prevent and fix it earlier in the sequence, since
wp_insert_post are pretty low level function, which should be agnostic of
the logic from upper layer.
I've reproduced the loop issues involving one hop, two hops or three hops.
And verified that the patch handles every case successfully, and it
prevents the loop from happening in the first place.
As for the second part:
how to break the loop in case it still happens, I'm not convinced that
_get_post_ancestors is the best place to be, because _get_post_ancestors
is intended as a private function. Let me open another ticket for
breaking the loop since it's a different issue.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11018#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list