mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
Add the whole record to the has_many realtion (#131)
* Add the whole record to the has_many realtion * Removed unnecessary record->write calls
This commit is contained in:
parent
8c0598a9ba
commit
caed3813ee
@ -107,10 +107,9 @@ 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->ID);
|
$this->gridField->list->add($record);
|
||||||
|
|
||||||
// JS Template Data
|
// JS Template Data
|
||||||
$responseData = $this->newRecordJSTemplateData($record, $uploadResponse);
|
$responseData = $this->newRecordJSTemplateData($record, $uploadResponse);
|
||||||
@ -221,10 +220,9 @@ 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->ID);
|
$this->gridField->list->add($record);
|
||||||
|
|
||||||
// JS Template Data
|
// JS Template Data
|
||||||
$responseData = $this->newRecordJSTemplateData($record, $attachResponse);
|
$responseData = $this->newRecordJSTemplateData($record, $attachResponse);
|
||||||
|
Loading…
Reference in New Issue
Block a user