Skip to content

Commit

Permalink
Reports: fixed file uploads not working in Template Builder
Browse files Browse the repository at this point in the history
  • Loading branch information
SKuipers committed Aug 30, 2021
1 parent d970ba5 commit 701cffe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Expand Up @@ -50,6 +50,7 @@ v23.0.00
Reports: fixed Left students showing up in the Archive by Student list
Reports: fixed error with empty milestones when creating a Reporting Cycle
Reports: fixed issue where re-sending a report will break existing report download links
Reports: fixed file uploads not working in Template Builder
Students: fixed ID card background image alignment
System Admin: fixed importing custom fields that have spaces around the values
System Admin: fixed importing custom fields failing when existing fields value is null
Expand Down
6 changes: 4 additions & 2 deletions src/Forms/Input/CustomField.php
Expand Up @@ -87,11 +87,13 @@ public function __construct(FormFactoryInterface $factory, $name, $fields)
break;

case 'image':
$this->customField = $this->factory->createFileUpload($name.'File')->accepts('.jpg,.jpeg,.gif,.png,.svg');
$fieldName = stripos($name, '[') !== false ? $name : $name.'File';
$this->customField = $this->factory->createFileUpload($fieldName)->accepts('.jpg,.jpeg,.gif,.png,.svg');
break;

case 'file':
$this->customField = $this->factory->createFileUpload($name.'File');
$fieldName = stripos($name, '[') !== false ? $name : $name.'File';
$this->customField = $this->factory->createFileUpload($fieldName);
if (!empty($options)) {
$this->customField->accepts($options);
}
Expand Down

0 comments on commit 701cffe

Please sign in to comment.