From 50b4605b30d44f510903a9b398551f297e4eb008 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Mon, 12 Mar 2012 18:32:25 +1300 Subject: [PATCH] BUGFIX #6939: fixed bug that disable a newly created page from doing futher action and left hand menu lost js handler --- code/controllers/CMSPageAddController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/controllers/CMSPageAddController.php b/code/controllers/CMSPageAddController.php index 7f78be3d..d44389e5 100644 --- a/code/controllers/CMSPageAddController.php +++ b/code/controllers/CMSPageAddController.php @@ -123,14 +123,14 @@ class CMSPageAddController extends CMSPageEditController { $record = $this->getNewItem("new-$className-$parentID".$suffix, false); if(class_exists('Translatable') && $record->hasExtension('Translatable')) $record->Locale = $data['Locale']; $record->write(); - - $this->setCurrentPageID($record->ID); + $editController = singleton('CMSPageEditController'); + $editController->setCurrentPageID($record->ID); $link = Controller::join_links(singleton('CMSPageEditController')->Link('show'), $record->ID); $this->getResponse()->addHeader('X-ControllerURL', $link); if(Director::is_ajax()) { - return $this->renderWith(array_pop($this->getTemplatesWithSuffix('_Content'))); + return $editController->renderWith(array_pop($editController->getTemplatesWithSuffix('_Content'))); } else { return $this->redirect($link); }