Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG Force refresh of GridFieldDetailEditForm after save

Wasn't refreshing after ajax save operations on existing
content, as the URL didn't change, and hence the CMS
didn't reload the view. Return the view directly instead,
unless we're dealing with new records (= changed URL).
  • Loading branch information...
commit 06cddb747a1f2a045ba907aa3e79c4b51f8a5ae8 1 parent 47b56d4
@chillu chillu authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 forms/gridfield/GridFieldDetailForm.php
8 forms/gridfield/GridFieldDetailForm.php
@@ -384,7 +384,13 @@ function doSave($data, $form) {
$form->sessionMessage($message, 'good');
- return Controller::curr()->redirect($this->Link());
+ if($new_record) {
+ return Controller::curr()->redirect($this->Link());
+ } else {
+ // Return new view, as we can't do a "virtual redirect" via the CMS Ajax
+ // to the same URL (it assumes that its content is already current, and doesn't reload)
+ return $this->edit(Controller::curr()->getRequest());
+ }
function doDelete($data, $form) {
Please sign in to comment.
Something went wrong with that request. Please try again.