Force write record's file relation

This commit is contained in:
colymba 2017-01-25 14:41:08 +02:00
parent 0e6f2e6efb
commit 3aad957a69

View File

@ -107,6 +107,7 @@ class GridFieldBulkUpload_Request extends RequestHandler
// Attach the file to record. // Attach the file to record.
$record->{"{$fileRelationName}ID"} = $uploadResponse['id']; $record->{"{$fileRelationName}ID"} = $uploadResponse['id'];
$record->write();
// attached record to gridField relation // attached record to gridField relation
$this->gridField->list->add($record); $this->gridField->list->add($record);
@ -220,6 +221,7 @@ class GridFieldBulkUpload_Request extends RequestHandler
// attach file // attach file
$record->{"{$fileRelationName}ID"} = $attachResponse['id']; $record->{"{$fileRelationName}ID"} = $attachResponse['id'];
$record->write();
// attached record to gridField relation // attached record to gridField relation
$this->gridField->list->add($record); $this->gridField->list->add($record);