From 9d32d9518fa8e449896bdd370735bd7b7c4b5d18 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 16 Sep 2007 17:02:17 +0000 Subject: [PATCH] bfojcapell: Fixed php notice (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42150 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/GenericDataAdmin.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/GenericDataAdmin.php b/code/GenericDataAdmin.php index b80e9942..ef5c151b 100755 --- a/code/GenericDataAdmin.php +++ b/code/GenericDataAdmin.php @@ -372,12 +372,14 @@ HTML; $i++; } } else { - list ($field, $caster) = explode("->", $field); + $fieldParts = explode("->", $field); + $field = $fieldParts[0]; if(preg_match('/^(.+)\.(.+)$/', $field, $matches)) { $field = $matches[2]; } - if($caster) { + if(isset($fieldParts[1])) { + $caster = $fieldParts[1]; // When the intending value is Created.Date, the obj need to be casted as Datetime explicitely. if ($field == "Created" || $field == "LastEdited") { $created = Object::create('Datetime', $result->Created, "Created");