silverstripe/sapphire — pull request #1310 by chillu (2013-03-20 00:21:54+00:00)
Title: NEW Enforce max node counts to avoid excessive resource usage

Rendering potentially 1000s of nodes can exceed the CPU and memory constraints
of a normal PHP process, as well as the rendering capabilities of browsers.
Set a hard maximum for the renderable nodes, deferring to a "show as list" action
in the main CMS tree. For TreeDropdownField, we don't have the list fallback option,
so ask the user to search for the node title instead.

Also makes both the "node_threshold_total" and "node_threshold_leaf" values configurable

Small tree view: http://monosnap.com/image/Qmk0prU3G6V34vcI2EqQ9uml1
Large tree view: http://monosnap.com/image/siymlxkhSzFv9aFkBCODfuH4o
Treedropdown view: http://monosnap.com/image/ixVFUzx5LlOAoFnbkrh6l39Ej

I'm aware that this change adds the umpteenth argument to getChildrenAsUL(), but at this point it doesn't really matter too much. The API needs a major overhaul (with some tree support in the ORM, and potentially JSON-based views). For now, the pull request doesn't weaken the API much more than it already is.