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: Martin Kutschker <martin.kutschker@ymail.com>
Tested-by: Martin Kutschker <martin.kutschker@ymail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
$this->doc->bodyTagId = 'imp-exp-mod';
$this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
$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');
// Setting up the context sensitive menu:
$this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
$this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Impexp/ImportExport');
$this->standaloneView->assign('inData', $inData);
$this->standaloneView->assign('fileSelectOptions', $selectOptions);
$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('isAdmin', $beUser->isAdmin());
// Upload file:
$tempFolder = $this->getDefaultImportExportFolder();
- $this->standaloneView->assign('tempFolder', $tempFolder->getCombinedIdentifier());
+ $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('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());
+ }
<source>Structure has been imported, here is the result:</source>
</trans-unit>
<trans-unit id="importdata_no_accessible_file_mount">
<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>
</trans-unit>
<trans-unit id="filterpage_structureToBeImported">
<source>Structure to be imported:</source>