Permalink
Browse files

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

  • Loading branch information...
1 parent 39c6606 commit 55910175770a355b4b51cb12e7c83788dd9ba4fa Hamish Friedlander committed Jul 26, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 admin/javascript/LeftAndMain.js
@@ -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;
}

0 comments on commit 5591017

Please sign in to comment.