diff --git a/CHANGELOG.txt b/CHANGELOG.txt index be60a9981f..c512c4c118 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/src/Forms/Input/CustomField.php b/src/Forms/Input/CustomField.php index 368f1bd3b0..794bc0d72e 100644 --- a/src/Forms/Input/CustomField.php +++ b/src/Forms/Input/CustomField.php @@ -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); }