Merge pull request #2800 from phptek/issue/2795

BUG Ensure TreeMultiSelectField doesn't populate menus with "unchanged".
This commit is contained in:
Simon Welsh 2014-03-15 21:27:33 +13:00
commit 3b330a065b

View File

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