From 7315be4531975998f683e41b48781d3ed7d9c74f Mon Sep 17 00:00:00 2001 From: Hamish Friedlander Date: Fri, 16 Nov 2012 11:48:31 +1300 Subject: [PATCH] FIX default values from DataObject not showing in GridField details form --- forms/gridfield/GridFieldDetailForm.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/forms/gridfield/GridFieldDetailForm.php b/forms/gridfield/GridFieldDetailForm.php index 4aeef7931..d6000e10d 100644 --- a/forms/gridfield/GridFieldDetailForm.php +++ b/forms/gridfield/GridFieldDetailForm.php @@ -325,9 +325,8 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler { $actions, $this->component->getValidator() ); - if($this->record->ID !== 0) { - $form->loadDataFrom($this->record); - } + + $form->loadDataFrom($this->record, $this->record->ID == 0 ? Form::MERGE_IGNORE_FALSEISH : Form::MERGE_DEFAULT); // TODO Coupling with CMS $toplevelController = $this->getToplevelController();