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
This commit is contained in:
Ingo Schommer 2009-11-21 03:20:47 +00:00
parent 8f92ee35fb
commit 0df7de0c6b

View File

@ -352,8 +352,8 @@ class LeftAndMain extends Controller {
/** /**
* @deprecated 2.4 Please use show() * @deprecated 2.4 Please use show()
*/ */
public function getitem() { public function getitem($request) {
$form = $this->getEditForm(); $form = $this->getEditForm($request->getVar('ID'));
if($form) return $form->formHtmlContent(); if($form) return $form->formHtmlContent();
else return ""; else return "";
} }
@ -748,10 +748,10 @@ JS;
public function getEditForm($id = null) { public function getEditForm($id = null) {
if(!$id) $id = $this->currentPageID(); 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 && !$record->canView()) return Security::permissionFailure($this);
if($record) { if($record) {
$fields = $record->getCMSFields(); $fields = $record->getCMSFields();
if ($fields == null) { if ($fields == null) {