silverstripe/silverstripe-framework — pull request #2525 by chillu (2013-10-11 09:51:23+00:00)
Title: Load tree parent nodes if non-existant

This edge case can occur when a large tree is cached in HTML already,
without any nodes expanded via ajax. If a new node is added with
a parent that's not existant, it was simply placed on the root node.
This is a display bug, a full CMS refresh fixes it.

Fixes a related bug where tree causes (view) duplicates,
where the same node is rendered twice. This was due to the whole
subtree being refreshed (including the new node) through jstree's
built-in "open"/"select" events, while at the same time
creating a new node through updateNodesFromServer() callbacks.

Also added a global tree loading indication to make it clear
that the tree is still processing.

See https://github.com/silverstripe/silverstripe-cms/issues/872