Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG 3156e75 broke GridField Add forms because guessed frag was wrong

  • Loading branch information...
commit 55910175770a355b4b51cb12e7c83788dd9ba4fa 1 parent 39c6606
Hamish Friedlander hafriedlander authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 admin/javascript/LeftAndMain.js
7 admin/javascript/LeftAndMain.js
View
@@ -344,7 +344,12 @@ jQuery.noConflict();
} else {
// Fall back to replacing the content fragment if HTML is returned
$data = $(data);
- guessFragment = $data.is('form') ? 'CurrentForm' : 'Content';
+
+ // Try and guess the fragment if none is provided
+ // TODO: data-pjax-fragment might actually give us the fragment. For now we just check most common case
+ guessFragment = 'Content';
+ if ($data.is('form') && !$data.is('[data-pjax-fragment~=Content]')) guessFragment = 'CurrentForm';
+
newFragments[guessFragment] = $data;
}
Please sign in to comment.
Something went wrong with that request. Please try again.