FIX use the correct method for CSV exports and include the full file path

This commit is contained in:
Franco Springveldt 2017-06-27 11:03:32 +12:00
parent e86306c7bf
commit 1e1b596739
2 changed files with 7 additions and 2 deletions

View File

@ -55,7 +55,7 @@ class SubmittedFileField extends SubmittedFormField
{ {
if ($file = $this->UploadedFile()) { if ($file = $this->UploadedFile()) {
if (trim($file->getFilename(), '/') != trim(ASSETS_DIR, '/')) { if (trim($file->getFilename(), '/') != trim(ASSETS_DIR, '/')) {
return $this->UploadedFile()->URL; return $this->UploadedFile()->AbsoluteLink();
} }
} }
} }

View File

@ -65,9 +65,14 @@ class SubmittedForm extends DataObject
$self->Values()->sort('Created', 'ASC') $self->Values()->sort('Created', 'ASC')
); );
$exportColumns = array(
'Title' => 'Title',
'ExportValue' => 'Value'
);
$config = new GridFieldConfig(); $config = new GridFieldConfig();
$config->addComponent(new GridFieldDataColumns()); $config->addComponent(new GridFieldDataColumns());
$config->addComponent(new GridFieldExportButton()); $config->addComponent(new GridFieldExportButton('after', $exportColumns));
$config->addComponent(new GridFieldPrintButton()); $config->addComponent(new GridFieldPrintButton());
$values->setConfig($config); $values->setConfig($config);