Permalink
Browse files

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
  • Loading branch information...
1 parent 48949ba commit 9e2c7b657221c336137e07985bd5994682216d65 Russell Michell committed Jan 27, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 forms/TreeDropdownField.php
@@ -279,7 +279,7 @@ public function tree(SS_HTTPRequest $request) {
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));
}

0 comments on commit 9e2c7b6

Please sign in to comment.