silverstripe/sapphire — pull request #1289 by chillu (2013-03-14 17:07:45+00:00)
Title: FIX Respect tree node limits, fix search result node display

The $minNodeCount attribute wasn't properly respected
during actual querying, so SilverStripe would always traverse
the entire tree (and load all objects into memory),
before then marking nodes as "unexpanded", which prevents
them from actually being rendered.

Fixes nodes on search results to be expanded by default, and nodes on search results to correctly ajax-expand.

I'm sending a PR for 3.0, since I think this is an important performance regression fix.
I've benchmarked on a standard install with 2000 sample pages created through `FTPageMakerTask` in the `frameworktest` module. The `admin/pages/treeview` URL went from 1.6s to 1.1s.