Skip to content

Commit

Permalink
Reports: fix file upload not working in Template Builder
Browse files Browse the repository at this point in the history
  • Loading branch information
SKuipers committed Oct 20, 2022
1 parent 427b562 commit 144ed13
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 @@ -87,6 +87,7 @@ v25.0.00
Reports: fixed error when milestones are empty in Manage Reporting Cycles
Reports: fixed batch report bulk-action missing the two-sided option
Reports: fixed HTML being removed from Rich Text template sections
Reports: fixed file upload not working in Template Builder
School Admin: fixed error in Add Attendance Code when no roles specified
School Admin: fixed possible duplicate values using Copy All To Next Year in Manage Form Groups
Staff: fixed staff absences not showing up if outside school year dates
Expand Down
6 changes: 4 additions & 2 deletions src/Forms/Input/CustomField.php
Expand Up @@ -90,12 +90,14 @@ 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 'fileupload':
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 144ed13

Please sign in to comment.