Commit 0fd5a2dc authored by Christian Kuhn's avatar Christian Kuhn Committed by Andreas Fernandez
Browse files

[TASK] impexp: Remove "Max file size" restriction

The export modules has a file size restriction
that skips file exports if they are bigger than
by default 1MB. This can be raised with an input
field.
The patch removes that input field:
* Configured maximum file sizes are checked during
  upload already. A well configured system should
  expect existing files are ok and just export everything
* The 1MB default size is old fashioned. Typical images
  are often bigger in size and resized only during FE
  rendering
* Skipping arbitrary files in export has a negative
  impact on data consistency of the export.
* Single files can still be excluded from export if
  needed
* Users up until now usually had manually raised the
  limit to some value high enough to make all files fit

Change-Id: Ib70dc48de44d215067474b4c3f6fff8988ab7712
Resolves: #83596
Releases: master
Reviewed-on: https://review.typo3.org/55382


Reviewed-by: default avatarReiner Teubner <rteubner@me.com>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Tested-by: default avatarReiner Teubner <rteubner@me.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent 1246917a
......@@ -40,6 +40,10 @@ export module usually set the 'maximum number of records' value high
enough to export everything they wanted already. The interface now
just misses the according input fields.
Migration
=========
On PHP level, the extension scanner will find extensions that use
the changed methods and checks if they are called with the
correct number of arguments. Additionally, :php:`E_USER_DEPRECATED`
......
.. include:: ../../Includes.txt
=================================================================
Deprecation: #83596 - impexp: Removed "Max file size" restriction
=================================================================
See :issue:`83596`
Description
===========
When exporting files using the "Export" interface of extension
:php:`impexp`, the restriction to only export files of a certain
maximum size has been removed.
Impact
======
On PHP level, one class property has been deprecated and is unused now:
* :php:`TYPO3\CMS\Impexp\Export->maxFileSize`
Affected Installations
======================
Backend users are probably not affected much: Users of the
export module usually set the 'max file size' value high
enough to export everything they wanted already. The interface now
just misses the according input fields and exports files of all sizes.
Migration
=========
On PHP level, the extension scanner will find extensions that
still use the deprecated property.
.. index:: Backend, PHP-API, FullyScanned, ext:impexp
\ No newline at end of file
......@@ -368,7 +368,6 @@ class ImportExportController extends BaseScriptClass
{
// BUILDING EXPORT DATA:
// Processing of InData array values:
$inData['maxFileSize'] = MathUtility::forceIntegerInRange($inData['maxFileSize'], 1, 1000000, 1000);
$inData['filename'] = trim(preg_replace('/[^[:alnum:]._-]*/', '', preg_replace('/\\.(t3d|xml)$/', '', $inData['filename'])));
if (strlen($inData['filename'])) {
$inData['filename'] .= $inData['filetype'] === 'xml' ? '.xml' : '.t3d';
......@@ -382,7 +381,6 @@ class ImportExportController extends BaseScriptClass
// Create export object and configure it:
$this->export = GeneralUtility::makeInstance(Export::class);
$this->export->init(0);
$this->export->maxFileSize = $inData['maxFileSize'] * 1024;
$this->export->excludeMap = (array)$inData['exclude'];
$this->export->softrefCfg = (array)$inData['softrefCfg'];
$this->export->extensionDependencies = ($inData['extension_dep'] === '') ? [] : (array)$inData['extension_dep'];
......
......@@ -59,8 +59,7 @@ use TYPO3\CMS\Core\Utility\PathUtility;
class Export extends ImportExport
{
/**
* 1MB max file size
*
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10. In v10, just remove property, it is not used any longer.
* @var int
*/
public $maxFileSize = 1000000;
......@@ -661,10 +660,6 @@ class Export extends ImportExport
*/
public function export_addSysFile(File $file)
{
if ($file->getProperty('size') >= $this->maxFileSize) {
$this->error('File ' . $file->getPublicUrl() . ' was larger (' . GeneralUtility::formatSize($file->getProperty('size')) . ') than the maxFileSize (' . GeneralUtility::formatSize($this->maxFileSize) . ')! Skipping.');
return;
}
$fileContent = '';
try {
if (!$this->saveFilesOutsideExportFile) {
......@@ -724,10 +719,6 @@ class Export extends ImportExport
$this->error($fI['ID_absFile'] . ' was not a file! Skipping.');
return;
}
if (filesize($fI['ID_absFile']) >= $this->maxFileSize) {
$this->error($fI['ID_absFile'] . ' was larger (' . GeneralUtility::formatSize(filesize($fI['ID_absFile'])) . ') than the maxFileSize (' . GeneralUtility::formatSize($this->maxFileSize) . ')! Skipping.');
return;
}
$fileInfo = stat($fI['ID_absFile']);
$fileRec = [];
$fileRec['filesize'] = $fileInfo['size'];
......
......@@ -201,9 +201,6 @@
<trans-unit id="makesavefo_fileFormat">
<source>File format:</source>
</trans-unit>
<trans-unit id="makesavefo_maxSizeOfFiles">
<source>Max size of files to include (kb):</source>
</trans-unit>
<trans-unit id="makesavefo_filenameSavedInS">
<source>Filename (saved in "%s"):</source>
</trans-unit>
......
......@@ -64,10 +64,6 @@
<div class="form-group">
<f:form.select class="form-control" name="tx_impexp[filetype]" options="{filetypeSelectOptions}" value="{inData.filetype}" />
</div>
<div class="form-group">
<label for="impexp-maxfilesize"><f:translate key="makesavefo_maxSizeOfFiles" /></label>
<f:form.textfield class="form-control" name="tx_impexp[maxFileSize]" id="impexp-maxfilesize" value="{inData.maxFileSize}" />
</div>
<div class="form-group">
<label for="impexp-filename"><f:translate key="makesavefo_filenameSavedInS" arguments="{0: saveFolder}" /></label>
<f:form.textfield class="form-control" name="tx_impexp[filename]" id="impexp-filename" value="{inData.filename}" />
......
......@@ -311,4 +311,9 @@ return [
'Deprecation-83273-PublicPropertiesOfTemplateService.rst',
],
],
'TYPO3\CMS\Impexp\Export->maxFileSize' => [
'restFiles' => [
'Deprecation-83596-ImpexpRemovedMaxFileSizeRestriction.rst'
],
],
];
Supports Markdown
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