Hi UC,
After the last update to SimpleTreeDropdownField, it no longer owrks, just producing an empty dropdown.
I tracked it down to the if() statement that was added inside the foreach:
//DOES NOT WORK
if($child->ClassName == $this->sourceClass) {
$text = $child->__get($this->labelField);
$options[$child->ID] = empty($text) ? "<em>$indent Untitled</em>" : $indent.$text;
}
//WORKS
$text = $child->__get($this->labelField);
$options[$child->ID] = empty($text) ? "<em>$indent Untitled</em>" : $indent.$text;
Not quite sure why you would want to be doing that, surely that would mean it only showed children that were the same class as the parent?
Aram
--------------------------------------------------------------
www.SSbits.com - SilverStripe Tutorials, Tips and other bits