mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: Updated TableField to use ArrayList rather than DataObjectSet when using a DataList.
This commit is contained in:
parent
7e7677bbba
commit
bdfff5bee3
@ -164,8 +164,9 @@ class TableField extends TableListField {
|
||||
$rows = $this->sortData(ArrayLib::invert($this->value));
|
||||
// ignore all rows which are already saved
|
||||
if(isset($rows['new'])) {
|
||||
if($sourceItems instanceof DataList) $sourceItems = $sourceItems->toDataObjectSet();
|
||||
|
||||
if($sourceItems instanceof DataList) {
|
||||
$sourceItems = new ArrayList($sourceItems->toArray());
|
||||
}
|
||||
|
||||
$newRows = $this->sortData($rows['new']);
|
||||
// iterate over each value (not each row)
|
||||
@ -183,7 +184,7 @@ class TableField extends TableListField {
|
||||
|
||||
// generate a temporary DataObject container (not saved in the database)
|
||||
$sourceClass = $this->sourceClass();
|
||||
$sourceItems->push(new $sourceClass($newRow));
|
||||
$sourceItems->add(new $sourceClass($newRow));
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user