From 0df7de0c6b5f8805adb9982ef622d410754d6104 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 03:20:47 +0000 Subject: [PATCH] BUGFIX Using getRecord() in LeftAndMain->getEditForm(), passing through ID request params from getitem() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92844 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/LeftAndMain.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 32751a64..1f1bd0e5 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -352,8 +352,8 @@ class LeftAndMain extends Controller { /** * @deprecated 2.4 Please use show() */ - public function getitem() { - $form = $this->getEditForm(); + public function getitem($request) { + $form = $this->getEditForm($request->getVar('ID')); if($form) return $form->formHtmlContent(); else return ""; } @@ -748,10 +748,10 @@ JS; public function getEditForm($id = null) { if(!$id) $id = $this->currentPageID(); - - $record = ($id && $id != "root") ? DataObject::get_by_id($this->stat('tree_class'), $id) : null; + + $record = ($id && $id != "root") ? $this->getRecord($id) : null; if($record && !$record->canView()) return Security::permissionFailure($this); - + if($record) { $fields = $record->getCMSFields(); if ($fields == null) {