diff --git a/forms/TreeDropdownField.php b/forms/TreeDropdownField.php index ef5583c93..441b7e537 100644 --- a/forms/TreeDropdownField.php +++ b/forms/TreeDropdownField.php @@ -203,12 +203,11 @@ class TreeDropdownField extends FormField { $isSubTree = false; $this->search = Convert::Raw2SQL($request->requestVar('search')); - $ID = (is_numeric($request->latestparam('ID'))) ? (int)$request->latestparam('ID') : (int)$request->requestVar('ID'); - if($ID) { + $forceFullTree = $request->requestVar('forceFullTree')?$request->requestVar('forceFullTree'):false; + if($ID && !$forceFullTree) { $obj = DataObject::get_by_id($this->sourceObject, $ID); $isSubTree = true; - if(!$obj) { throw new Exception ( "TreeDropdownField->tree(): the object #$ID of type $this->sourceObject could not be found" @@ -240,7 +239,6 @@ class TreeDropdownField extends FormField { $obj->markToExpose($this->objectForKey($value)); } } - $eval = '"
  • getName() . '-{$child->' . $this->keyField . '}\" data-id=\"$child->' . $this->keyField . '\" class=\"class-$child->class"' . ' . $child->markingClasses() . "\">ID\">" . $child->' . $this->labelField . ' . ""';