MINOR Add caching to the TreeDropdownField tree action

This commit is contained in:
Maxime Rainville 2018-09-26 17:24:06 +12:00
parent 5b7a84141b
commit 77339b7e75

View File

@ -453,6 +453,8 @@ class TreeDropdownField extends FormField
/** @var DataObject|Hierarchy $obj */
$obj = null;
$sourceObject = $this->getSourceObject();
Hierarchy::prepopulate_numchildren_cache($sourceObject);
if ($id && !$request->requestVar('forceFullTree')) {
$obj = DataObject::get_by_id($sourceObject, $id);
$isSubTree = true;