From 77339b7e75b967af425347d555a7b1a32988bc37 Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Wed, 26 Sep 2018 17:24:06 +1200 Subject: [PATCH] MINOR Add caching to the TreeDropdownField tree action --- src/Forms/TreeDropdownField.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Forms/TreeDropdownField.php b/src/Forms/TreeDropdownField.php index f96379c75..97df4b679 100644 --- a/src/Forms/TreeDropdownField.php +++ b/src/Forms/TreeDropdownField.php @@ -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;