Skip to content

Commit

Permalink
[BUGFIX] check, if `$this->request->getUploadedFiles()['tx_mdnewsfron…
Browse files Browse the repository at this point in the history
…tend_newsfe']` exists, ref #30
  • Loading branch information
cdaecke committed Jan 10, 2024
1 parent f488544 commit 7ad9368
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Classes/Controller/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,14 @@ protected function setEnableFieldsTypeConverter(string $object): void
protected function initializeFileUpload($obj)
{
$versionInformation = GeneralUtility::makeInstance(Typo3Version::class);
$files = ($versionInformation->getMajorVersion() >= 12) ?
$this->request->getUploadedFiles():
$this->request->getUploadedFiles()['tx_mdnewsfrontend_newsfe'];
if ($versionInformation->getMajorVersion() >= 12) {
$files = $this->request->getUploadedFiles();
} else {
$files = [];
if (isset($this->request->getUploadedFiles()['tx_mdnewsfrontend_newsfe'])) {
$files = $this->request->getUploadedFiles()['tx_mdnewsfrontend_newsfe'];
}
}

foreach ($this->uploadFields as $fieldName) {
if (isset($files[$fieldName])) {
Expand Down

0 comments on commit 7ad9368

Please sign in to comment.