Skip to content
This repository
Browse code

FIX Only reload data for a item edited through a GridField if the rec…

…ord exists. Fix 7721
  • Loading branch information...
commit 90b0fe8db7fe16c2cd4a13c7f3cfb467ebcd86ac 1 parent fb9e997
Jean-Fabien authored August 01, 2012 wilr committed August 04, 2012

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

  1. 4  forms/gridfield/GridFieldDetailForm.php
4  forms/gridfield/GridFieldDetailForm.php
@@ -316,7 +316,9 @@ function ItemEditForm() {
316 316
 			$actions,
317 317
 			$this->component->getValidator()
318 318
 		);
319  
-		$form->loadDataFrom($this->record);
  319
+		if($this->record->ID !== 0) {
  320
+		  $form->loadDataFrom($this->record);
  321
+		}
320 322
 
321 323
 		// TODO Coupling with CMS
322 324
 		$toplevelController = $this->getToplevelController();

0 notes on commit 90b0fe8

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