[BUGFIX] Use correct value for overwriteExistingFiles 12/49012/4
authorDaniel Goerz <ervaude@gmail.com>
Sun, 17 Jul 2016 11:26:28 +0000 (13:26 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 19 Jul 2016 19:17:19 +0000 (21:17 +0200)
Prevent cast errors due to legacy removal when using
overwriteExistingFiles to overwrite existing files.

Resolves: #77136
Releases: master
Change-Id: Ia86815b2db0d8b86b67c7b6cf454b308414ff3aa
Reviewed-on: https://review.typo3.org/49012
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/impexp/Classes/Controller/ImportExportController.php
typo3/sysext/impexp/Resources/Private/Partials/Import/Upload.html
typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php

index 1748cee..947a235 100644 (file)
@@ -954,7 +954,7 @@ class ImportExportController extends BaseScriptClass
         $this->fileProcessor = GeneralUtility::makeInstance(ExtendedFileUtility::class);
         $this->fileProcessor->init(array(), $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
         $this->fileProcessor->setActionPermissions();
-        $this->fileProcessor->setExistingFilesConflictMode((int)GeneralUtility::_GP('overwriteExistingFiles') === 1 ? DuplicationBehavior::REPLACE : DuplicationBehavior::CANCEL);
+        $this->fileProcessor->setExistingFilesConflictMode(DuplicationBehavior::cast(GeneralUtility::_GP('overwriteExistingFiles')));
         // Checking referer / executing:
         $refInfo = parse_url(GeneralUtility::getIndpEnv('HTTP_REFERER'));
         $httpHost = GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY');
index b489d4e..e9944c0 100644 (file)
@@ -14,7 +14,7 @@
 </div>
 <div class="form-group">
        <label for="checkOverwriteExistingFiles">
-               <f:form.checkbox name="overwriteExistingFiles" id="checkOverwriteExistingFiles" value="1" checked="checked" />
+               <f:form.checkbox name="overwriteExistingFiles" id="checkOverwriteExistingFiles" value="replace" checked="checked" />
                <f:translate key="LLL:EXT:lang/locallang_misc.xlf:overwriteExistingFiles" />
        </label>
 </div>
index 9c4a6d7..f8433d0 100644 (file)
@@ -167,7 +167,7 @@ class FolderUtilityRenderer
 
         $markup[] = '<div class="checkbox">';
         $markup[] = '    <label>';
-        $markup[] = '    <input type="checkbox" name="overwriteExistingFiles" id="overwriteExistingFiles" value="1" />';
+        $markup[] = '    <input type="checkbox" name="overwriteExistingFiles" id="overwriteExistingFiles" value="replace" />';
         $markup[] = htmlspecialchars($lang->sL('LLL:EXT:lang/locallang_misc.xlf:overwriteExistingFiles'));
         $markup[] = '    </label>';
         $markup[] = '</div>';