Some file upload fields not uploading
It works in some places, e.g. a custom field of type file, but for example:
- CiviMail - Message Templates
- Add message template
- Choose upload document for the Source.
- Upload a document - just a simple Word doc is fine - the file itself doesn't seem to be the issue.
- When you click "Save and Done" it doesn't get uploaded. If you debug a bit you can see the browser submits it in the network request but the file field does not exist in the array from exportValues().
I've reproduced the above on dmaster.demo. I can also reproduce it with a little extension that has a file field on a custom form:
in buildQuickForm:
$this->add('file', 'myfile', E::ts('My file'));
$this->addUploadElement('myfile');
in postProcess:
$values = $this->controller->exportValues($this->getName()); // it's the same if just use $this->exportValues()
CRM_Core_Error::debug(print_r($values, true));
Not sure when it started.