mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-07-01 08:59:42 +02: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
|
// cannot rely on $this->value as this could be a many-many relationship
|
||||||
$value = array_column($values, 'id');
|
$value = array_column($values, 'id');
|
||||||
$data['value'] = ($value) ? $value : 'unchanged';
|
if ($value) {
|
||||||
|
sort($value);
|
||||||
|
$data['value'] = $value;
|
||||||
|
} else {
|
||||||
|
$data['value'] = 'unchanged';
|
||||||
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
@ -182,6 +187,7 @@ class TreeMultiselectField extends TreeDropdownField
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = implode(", ", $titleArray);
|
$title = implode(", ", $titleArray);
|
||||||
|
sort($idArray);
|
||||||
$value = implode(",", $idArray);
|
$value = implode(",", $idArray);
|
||||||
} else {
|
} else {
|
||||||
$title = $emptyTitle;
|
$title = $emptyTitle;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user