Browse files

BUG Redirect to edit view after page revert in CMS (fixes #7391)

  • Loading branch information...
chillu committed Aug 27, 2012
1 parent cd8c3a0 commit e59aec3f6f6c1215d2a83e1e404e0988b69815b9
Showing with 4 additions and 0 deletions.
  1. +4 −0 code/controllers/CMSMain.php
@@ -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.
// 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);
$this->response->addHeader('X-ControllerURL', $url);
+ $this->request->addHeader('X-Pjax', 'Content');
+ $this->response->addHeader('X-Pjax', 'Content');
return $this->getResponseNegotiator()->respond($this->request);

0 comments on commit e59aec3

Please sign in to comment.