Permalink
Browse files

BUGFIX Using getRecord() in LeftAndMain->getEditForm(), passing throu…

…gh ID request params from getitem()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92844 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 8f92ee3 commit 0df7de0c6b5f8805adb9982ef622d410754d6104 @chillu chillu committed Nov 21, 2009
Showing with 5 additions and 5 deletions.
  1. +5 −5 code/LeftAndMain.php
View
@@ -352,8 +352,8 @@ public function show($request) {
/**
* @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 @@ function EditForm($request = null) {
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) {

0 comments on commit 0df7de0

Please sign in to comment.