Got a Dataobject with many_many attachments and have set the appropriate has_many relationships (I think so?)
class VideoSubmission extends DataObject {
private static $many_many = array(
'Attachments' => 'File'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$fileField = UploadField::create('Attachments', 'Upload some files');
return $fields;
}
// Add a data extension for file
class SubmissionFileExtension extends DataExtension{
private static $belongs_many_many = array(
'VideoSubmissions' => 'VideoSubmission'
);
}
File::add_extension('SubmissionFileExtension');
This works. But if I replace the fileUploadField above with:
$fileField = FileAttachmentField::create('Attachments', 'Upload some files')
->setView('grid');
Then files will upload but not attach.
I'm able to see the files added with UploadField (previously), I can detach them but can't add anything new.
I'm on the most recent composer installed ss (today).
My composer.json
{
"name": "silverstripe/installer",
"description": "The SilverStripe Framework Installer",
"require": {
"php": ">=5.3.2",
"silverstripe/cms": "3.1.13",
"silverstripe/framework": "3.1.13",
"silverstripe-themes/simple": "*",
"silverstripe/memberprofiles": "dev-master",
"rywa/silverstripe-foundation-forms": "~1.0@dev",
"burnbright/silverstripe-externalurlfield": "*@stable",
"silverstripe-australia/gridfieldextensions": "dev-master",
"unclecheese/dropzone": "dev-master"
},
"require-dev": {
"phpunit/PHPUnit": "~3.7@stable"
},
"config": {
"process-timeout": 600
},
"minimum-stability": "dev"
}