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
This commit is contained in:
Ingo Schommer 2009-11-21 03:20:56 +00:00
parent f793ffd368
commit 1bc268e287

View File

@ -336,16 +336,13 @@ class LeftAndMain extends Controller {
// 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'));
}
}