FIX #152 force write image ID

ManyManyList::add did not call write on dataObject, so the image was never attached
This commit is contained in:
Thierry François 2018-03-06 14:36:10 +02:00
parent e26ad4548b
commit 482139fd35

View File

@ -93,6 +93,7 @@ class BulkUploadHandler extends RequestHandler
$fileRelationName = $this->component->getFileRelationName($this->gridField); $fileRelationName = $this->component->getFileRelationName($this->gridField);
$record->{"{$fileRelationName}ID"} = $fileID; $record->{"{$fileRelationName}ID"} = $fileID;
$record->write(); //HasManyList call write on record but not ManyManyList, so we call it here again
$this->gridField->list->add($record); $this->gridField->list->add($record);