BUGFIX: Fixed refactoring of getRecord() so that it can handle currentPage() calls properly.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@75614 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-04-29 02:49:29 +00:00
parent d33c2869a7
commit 62f9202c00

View File

@ -450,8 +450,10 @@ class LeftAndMain extends Controller {
}
public function getRecord($id, $className = null) {
if(!$className) $className = $this->stat('tree_class');
return DataObject::get_by_id($className, $id);
if($id && is_numeric($id)) {
if(!$className) $className = $this->stat('tree_class');
return DataObject::get_by_id($className, $id);
}
}
function getSiteTreeFor($className, $rootID = null) {