From 915decb1f6e2535264fe37b47556b272f384ca68 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Sun, 14 Dec 2008 21:23:40 +0000 Subject: [PATCH] BUGFIX: Check hasChanged method exists before calling it git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@68809 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/DataObject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/model/DataObject.php b/core/model/DataObject.php index 966de34f7..b6db294d2 100644 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -702,7 +702,7 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP // Update the changed array with references to changed obj-fields foreach($this->record as $k => $v) { - if(is_object($v) && $v->isChanged()) { + if(is_object($v) && method_exists($v, 'isChanged') && $v->isChanged()) { $this->changed[$k] = true; } } @@ -2970,4 +2970,4 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP } -?> \ No newline at end of file +?>