Permalink
Browse files

FIX Make sure you can only remove items from a DataList that are actu…

…ally in it
  • Loading branch information...
1 parent 9979b11 commit bd59f842f0d91ea07638cae417b9e9462038b89a Hamish Friedlander committed Dec 12, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 model/DataList.php
View
@@ -978,9 +978,8 @@ public function newObject($initialFields = null) {
*/
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

0 comments on commit bd59f84

Please sign in to comment.