mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUG Changes being detected on TreeMulti as values not sorted
This commit is contained in:
parent
270aba4007
commit
db63f55fbb
@ -103,7 +103,12 @@ class TreeMultiselectField extends TreeDropdownField
|
||||
|
||||
// cannot rely on $this->value as this could be a many-many relationship
|
||||
$value = array_column($values, 'id');
|
||||
$data['value'] = ($value) ? $value : 'unchanged';
|
||||
if ($value) {
|
||||
sort($value);
|
||||
$data['value'] = $value;
|
||||
} else {
|
||||
$data['value'] = 'unchanged';
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
@ -182,6 +187,7 @@ class TreeMultiselectField extends TreeDropdownField
|
||||
}
|
||||
|
||||
$title = implode(", ", $titleArray);
|
||||
sort($idArray);
|
||||
$value = implode(",", $idArray);
|
||||
} else {
|
||||
$title = $emptyTitle;
|
||||
|
Loading…
x
Reference in New Issue
Block a user