Skip to content
Snippets Groups Projects
Commit 4e1f8018 authored by Reinhard Führicht's avatar Reinhard Führicht Committed by Georg Ringer
Browse files

[BUGFIX] Import/Export Various Exceptions happening

Fixed exception shown when

1) uploading an existing file without "Overwrite" setting activated
2) opening export module as a non-admin
3) opening import module as a non-admin without permission
   to access an available file storage

Also improved error message for missing default file upload folder.

Resolves: #72765
Releases: master
Change-Id: Id1133d1a8adc6c28088ef85730fe01145b4fa3a2
Reviewed-on: https://review.typo3.org/45998


Reviewed-by: default avatarMartin Kutschker <martin.kutschker@ymail.com>
Tested-by: default avatarMartin Kutschker <martin.kutschker@ymail.com>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
parent 981ff259
Branches
Tags
No related merge requests found
......@@ -172,7 +172,9 @@ class ImportExportController extends BaseScriptClass
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
$this->doc->bodyTagId = 'imp-exp-mod';
$this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
$this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
if(is_array($this->pageinfo)) {
$this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
}
// Setting up the context sensitive menu:
$this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
$this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Impexp/ImportExport');
......@@ -817,18 +819,24 @@ class ImportExportController extends BaseScriptClass
$this->standaloneView->assign('inData', $inData);
$this->standaloneView->assign('fileSelectOptions', $selectOptions);
$this->standaloneView->assign('importPath', sprintf($this->lang->getLL('importdata_fromPathS', true), $path ? $path->getCombinedIdentifier() : $this->lang->getLL('importdata_no_accessible_file_mount', true)));
if ($path) {
$this->standaloneView->assign('importPath', sprintf($this->lang->getLL('importdata_fromPathS', true), $path->getCombinedIdentifier()));
} else {
$this->standaloneView->assign('importPath', $this->lang->getLL('importdata_no_default_upload_folder', true));
}
$this->standaloneView->assign('isAdmin', $beUser->isAdmin());
// Upload file:
$tempFolder = $this->getDefaultImportExportFolder();
$this->standaloneView->assign('tempFolder', $tempFolder->getCombinedIdentifier());
if ($tempFolder) {
$this->standaloneView->assign('tempFolder', $tempFolder->getCombinedIdentifier());
$this->standaloneView->assign('hasTempUploadFolder', true);
if (GeneralUtility::_POST('_upload')) {
$this->standaloneView->assign('submitted', GeneralUtility::_POST('_upload'));
$this->standaloneView->assign('noFileUploaded', $this->fileProcessor->internalUploadMap[1]);
$this->standaloneView->assign('uploadedFile', $this->uploadedFiles[0]->getName());
if($this->uploadedFiles[0]) {
$this->standaloneView->assign('uploadedFile', $this->uploadedFiles[0]->getName());
}
}
}
......
......@@ -331,7 +331,10 @@
<source>Structure has been imported, here is the result:</source>
</trans-unit>
<trans-unit id="importdata_no_accessible_file_mount">
<source>No accessible file_mount</source>
<source>No accessible filemount</source>
</trans-unit>
<trans-unit id="importdata_no_default_upload_folder">
<source>No default upload folder</source>
</trans-unit>
<trans-unit id="filterpage_structureToBeImported">
<source>Structure to be imported:</source>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment