BUG Ensure TreeMultiSelectField doesn't populate menus with "unchanged".

TreeMultiSelectField's default for its value property is 'unchanged'
which causes menus to not load and generates console errors. Fixes #2795
This commit is contained in:
Russell Michell 2014-01-27 14:02:43 +13:00
parent 48949ba89a
commit 9e2c7b6572

View File

@ -279,7 +279,7 @@ class TreeDropdownField extends FormField {
if( isset($_REQUEST['forceValue']) || $this->value ) {
$forceValue = ( isset($_REQUEST['forceValue']) ? $_REQUEST['forceValue'] : $this->value);
if(($values = preg_split('/,\s*/', $forceValue)) && count($values)) foreach($values as $value) {
if(!$value) continue;
if(!$value || $value == 'unchanged') continue;
$obj->markToExpose($this->objectForKey($value));
}