From 70db5d36a03684bee05b10b66e238b7bb37155e9 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Tue, 2 Oct 2007 04:52:31 +0000 Subject: [PATCH] Hack to fix Fatal error: Call to undefined method stdClass::allMethodNames() (merged from 2.0.2 branch, r42505) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42921 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Object.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/Object.php b/core/Object.php index b2ee3d78f..49fecbd2d 100755 --- a/core/Object.php +++ b/core/Object.php @@ -200,9 +200,12 @@ class Object { protected function addMethodsFrom($parameterName, $arrayIndex = null) { $obj = isset($arrayIndex) ? $this->{$parameterName}[$arrayIndex] : $this->$parameterName; if(!$obj) user_error("Object::addMethodsFrom: $parameterName/$arrayIndex", E_USER_ERROR); - $methodNames = $obj->allMethodNames(true); - foreach($methodNames as $methodName) { - Object::$extraMethods[$this->class][$methodName] = array("parameterName" => $parameterName, "arrayIndex" => $arrayIndex); + // Hack to fix Fatal error: Call to undefined method stdClass::allMethodNames() + if(method_exists($obj, 'allMethodNames')) { + $methodNames = $obj->allMethodNames(true); + foreach($methodNames as $methodName) { + Object::$extraMethods[$this->class][$methodName] = array("parameterName" => $parameterName, "arrayIndex" => $arrayIndex); + } } }