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.

Let me know if this is submitted to the right branch.
This commit is contained in:
Tom Densham 2013-05-07 16:19:17 +02:00
parent 16b3398459
commit b0bda93d1d

View File

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