Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 55910175770a355b4b51cb12e7c83788dd9ba4fa 1 parent 39c6606
Hamish Friedlander authored July 27, 2012

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. 7  admin/javascript/LeftAndMain.js
7  admin/javascript/LeftAndMain.js
@@ -344,7 +344,12 @@ jQuery.noConflict();
344 344
 				} else {
345 345
 					// Fall back to replacing the content fragment if HTML is returned
346 346
 					$data = $(data);
347  
-					guessFragment = $data.is('form') ? 'CurrentForm' : 'Content';
  347
+
  348
+					// Try and guess the fragment if none is provided
  349
+					// TODO: data-pjax-fragment might actually give us the fragment. For now we just check most common case
  350
+					guessFragment = 'Content';
  351
+					if ($data.is('form') && !$data.is('[data-pjax-fragment~=Content]')) guessFragment = 'CurrentForm';
  352
+
348 353
 					newFragments[guessFragment] = $data;
349 354
 				}
350 355
 

0 notes on commit 5591017

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