From 0efd842a8b490fc8fb91af4de35e0cd879af52c2 Mon Sep 17 00:00:00 2001 From: Tom Densham Date: Thu, 2 May 2013 17:55:06 +0200 Subject: [PATCH] Use populateCMSDataFields to return default DataObject values I have edited the getRecordHTMLFormFields method to run populateCMSDataFields so that default values set in your DataObject get pulled through. --- code/GridFieldBulkImageUpload_Request.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/GridFieldBulkImageUpload_Request.php b/code/GridFieldBulkImageUpload_Request.php index 20af9ae..cc41c93 100644 --- a/code/GridFieldBulkImageUpload_Request.php +++ b/code/GridFieldBulkImageUpload_Request.php @@ -166,6 +166,7 @@ class GridFieldBulkImageUpload_Request extends RequestHandler { if ( $config['imageFieldName'] == null ) $config['imageFieldName'] = $this->getDefaultRecordImageField(); $recordCMSDataFields = GridFieldBulkEditingHelper::getModelFilteredDataFields($config, $recordCMSDataFields); + $recordCMSDataFields = GridFieldBulkEditingHelper::populateCMSDataFields($recordCMSDataFields, $this->gridField->list->dataClass, $recordID); $formFieldsHTML = GridFieldBulkEditingHelper::dataFieldsToHTML($recordCMSDataFields); $formFieldsHTML = GridFieldBulkEditingHelper::escapeFormFieldsHTML($formFieldsHTML, $recordID); @@ -430,4 +431,4 @@ class GridFieldBulkImageUpload_Request extends RequestHandler { ))); return $items; } -} \ No newline at end of file +}