Browse files

BUGFIX Fixed loading of full page template via ajax in CMSPageHistory…

…Controller, which causes infinite loops in CMS initialization
  • Loading branch information...
1 parent d66a472 commit c5323547b85355bde9558927355eac04b24a7765 @chillu chillu committed Oct 29, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −5 code/controllers/CMSPageHistoryController.php
View
9 code/controllers/CMSPageHistoryController.php
@@ -24,12 +24,11 @@ class CMSPageHistoryController extends CMSMain {
* @return array
*/
function show($request) {
- $form = $this->ShowVersionForm(
- $request->param('VersionID')
- );
+ $form = $this->ShowVersionForm($request->param('VersionID'));
- if($form && $this->isAjax()) {
- $content = $form->forTemplate();
+ if($this->isAjax()) {
+ if($form) $content = $form->forTemplate();
+ else $content = $this->renderWith($this->getTemplatesWithSuffix('_Content'));
} else {
$content = $this->customise(array('EditForm' => $form))->renderWith($this->getViewer('show'));
}

0 comments on commit c532354

Please sign in to comment.