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

This commit is contained in:
Hamish Friedlander 2012-07-27 11:13:23 +12:00
parent 39c6606e13
commit 5591017577

View File

@ -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;
}