mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX: Fix edit form after adding a page.
This commit is contained in:
parent
59981982f4
commit
038bb1c9bb
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class CMSPageAddController extends CMSMain {
|
||||
class CMSPageAddController extends CMSPageEditController {
|
||||
|
||||
static $url_segment = 'page/add';
|
||||
static $url_rule = '/$Action/$ID/$OtherID';
|
||||
@ -123,14 +123,13 @@ class CMSPageAddController extends CMSMain {
|
||||
if(class_exists('Translatable') && $record->hasExtension('Translatable')) $record->Locale = $data['Locale'];
|
||||
$record->write();
|
||||
|
||||
$form = $this->getEditForm($record->ID);
|
||||
$this->setCurrentPageID($record->ID);
|
||||
|
||||
$link = Controller::join_links(singleton('CMSPageEditController')->Link('show'), $record->ID);
|
||||
$this->getResponse()->addHeader('X-ControllerURL', $link);
|
||||
|
||||
if(Director::is_ajax()) {
|
||||
$form = $this->getEditForm($record->ID);
|
||||
return $form->forTemplate();
|
||||
return $this->renderWith(array_pop($this->getTemplatesWithSuffix('_Content')));
|
||||
} else {
|
||||
return $this->redirect($link);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user