ryancramerdesign/ProcessWire — pull request #258 by KeeneState (2013-10-10 20:15:38+00:00)
Title: Circular reference mitigation

Hi Ryan, we ran into a series of out of memory errors during page saves after a page was mistakenly self-referenced, e.g. $page->FieldtypePage[Select] = $page. This took care of it, though I'm not certain it's the best place to prevent it.

---

Adding self check to prevent circular reference on page save leading to OOM. This will occur in cases where a Page contains a Page select input, with $this selected. While likely a mistake or the result of poor template design, it will white-screen any page save containing the field as it attempts to uncache. If such a reference should instead be illegal, throwing an error at this point could be the way to go?