Skip to content

Commit

Permalink
BUG Redirect to edit view after page revert in CMS (fixes #7391)
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed Aug 27, 2012
1 parent cd8c3a0 commit e59aec3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code/controllers/CMSMain.php
Expand Up @@ -1061,8 +1061,12 @@ function doRollback($data, $form) {


// Can be used in different contexts: In normal page edit view, in which case the redirect won't have any effect. // Can be used in different contexts: In normal page edit view, in which case the redirect won't have any effect.
// Or in history view, in which case a revert causes the CMS to re-load the edit view. // Or in history view, in which case a revert causes the CMS to re-load the edit view.
// The X-Pjax header forces a "full" content refresh on redirect.
$url = Controller::join_links(singleton('CMSPageEditController')->Link('show'), $record->ID); $url = Controller::join_links(singleton('CMSPageEditController')->Link('show'), $record->ID);
$this->response->addHeader('X-ControllerURL', $url); $this->response->addHeader('X-ControllerURL', $url);
$this->request->addHeader('X-Pjax', 'Content');
$this->response->addHeader('X-Pjax', 'Content');

return $this->getResponseNegotiator()->respond($this->request); return $this->getResponseNegotiator()->respond($this->request);
} }


Expand Down

0 comments on commit e59aec3

Please sign in to comment.