Skip to content
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...
1 parent 47b56d4 commit 06cddb747a1f2a045ba907aa3e79c4b51f8a5ae8 @chillu chillu committed
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) {

0 comments on commit 06cddb7

Please sign in to comment.
Something went wrong with that request. Please try again.