From e59aec3f6f6c1215d2a83e1e404e0988b69815b9 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 27 Aug 2012 14:19:40 +0200 Subject: [PATCH] BUG Redirect to edit view after page revert in CMS (fixes #7391) --- code/controllers/CMSMain.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 8672db4b..9285259e 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -1061,8 +1061,12 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr // 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); }