Permalink
Browse files

MINOR Only fetching EditForm in LeftAndMain->show() if called by ajax…

…, the customize() call for non-ajax views confuses the renderer otherwise

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92847 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent f793ffd commit 1bc268e28758ee502bde7f0d00719e0c01916248 @chillu chillu committed Nov 21, 2009
Showing with 2 additions and 5 deletions.
  1. +2 −5 code/LeftAndMain.php
View
@@ -336,16 +336,13 @@ public function show($request) {
// TODO Necessary for TableListField URLs to work properly
if($request->param('ID')) $this->setCurrentPageID($request->param('ID'));
- $form = $this->getEditForm($request->param('ID'));
-
if(Director::is_ajax()) {
SSViewer::setOption('rewriteHashlinks', false);
+ $form = $this->getEditForm($request->param('ID'));
return $form->formHtmlContent();
} else {
// Rendering is handled by template, which will call EditForm() eventually
- return $this->customise(array(
- 'EditForm' => $form
- ))->renderWith($this->getViewer('show'));
+ return $this->renderWith($this->getViewer('show'));
}
}

0 comments on commit 1bc268e

Please sign in to comment.