mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Make sure you can only remove items from a DataList that are actually in it
This commit is contained in:
parent
9979b11b59
commit
bd59f842f0
@ -978,9 +978,8 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab
|
|||||||
*/
|
*/
|
||||||
public function remove($item) {
|
public function remove($item) {
|
||||||
// By default, we remove an item from a DataList by deleting it.
|
// By default, we remove an item from a DataList by deleting it.
|
||||||
if($item instanceof $this->dataClass) $item->delete();
|
$this->removeByID($item->ID);
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove an item from this DataList by ID
|
* Remove an item from this DataList by ID
|
||||||
|
Loading…
Reference in New Issue
Block a user