FIX Make sure you can only remove items from a DataList that are actually in it

This commit is contained in:
Hamish Friedlander 2012-12-13 10:18:21 +13:00
parent 9979b11b59
commit bd59f842f0

View File

@ -978,8 +978,7 @@ 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);
} }
/** /**