From bd59f842f0d91ea07638cae417b9e9462038b89a Mon Sep 17 00:00:00 2001 From: Hamish Friedlander Date: Thu, 13 Dec 2012 10:18:21 +1300 Subject: [PATCH] FIX Make sure you can only remove items from a DataList that are actually in it --- model/DataList.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/model/DataList.php b/model/DataList.php index 8734e1563..f1a0e62aa 100644 --- a/model/DataList.php +++ b/model/DataList.php @@ -978,9 +978,8 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab */ public function remove($item) { // 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