[TASK] Add support for having files outside the t3d/xml in impexp 53/30453/3
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Tue, 27 May 2014 19:42:42 +0000 (21:42 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 20 Jun 2014 16:27:53 +0000 (18:27 +0200)
Impexp files are blown up from the files that are included as base64.
This patch adds the possibility to have the files separated from the
 t3d/xml export file. They are saved to a folder beside the export file.

Resolves: #57379
Releases: 6.3, 6.2
Change-Id: Ib8bdc4336c64d2eae0e993132a5fce84eb01f766
Reviewed-on: https://review.typo3.org/30453
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
13 files changed:
typo3/sysext/impexp/Classes/Controller/ImportExportController.php
typo3/sysext/impexp/Classes/ImportExport.php
typo3/sysext/impexp/Tests/Functional/Export/GroupFileAndFileReferenceItem/ExportTest.php
typo3/sysext/impexp/Tests/Functional/Export/PagesAndTtContentWithImages/ExportTest.php
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml [new file with mode: 0644]
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml.files/c3511df85d21bc578faf71c6a19eeb3ff44af370 [new file with mode: 0644]
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml.files/e1c5c4e1e34e19e2facb438752e06c3f [new file with mode: 0644]
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml [new file with mode: 0644]
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml.files/da9acdf1e105784a57bbffec9520969578287797 [new file with mode: 0644]
typo3/sysext/impexp/Tests/Functional/Import/GroupFileAndFileReferenceItem/ImportInEmptyDatabaseTest.php
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/importPagesAndRelatedTtContentWithImagesButNotIncluded.csv [new file with mode: 0644]
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/ImportInEmptyDatabaseTest.php
typo3/sysext/impexp/app/locallang.xlf

index 925cc5b..a986906 100644 (file)
@@ -29,6 +29,7 @@ namespace TYPO3\CMS\Impexp\Controller;
 
 use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
+use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
@@ -236,6 +237,11 @@ class ImportExportController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                if (is_array($inData['external_ref']['tables'])) {
                        $this->export->relOnlyTables = $inData['external_ref']['tables'];
                }
+               $saveFilesOutsideExportFile = FALSE;
+               if (isset($inData['save_export']) && isset($inData['saveFilesOutsideExportFile']) && $inData['saveFilesOutsideExportFile'] === '1') {
+                       $this->export->setSaveFilesOutsideExportFile(TRUE);
+                       $saveFilesOutsideExportFile = TRUE;
+               }
                $this->export->setHeaderBasics();
                // Meta data setting:
 
@@ -379,6 +385,17 @@ class ImportExportController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                                        file_put_contents($temporaryFileName, $out);
                                        $file = $saveFolder->addFile($temporaryFileName, $dlFile, 'replace');
                                        $file = $this->getIndexerService()->indexFile($file);
+                                       if ($saveFilesOutsideExportFile) {
+                                               $filesFolderName = $dlFile . '.files';
+                                               $filesFolder = $saveFolder->createFolder($filesFolderName);
+                                               $temporaryFolderForExport = ResourceFactory::getInstance()->retrieveFileOrFolderObject($this->export->getTemporaryFilesPathForExport());
+                                               $temporaryFilesForExport = $temporaryFolderForExport->getFiles();
+                                               foreach ($temporaryFilesForExport as $temporaryFileForExport) {
+                                                       $filesFolder->getStorage()->moveFile($temporaryFileForExport, $filesFolder);
+                                               }
+                                               $temporaryFolderForExport->delete();
+                                       }
+
                                        $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('exportdata_savedFile'), sprintf($GLOBALS['LANG']->getLL('exportdata_savedInSBytes', TRUE), $file->getPublicUrl(), GeneralUtility::formatSize(strlen($out))), 0, 1);
                                } else {
                                        $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('exportdata_problemsSavingFile'), sprintf($GLOBALS['LANG']->getLL('exportdata_badPathS', TRUE), $this->getTemporaryFolderPath()), 0, 1, 2);
@@ -694,6 +711,20 @@ class ImportExportController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                                        <td><input type="checkbox" name="tx_impexp[excludeHTMLfileResources]" id="checkExcludeHTMLfileResources" value="1"'
                                                . ($inData['excludeHTMLfileResources'] ? ' checked="checked"' : '') . ' /></td>
                                </tr>';
+
+               // Files options
+               $row[] = '
+                       <tr class="tableheader bgColor5">
+                               <td colspan="2">' . $this->lang->getLL('makeadvanc_files', TRUE) . '</td>
+                       </tr>';
+                       $row[] = '
+                       <tr class="bgColor4">
+                               <td><label for="saveFilesOutsideExportFile"><strong>'
+                                       . $this->lang->getLL('makeadvanc_saveFilesOutsideExportFile', TRUE) . '</strong><br />'
+                                       . $this->lang->getLL('makeadvanc_saveFilesOutsideExportFile_limit', TRUE) . '</label></td>
+                               <td><input type="checkbox" name="tx_impexp[saveFilesOutsideExportFile]" id="saveFilesOutsideExportFile" value="1"'
+                                       . ($inData['saveFilesOutsideExportFile'] ? ' checked="checked"' : '') . ' /></td>
+                       </tr>';
                // Extensions
                $row[] = '
                        <tr class="tableheader bgColor5">
index 3460a85..e248e89 100644 (file)
@@ -399,6 +399,20 @@ class ImportExport {
         */
        protected $legacyImportMigrationRecords = array();
 
+       /**
+        * @var bool
+        */
+       protected $saveFilesOutsideExportFile = FALSE;
+
+       /**
+        * @var null|string
+        */
+       protected $temporaryFilesPathForExport = NULL;
+
+       /**
+        * @var null|string
+        */
+       protected $filesPathForImport = NULL;
 
        /**************************
         * Initialize
@@ -490,6 +504,17 @@ class ImportExport {
        }
 
        /**
+        * Option to enable having the files not included in the export file.
+        * The files are saved to a temporary folder instead.
+        *
+        * @param boolean $saveFilesOutsideExportFile
+        * @see getTemporaryFilesPathForExport()
+        */
+       public function setSaveFilesOutsideExportFile($saveFilesOutsideExportFile) {
+               $this->saveFilesOutsideExportFile = $saveFilesOutsideExportFile;
+       }
+
+       /**
         * Sets a thumbnail image to the exported file
         *
         * @param string $imgFilepath Filename reference, gif, jpg, png. Absolute path.
@@ -958,7 +983,12 @@ class ImportExport {
                        return;
                }
                try {
-                       $fileContent = $file->getContents();
+                       if (!$this->saveFilesOutsideExportFile) {
+                               $fileContent = $file->getContents();
+                       } else {
+                               $file->checkActionPermission('read');
+                       }
+
                } catch (\TYPO3\CMS\Core\Resource\Exception\InsufficientFileAccessPermissionsException $e) {
                        $this->error('File ' . $file->getPublicUrl() . ': ' . $e->getMessage());
                        return;
@@ -991,8 +1021,12 @@ class ImportExport {
                // Setting this data in the header
                $this->dat['header']['files_fal'][$fileId] = $fileRec;
 
-               // ... and finally add the heavy stuff:
-               $fileRec['content'] = $fileContent;
+               if (!$this->saveFilesOutsideExportFile) {
+                       // ... and finally add the heavy stuff:
+                       $fileRec['content'] = $fileContent;
+               } else {
+                       GeneralUtility::upload_copy_move($file->getForLocalProcessing(FALSE), $this->getTemporaryFilesPathForExport() . $file->getProperty('sha1'));
+               }
                $fileRec['content_sha1'] = $fileSha1;
 
                $this->dat['files_fal'][$fileId] = $fileRec;
@@ -1034,9 +1068,14 @@ class ImportExport {
                                        }
                                        $this->dat['header']['records'][$refParts[0]][$refParts[1]]['filerefs'][] = $fI['ID'];
                                }
-                               // ... and finally add the heavy stuff:
-                               $fileRec['content'] = GeneralUtility::getUrl($fI['ID_absFile']);
-                               $fileRec['content_md5'] = md5($fileRec['content']);
+                               $fileMd5 = md5_file($fI['ID_absFile']);
+                               if (!$this->saveFilesOutsideExportFile) {
+                                       // ... and finally add the heavy stuff:
+                                       $fileRec['content'] = GeneralUtility::getUrl($fI['ID_absFile']);
+                               } else {
+                                       GeneralUtility::upload_copy_move($fI['ID_absFile'], $this->getTemporaryFilesPathForExport() . $fileMd5);
+                               }
+                               $fileRec['content_md5'] = $fileMd5;
                                $this->dat['files'][$fI['ID']] = $fileRec;
                                // For soft references, do further processing:
                                if ($recordRef === '_SOFTREF_') {
@@ -1054,9 +1093,14 @@ class ImportExport {
                                                        $this->dat['header']['files'][$fI['ID']]['RTE_ORIG_ID'] = $RTEoriginal_ID;
                                                        // Setting this data in the header
                                                        $this->dat['header']['files'][$RTEoriginal_ID] = $fileRec;
-                                                       // ... and finally add the heavy stuff:
-                                                       $fileRec['content'] = GeneralUtility::getUrl($RTEoriginal_absPath);
-                                                       $fileRec['content_md5'] = md5($fileRec['content']);
+                                                       $fileMd5 = md5_file($RTEoriginal_absPath);
+                                                       if (!$this->saveFilesOutsideExportFile) {
+                                                               // ... and finally add the heavy stuff:
+                                                               $fileRec['content'] = GeneralUtility::getUrl($RTEoriginal_absPath);
+                                                       } else {
+                                                               GeneralUtility::upload_copy_move($RTEoriginal_absPath, $this->getTemporaryFilesPathForExport() . $fileMd5);
+                                                       }
+                                                       $fileRec['content_md5'] = $fileMd5;
                                                        $this->dat['files'][$RTEoriginal_ID] = $fileRec;
                                                } else {
                                                        $this->error('RTE original file "' . \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($RTEoriginal_absPath) . '" was not found!');
@@ -1118,6 +1162,38 @@ class ImportExport {
        }
 
        /**
+        * If saveFilesOutsideExportFile is enabled, this function returns the path
+        * where the files referenced in the export are copied to.
+        *
+        * @return string
+        * @throws \RuntimeException
+        * @see setSaveFilesOutsideExportFile()
+        */
+       public function getTemporaryFilesPathForExport() {
+               if (!$this->saveFilesOutsideExportFile) {
+                       throw new \RuntimeException('You need to set saveFilesOutsideExportFile to TRUE before you want to get the temporary files path for export.', 1401205213);
+               }
+               if ($this->temporaryFilesPathForExport === NULL) {
+                       $temporaryFolderName = $this->getTemporaryFolderName();
+                       $this->temporaryFilesPathForExport = $temporaryFolderName . '/';
+               }
+               return $this->temporaryFilesPathForExport;
+       }
+
+       /**
+        *
+        * @return string
+        */
+       protected function getTemporaryFolderName() {
+               $temporaryPath = PATH_site . 'typo3temp/';
+               do {
+                       $temporaryFolderName = $temporaryPath . 'export_temp_files_' . mt_rand(1, PHP_INT_MAX);
+               } while (is_dir($temporaryFolderName));
+               GeneralUtility::mkdir($temporaryFolderName);
+               return $temporaryFolderName;
+       }
+
+       /**
         * DB relations flattend to 1-dim array.
         * The list will be unique, no table/uid combination will appear twice.
         *
@@ -1526,12 +1602,22 @@ class ImportExport {
                foreach (array_keys($this->dat['header']['records']['sys_file']) as $sysFileUid) {
                        $fileRecord = $this->dat['records']['sys_file:' . $sysFileUid]['data'];
 
+                       $temporaryFile = NULL;
+                       // check if there is the right file already in the local folder
+                       if ($this->filesPathForImport !== NULL) {
+                               if (is_file($this->filesPathForImport . '/' . $fileRecord['sha1']) && sha1_file($this->filesPathForImport . '/' . $fileRecord['sha1']) === $fileRecord['sha1']) {
+                                       $temporaryFile = $this->filesPathForImport . '/' . $fileRecord['sha1'];
+                               }
+                       }
+
                        // save file to disk
-                       $fileId = md5($fileRecord['storage'] . ':' . $fileRecord['identifier_hash']);
-                       $temporaryFile = $this->writeTemporaryFileFromData($fileId);
                        if ($temporaryFile === NULL) {
-                               // error on writing the file. Error message was already added
-                               continue;
+                               $fileId = md5($fileRecord['storage'] . ':' . $fileRecord['identifier_hash']);
+                               $temporaryFile = $this->writeTemporaryFileFromData($fileId);
+                               if ($temporaryFile === NULL) {
+                                       // error on writing the file. Error message was already added
+                                       continue;
+                               }
                        }
 
                        $originalStorageUid = $fileRecord['storage'];
@@ -2249,8 +2335,18 @@ class ImportExport {
         */
        public function import_addFileNameToBeCopied($fI) {
                if (is_array($this->dat['files'][$fI['ID']])) {
-                       $tmpFile = GeneralUtility::tempnam('import_temp_');
-                       GeneralUtility::writeFile($tmpFile, $this->dat['files'][$fI['ID']]['content']);
+                       $tmpFile = NULL;
+                       // check if there is the right file already in the local folder
+                       if ($this->filesPathForImport !== NULL) {
+                               if (is_file($this->filesPathForImport . '/' . $this->dat['files'][$fI['ID']]['content_md5']) &&
+                                       md5_file($this->filesPathForImport . '/' . $this->dat['files'][$fI['ID']]['content_md5']) === $this->dat['files'][$fI['ID']]['content_md5']) {
+                                       $tmpFile = $this->filesPathForImport . '/' . $this->dat['files'][$fI['ID']]['content_md5'];
+                               }
+                       }
+                       if ($tmpFile === NULL) {
+                               $tmpFile = GeneralUtility::tempnam('import_temp_');
+                               GeneralUtility::writeFile($tmpFile, $this->dat['files'][$fI['ID']]['content']);
+                       }
                        clearstatcache();
                        if (@is_file($tmpFile)) {
                                $this->unlinkFiles[] = $tmpFile;
@@ -2978,6 +3074,16 @@ class ImportExport {
        public function loadFile($filename, $all = 0) {
                if (@is_file($filename)) {
                        $fI = pathinfo($filename);
+                       if (@is_dir($filename . '.files')) {
+                               if (GeneralUtility::isAllowedAbsPath($filename . '.files')) {
+                                       // copy the folder lowlevel to typo3temp, because the files would be deleted after import
+                                       $temporaryFolderName = $this->getTemporaryFolderName();
+                                       GeneralUtility::copyDirectory($filename . '.files', $temporaryFolderName);
+                                       $this->filesPathForImport = $temporaryFolderName;
+                               } else {
+                                       $this->error('External import files for the given import source is currently not supported.');
+                               }
+                       }
                        if (strtolower($fI['extension']) == 'xml') {
                                // XML:
                                $xmlContent = GeneralUtility::getUrl($filename);
index 88c684a..e2ccdeb 100644 (file)
@@ -63,6 +63,36 @@ class ExportTest extends \TYPO3\CMS\Impexp\Tests\Functional\Export\AbstractExpor
         */
        public function exportGroupFileAndFileReferenceItem() {
 
+               $this->compileExportGroupFileAndFileReferenceItem();
+
+               $out = $this->export->compileMemoryToFileContent('xml');
+
+               $this->assertXmlStringEqualsXmlFile(__DIR__ . '/../../Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item.xml', $out);
+       }
+
+       /**
+        * @test
+        */
+       public function exportGroupFileAndFileReferenceItemButImagesNotIncluded() {
+
+               $this->export->setSaveFilesOutsideExportFile(TRUE);
+
+               $this->compileExportGroupFileAndFileReferenceItem();
+
+               $out = $this->export->compileMemoryToFileContent('xml');
+
+               $this->assertXmlStringEqualsXmlFile(__DIR__ . '/../../Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml', $out);
+
+               $temporaryFilesDirectory = $this->export->getTemporaryFilesPathForExport();
+               $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/uploads/tx_impexpgroupfiles/typo3_image4.jpg', $temporaryFilesDirectory . 'e1c5c4e1e34e19e2facb438752e06c3f');
+               $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image5.jpg', $temporaryFilesDirectory . 'c3511df85d21bc578faf71c6a19eeb3ff44af370');
+       }
+
+
+
+
+       protected function compileExportGroupFileAndFileReferenceItem() {
+
                $this->export->setRecordTypesIncludeFields(
                        array(
                                'pages' => array(
@@ -137,9 +167,6 @@ class ExportTest extends \TYPO3\CMS\Impexp\Tests\Functional\Export\AbstractExpor
                $this->export->export_addFilesFromRelations();
                $this->export->export_addFilesFromSysFilesRecords();
 
-               $out = $this->export->compileMemoryToFileContent('xml');
-
-               $this->assertXmlStringEqualsXmlFile(__DIR__ . '/../../Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item.xml', $out);
        }
 
 }
\ No newline at end of file
index 3bc722f..d5b3fd5 100644 (file)
@@ -87,6 +87,26 @@ class ExportTest extends \TYPO3\CMS\Impexp\Tests\Functional\Export\AbstractExpor
                $this->assertXmlStringEqualsXmlFile(__DIR__ . '/../../Fixtures/ImportExportXml/pages-and-ttcontent-with-image.xml', $out);
        }
 
+       /**
+        * @test
+        */
+       public function exportPagesAndRelatedTtContentWithImagesButNotIncluded() {
+
+               $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file.xml');
+
+               $this->export->setSaveFilesOutsideExportFile(TRUE);
+
+               $this->compileExportPagesAndRelatedTtContentWithImages();
+
+               $out = $this->export->compileMemoryToFileContent('xml');
+
+               $this->assertXmlStringEqualsXmlFile(__DIR__ . '/../../Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml', $out);
+
+               $temporaryFilesDirectory = $this->export->getTemporaryFilesPathForExport();
+               $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', $temporaryFilesDirectory . 'da9acdf1e105784a57bbffec9520969578287797');
+
+       }
+
        protected function compileExportPagesAndRelatedTtContentWithImages() {
 
                $this->export->setRecordTypesIncludeFields(
diff --git a/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml
new file mode 100644 (file)
index 0000000..dcdb5ae
--- /dev/null
@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3RecordDocument>
+       <header type="array">
+               <records type="array">
+                       <table index="pages" type="array">
+                               <rec index="1" type="array">
+                                       <uid>1</uid>
+                                       <pid>0</pid>
+                                       <title>Root</title>
+                                       <size>162</size>
+                                       <relations index="rels" type="array">
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                               </rec>
+                       </table>
+                       <table index="tx_impexpgroupfiles_item" type="array">
+                               <rec index="1" type="array">
+                                       <uid>1</uid>
+                                       <pid>1</pid>
+                                       <title>Test item</title>
+                                       <size>220</size>
+                                       <relations index="rels" type="array">
+                                               <element index="sys_file:3" type="array">
+                                                       <table>sys_file</table>
+                                                       <id>3</id>
+                                               </element>
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                                       <filerefs type="array">
+                                               <file index="0">66a2b7534be9ebf810cd55164c5f085d</file>
+                                       </filerefs>
+                               </rec>
+                       </table>
+                       <table index="sys_file" type="array">
+                               <rec index="3" type="array">
+                                       <uid>3</uid>
+                                       <pid>0</pid>
+                                       <title>typo3_image5.jpg</title>
+                                       <size>558</size>
+                                       <relationLevel>1</relationLevel>
+                                       <relations index="rels" type="array">
+                                               <element index="sys_file_storage:1" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file_storage</table>
+                                               </element>
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                               </rec>
+                       </table>
+                       <table index="sys_file_storage" type="array">
+                               <rec index="1" type="array">
+                                       <uid>1</uid>
+                                       <pid>0</pid>
+                                       <title>fileadmin/ (auto-created)</title>
+                                       <size>722</size>
+                                       <relationLevel>2</relationLevel>
+                                       <relations index="rels" type="array">
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                               </rec>
+                       </table>
+               </records>
+               <pid_lookup type="array">
+                       <page_contents index="0" type="array">
+                               <table index="pages" type="array">
+                                       <item index="1">1</item>
+                               </table>
+                               <table index="sys_file" type="array">
+                                       <item index="3">1</item>
+                               </table>
+                               <table index="sys_file_storage" type="array">
+                                       <item index="1">1</item>
+                               </table>
+                       </page_contents>
+                       <page_contents index="1" type="array">
+                               <table index="tx_impexpgroupfiles_item" type="array">
+                                       <item index="1">1</item>
+                               </table>
+                       </page_contents>
+               </pid_lookup>
+               <pagetree type="array">
+                       <node index="1" type="array">
+                               <uid>1</uid>
+                       </node>
+               </pagetree>
+               <files type="array">
+                       <file index="66a2b7534be9ebf810cd55164c5f085d" type="array">
+                               <filesize>6758</filesize>
+                               <filename>typo3_image4.jpg</filename>
+                               <filemtime>1393866824</filemtime>
+                               <relFileRef>uploads/tx_impexpgroupfiles/typo3_image4.jpg</relFileRef>
+                               <record_ref>tx_impexpgroupfiles_item:1/images</record_ref>
+                       </file>
+               </files>
+               <files_fal type="array">
+                       <file index="23116a2a95820388bb7eede903382d4c" type="array">
+                               <filesize>7425</filesize>
+                               <filename>typo3_image5.jpg</filename>
+                               <filemtime>1393432183</filemtime>
+                       </file>
+               </files_fal>
+       </header>
+       <records type="array">
+               <tablerow index="pages:1" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">1</field>
+                               <field index="pid">0</field>
+                               <field index="deleted">0</field>
+                               <field index="perms_everybody">15</field>
+                               <field index="hidden">0</field>
+                               <field index="title">Root</field>
+                               <field index="doktype">1</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                       </related>
+               </tablerow>
+               <tablerow index="tx_impexpgroupfiles_item:1" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">1</field>
+                               <field index="pid">1</field>
+                               <field index="deleted">0</field>
+                               <field index="hidden">0</field>
+                               <field index="title">Test item</field>
+                               <field index="images">typo3_image4.jpg</field>
+                               <field index="image_references">fileadmin/user_upload/typo3_image5.jpg</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                               <field index="images" type="array">
+                                       <type>file</type>
+                                       <filerefs index="newValueFiles" type="array">
+                                               <file index="0" type="array">
+                                                       <filename>typo3_image4.jpg</filename>
+                                                       <ID>66a2b7534be9ebf810cd55164c5f085d</ID>
+                                               </file>
+                                       </filerefs>
+                               </field>
+                               <field index="image_references" type="array">
+                                       <type>db</type>
+                                       <relations index="itemArray" type="array">
+                                               <element index="0" type="array">
+                                                       <table>sys_file</table>
+                                                       <id>3</id>
+                                               </element>
+                                       </relations>
+                               </field>
+                       </related>
+               </tablerow>
+               <tablerow index="sys_file:3" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">3</field>
+                               <field index="pid">0</field>
+                               <field index="storage">1</field>
+                               <field index="type">2</field>
+                               <field index="metadata">0</field>
+                               <field index="identifier">/user_upload/typo3_image5.jpg</field>
+                               <field index="identifier_hash">8180e85d25c96697ec9d2004683216831b91ffc1</field>
+                               <field index="folder_hash">19669f1e02c2f16705ec7587044c66443be70725</field>
+                               <field index="extension">jpg</field>
+                               <field index="mime_type">image/jpeg</field>
+                               <field index="name">typo3_image5.jpg</field>
+                               <field index="sha1">c3511df85d21bc578faf71c6a19eeb3ff44af370</field>
+                               <field index="size">7425</field>
+                               <field index="creation_date">1393432184</field>
+                               <field index="modification_date">1393432183</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                               <field index="storage" type="array">
+                                       <type>db</type>
+                                       <relations index="itemArray" type="array">
+                                               <element index="0" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file_storage</table>
+                                               </element>
+                                       </relations>
+                               </field>
+                       </related>
+               </tablerow>
+               <tablerow index="sys_file_storage:1" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">1</field>
+                               <field index="pid">0</field>
+                               <field index="name">fileadmin/ (auto-created)</field>
+                               <field index="description" type="NULL"></field>
+                               <field index="driver">Local</field>
+                               <field index="configuration">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; standalone=&quot;yes&quot; ?&gt;
+&lt;T3FlexForms&gt;
+       &lt;data&gt;
+               &lt;sheet index=&quot;sDEF&quot;&gt;
+                       &lt;language index=&quot;lDEF&quot;&gt;
+                               &lt;field index=&quot;basePath&quot;&gt;
+                                       &lt;value index=&quot;vDEF&quot;&gt;fileadmin/&lt;/value&gt;
+                               &lt;/field&gt;
+                               &lt;field index=&quot;pathType&quot;&gt;
+                                       &lt;value index=&quot;vDEF&quot;&gt;relative&lt;/value&gt;
+                               &lt;/field&gt;
+                               &lt;field index=&quot;caseSensitive&quot;&gt;
+                                       &lt;value index=&quot;vDEF&quot;&gt;1&lt;/value&gt;
+                               &lt;/field&gt;
+                       &lt;/language&gt;
+               &lt;/sheet&gt;
+       &lt;/data&gt;
+&lt;/T3FlexForms&gt;</field>
+                               <field index="is_default">0</field>
+                               <field index="is_browsable">1</field>
+                               <field index="is_public">1</field>
+                               <field index="is_writable">1</field>
+                               <field index="is_online">1</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                               <field index="configuration" type="array">
+                                       <type>flex</type>
+                                       <flexform index="flexFormRels" type="array">
+                                               <db_relations index="db" type="array">
+                                               </db_relations>
+                                               <file_relations index="file" type="array">
+                                               </file_relations>
+                                               <softref_relations index="softrefs" type="array">
+                                               </softref_relations>
+                                       </flexform>
+                               </field>
+                       </related>
+               </tablerow>
+       </records>
+       <files type="array">
+               <file index="66a2b7534be9ebf810cd55164c5f085d" type="array">
+                       <filesize>6758</filesize>
+                       <filename>typo3_image4.jpg</filename>
+                       <filemtime>1393866824</filemtime>
+                       <relFileRef>uploads/tx_impexpgroupfiles/typo3_image4.jpg</relFileRef>
+                       <record_ref>tx_impexpgroupfiles_item:1/images</record_ref>
+                       <content_md5>e1c5c4e1e34e19e2facb438752e06c3f</content_md5>
+               </file>
+       </files>
+       <files_fal type="array">
+               <file index="23116a2a95820388bb7eede903382d4c" type="array">
+                       <filesize>7425</filesize>
+                       <filename>typo3_image5.jpg</filename>
+                       <filemtime>1393432183</filemtime>
+                       <content_sha1>c3511df85d21bc578faf71c6a19eeb3ff44af370</content_sha1>
+               </file>
+       </files_fal>
+</T3RecordDocument>
\ No newline at end of file
diff --git a/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml.files/c3511df85d21bc578faf71c6a19eeb3ff44af370 b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml.files/c3511df85d21bc578faf71c6a19eeb3ff44af370
new file mode 100644 (file)
index 0000000..5806162
Binary files /dev/null and b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml.files/c3511df85d21bc578faf71c6a19eeb3ff44af370 differ
diff --git a/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml.files/e1c5c4e1e34e19e2facb438752e06c3f b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml.files/e1c5c4e1e34e19e2facb438752e06c3f
new file mode 100644 (file)
index 0000000..2e0a9b6
Binary files /dev/null and b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml.files/e1c5c4e1e34e19e2facb438752e06c3f differ
diff --git a/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml
new file mode 100644 (file)
index 0000000..473cd1e
--- /dev/null
@@ -0,0 +1,492 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3RecordDocument>
+       <header type="array">
+               <records type="array">
+                       <table index="pages" type="array">
+                               <rec index="1" type="array">
+                                       <uid>1</uid>
+                                       <pid>0</pid>
+                                       <title>Root</title>
+                                       <size>162</size>
+                                       <relations index="rels" type="array">
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                               </rec>
+                               <rec index="2" type="array">
+                                       <uid>2</uid>
+                                       <pid>1</pid>
+                                       <title>Dummy 1-2</title>
+                                       <size>167</size>
+                                       <relations index="rels" type="array">
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                               </rec>
+                       </table>
+                       <table index="tt_content" type="array">
+                               <rec index="1" type="array">
+                                       <uid>1</uid>
+                                       <pid>1</pid>
+                                       <title>Test content</title>
+                                       <size>220</size>
+                                       <relations index="rels" type="array">
+                                               <element index="sys_file_reference:1" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file_reference</table>
+                                               </element>
+                                               <element index="sys_file:1" type="array">
+                                                       <table>sys_file</table>
+                                                       <id>1</id>
+                                               </element>
+                                       </relations>
+                                       <softrefs type="array">
+                                               <softref_element index="header_link:typolink:2487ce518ed56d22f20f259928ff43f1:0" type="array">
+                                                       <field>header_link</field>
+                                                       <spKey>typolink</spKey>
+                                                       <matchString>file:1</matchString>
+                                                       <subst type="array">
+                                                               <type>db</type>
+                                                               <recordRef>sys_file:1</recordRef>
+                                                               <tokenID>2487ce518ed56d22f20f259928ff43f1</tokenID>
+                                                               <tokenValue>file:1</tokenValue>
+                                                       </subst>
+                                               </softref_element>
+                                       </softrefs>
+                               </rec>
+                       </table>
+                       <table index="sys_language" type="array">
+                               <rec index="1" type="array">
+                                       <uid>1</uid>
+                                       <pid>0</pid>
+                                       <title>Deutsch</title>
+                                       <size>109</size>
+                                       <relations index="rels" type="array">
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                               </rec>
+                       </table>
+                       <table index="sys_file_reference" type="array">
+                               <rec index="1" type="array">
+                                       <uid>1</uid>
+                                       <pid>1</pid>
+                                       <title>1</title>
+                                       <size>292</size>
+                                       <relations index="rels" type="array">
+                                               <element index="sys_file:1" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file</table>
+                                               </element>
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                               </rec>
+                       </table>
+                       <table index="sys_file" type="array">
+                               <rec index="1" type="array">
+                                       <uid>1</uid>
+                                       <pid>0</pid>
+                                       <title>typo3_image2.jpg</title>
+                                       <size>532</size>
+                                       <relationLevel>1</relationLevel>
+                                       <relations index="rels" type="array">
+                                               <element index="sys_file_storage:1" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file_storage</table>
+                                               </element>
+                                               <element index="sys_file_metadata:1" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file_metadata</table>
+                                               </element>
+                                               <element index="sys_file_metadata:2" type="array">
+                                                       <id>2</id>
+                                                       <table>sys_file_metadata</table>
+                                               </element>
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                               </rec>
+                       </table>
+                       <table index="sys_file_storage" type="array">
+                               <rec index="1" type="array">
+                                       <uid>1</uid>
+                                       <pid>0</pid>
+                                       <title>fileadmin/ (auto-created)</title>
+                                       <size>722</size>
+                                       <relationLevel>2</relationLevel>
+                                       <relations index="rels" type="array">
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                               </rec>
+                       </table>
+                       <table index="sys_file_metadata" type="array">
+                               <rec index="1" type="array">
+                                       <uid>1</uid>
+                                       <pid>0</pid>
+                                       <title>typo3_image2.jpg</title>
+                                       <size>294</size>
+                                       <relationLevel>2</relationLevel>
+                                       <relations index="rels" type="array">
+                                               <element index="sys_file:1" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file</table>
+                                               </element>
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                               </rec>
+                               <rec index="2" type="array">
+                                       <uid>2</uid>
+                                       <pid>0</pid>
+                                       <title>typo3_image2.jpg</title>
+                                       <size>291</size>
+                                       <relationLevel>2</relationLevel>
+                                       <relations index="rels" type="array">
+                                               <element index="sys_language:1" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_language</table>
+                                               </element>
+                                               <element index="sys_file_metadata:1" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file_metadata</table>
+                                               </element>
+                                               <element index="sys_file:1" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file</table>
+                                               </element>
+                                       </relations>
+                                       <softrefs type="array">
+                                       </softrefs>
+                               </rec>
+                       </table>
+               </records>
+               <pid_lookup type="array">
+                       <page_contents index="0" type="array">
+                               <table index="pages" type="array">
+                                       <item index="1">1</item>
+                               </table>
+                               <table index="sys_language" type="array">
+                                       <item index="1">1</item>
+                               </table>
+                               <table index="sys_file" type="array">
+                                       <item index="1">1</item>
+                               </table>
+                               <table index="sys_file_storage" type="array">
+                                       <item index="1">1</item>
+                               </table>
+                               <table index="sys_file_metadata" type="array">
+                                       <item index="1">1</item>
+                                       <item index="2">1</item>
+                               </table>
+                       </page_contents>
+                       <page_contents index="1" type="array">
+                               <table index="pages" type="array">
+                                       <item index="2">1</item>
+                               </table>
+                               <table index="tt_content" type="array">
+                                       <item index="1">1</item>
+                               </table>
+                               <table index="sys_file_reference" type="array">
+                                       <item index="1">1</item>
+                               </table>
+                       </page_contents>
+               </pid_lookup>
+               <pagetree type="array">
+                       <node index="1" type="array">
+                               <uid>1</uid>
+                               <node index="subrow" type="array">
+                                       <node index="2" type="array">
+                                               <uid>2</uid>
+                                       </node>
+                               </node>
+                       </node>
+               </pagetree>
+               <files_fal type="array">
+                       <file index="4a705ca3ef43b53dc00de861ba2c86af" type="array">
+                               <filesize>7958</filesize>
+                               <filename>typo3_image2.jpg</filename>
+                               <filemtime>1389878273</filemtime>
+                       </file>
+               </files_fal>
+       </header>
+       <records type="array">
+               <tablerow index="pages:1" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">1</field>
+                               <field index="pid">0</field>
+                               <field index="deleted">0</field>
+                               <field index="perms_everybody">15</field>
+                               <field index="hidden">0</field>
+                               <field index="title">Root</field>
+                               <field index="doktype">1</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                       </related>
+               </tablerow>
+               <tablerow index="pages:2" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">2</field>
+                               <field index="pid">1</field>
+                               <field index="deleted">0</field>
+                               <field index="perms_everybody">15</field>
+                               <field index="hidden">0</field>
+                               <field index="title">Dummy 1-2</field>
+                               <field index="doktype">1</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                       </related>
+               </tablerow>
+               <tablerow index="tt_content:1" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">1</field>
+                               <field index="pid">1</field>
+                               <field index="t3ver_oid">0</field>
+                               <field index="hidden">0</field>
+                               <field index="CType">textpic</field>
+                               <field index="header">Test content</field>
+                               <field index="image">1</field>
+                               <field index="deleted">0</field>
+                               <field index="header_link">file:1</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                               <field index="image" type="array">
+                                       <type>db</type>
+                                       <relations index="itemArray" type="array">
+                                               <element index="0" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file_reference</table>
+                                               </element>
+                                       </relations>
+                               </field>
+                               <field index="header_link" type="array">
+                                       <type>db</type>
+                                       <relations index="itemArray" type="array">
+                                               <element index="0" type="array">
+                                                       <table>sys_file</table>
+                                                       <id>1</id>
+                                               </element>
+                                       </relations>
+                                       <softrefs type="array">
+                                               <keys type="array">
+                                                       <softref_key index="typolink" type="array">
+                                                               <softref_element index="2487ce518ed56d22f20f259928ff43f1:0" type="array">
+                                                                       <matchString>file:1</matchString>
+                                                                       <subst type="array">
+                                                                               <type>db</type>
+                                                                               <recordRef>sys_file:1</recordRef>
+                                                                               <tokenID>2487ce518ed56d22f20f259928ff43f1</tokenID>
+                                                                               <tokenValue>file:1</tokenValue>
+                                                                       </subst>
+                                                               </softref_element>
+                                                       </softref_key>
+                                               </keys>
+                                               <tokenizedContent>{softref:2487ce518ed56d22f20f259928ff43f1}</tokenizedContent>
+                                       </softrefs>
+                               </field>
+                       </related>
+               </tablerow>
+               <tablerow index="sys_language:1" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">1</field>
+                               <field index="pid">0</field>
+                               <field index="hidden">0</field>
+                               <field index="title">Deutsch</field>
+                               <field index="flag">de</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                       </related>
+               </tablerow>
+               <tablerow index="sys_file_reference:1" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">1</field>
+                               <field index="pid">1</field>
+                               <field index="uid_local">1</field>
+                               <field index="uid_foreign">1</field>
+                               <field index="tablenames">tt_content</field>
+                               <field index="fieldname">image</field>
+                               <field index="sorting_foreign">0</field>
+                               <field index="table_local">sys_file</field>
+                               <field index="title" type="NULL"></field>
+                               <field index="description" type="NULL"></field>
+                               <field index="alternative" type="NULL"></field>
+                               <field index="link" type="NULL"></field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                               <field index="uid_local" type="array">
+                                       <type>db</type>
+                                       <relations index="itemArray" type="array">
+                                               <element index="0" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file</table>
+                                               </element>
+                                       </relations>
+                               </field>
+                       </related>
+               </tablerow>
+               <tablerow index="sys_file:1" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">1</field>
+                               <field index="pid">0</field>
+                               <field index="storage">1</field>
+                               <field index="type">2</field>
+                               <field index="metadata">0</field>
+                               <field index="identifier">/user_upload/typo3_image2.jpg</field>
+                               <field index="identifier_hash">f90bb9a35622f35b5279195e324eddbaec8164b2</field>
+                               <field index="folder_hash">19669f1e02c2f16705ec7587044c66443be70725</field>
+                               <field index="mime_type">image/jpeg</field>
+                               <field index="name">typo3_image2.jpg</field>
+                               <field index="sha1">da9acdf1e105784a57bbffec9520969578287797</field>
+                               <field index="size">7958</field>
+                               <field index="creation_date">1389878273</field>
+                               <field index="modification_date">1389878273</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                               <field index="storage" type="array">
+                                       <type>db</type>
+                                       <relations index="itemArray" type="array">
+                                               <element index="0" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file_storage</table>
+                                               </element>
+                                       </relations>
+                               </field>
+                               <field index="metadata" type="array">
+                                       <type>db</type>
+                                       <relations index="itemArray" type="array">
+                                               <element index="0" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file_metadata</table>
+                                               </element>
+                                               <element index="1" type="array">
+                                                       <id>2</id>
+                                                       <table>sys_file_metadata</table>
+                                               </element>
+                                       </relations>
+                               </field>
+                       </related>
+               </tablerow>
+               <tablerow index="sys_file_storage:1" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">1</field>
+                               <field index="pid">0</field>
+                               <field index="name">fileadmin/ (auto-created)</field>
+                               <field index="description" type="NULL"></field>
+                               <field index="driver">Local</field>
+                               <field index="configuration">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; standalone=&quot;yes&quot; ?&gt;
+&lt;T3FlexForms&gt;
+       &lt;data&gt;
+               &lt;sheet index=&quot;sDEF&quot;&gt;
+                       &lt;language index=&quot;lDEF&quot;&gt;
+                               &lt;field index=&quot;basePath&quot;&gt;
+                                       &lt;value index=&quot;vDEF&quot;&gt;fileadmin/&lt;/value&gt;
+                               &lt;/field&gt;
+                               &lt;field index=&quot;pathType&quot;&gt;
+                                       &lt;value index=&quot;vDEF&quot;&gt;relative&lt;/value&gt;
+                               &lt;/field&gt;
+                               &lt;field index=&quot;caseSensitive&quot;&gt;
+                                       &lt;value index=&quot;vDEF&quot;&gt;1&lt;/value&gt;
+                               &lt;/field&gt;
+                       &lt;/language&gt;
+               &lt;/sheet&gt;
+       &lt;/data&gt;
+&lt;/T3FlexForms&gt;</field>
+                               <field index="is_default">0</field>
+                               <field index="is_browsable">1</field>
+                               <field index="is_public">1</field>
+                               <field index="is_writable">1</field>
+                               <field index="is_online">1</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                               <field index="configuration" type="array">
+                                       <type>flex</type>
+                                       <flexform index="flexFormRels" type="array">
+                                               <db_relations index="db" type="array">
+                                               </db_relations>
+                                               <file_relations index="file" type="array">
+                                               </file_relations>
+                                               <softref_relations index="softrefs" type="array">
+                                               </softref_relations>
+                                       </flexform>
+                               </field>
+                       </related>
+               </tablerow>
+               <tablerow index="sys_file_metadata:1" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">1</field>
+                               <field index="pid">0</field>
+                               <field index="sys_language_uid">0</field>
+                               <field index="l10n_parent">0</field>
+                               <field index="file">1</field>
+                               <field index="title">Dummy image</field>
+                               <field index="width">400</field>
+                               <field index="height">300</field>
+                               <field index="description">This is a dummy image.</field>
+                               <field index="alternative">Photo of program code</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                               <field index="file" type="array">
+                                       <type>db</type>
+                                       <relations index="itemArray" type="array">
+                                               <element index="0" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file</table>
+                                               </element>
+                                       </relations>
+                               </field>
+                       </related>
+               </tablerow>
+               <tablerow index="sys_file_metadata:2" type="array">
+                       <fieldlist index="data" type="array">
+                               <field index="uid">2</field>
+                               <field index="pid">0</field>
+                               <field index="sys_language_uid">1</field>
+                               <field index="l10n_parent">1</field>
+                               <field index="file">1</field>
+                               <field index="title">Beispiel Bild</field>
+                               <field index="width">0</field>
+                               <field index="height">0</field>
+                               <field index="description">Nur ein Beispielbild.</field>
+                               <field index="alternative">Foto von Programmcode</field>
+                       </fieldlist>
+                       <related index="rels" type="array">
+                               <field index="sys_language_uid" type="array">
+                                       <type>db</type>
+                                       <relations index="itemArray" type="array">
+                                               <element index="0" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_language</table>
+                                               </element>
+                                       </relations>
+                               </field>
+                               <field index="l10n_parent" type="array">
+                                       <type>db</type>
+                                       <relations index="itemArray" type="array">
+                                               <element index="0" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file_metadata</table>
+                                               </element>
+                                       </relations>
+                               </field>
+                               <field index="file" type="array">
+                                       <type>db</type>
+                                       <relations index="itemArray" type="array">
+                                               <element index="0" type="array">
+                                                       <id>1</id>
+                                                       <table>sys_file</table>
+                                               </element>
+                                       </relations>
+                               </field>
+                       </related>
+               </tablerow>
+       </records>
+       <files_fal type="array">
+               <file index="4a705ca3ef43b53dc00de861ba2c86af" type="array">
+                       <filesize>7958</filesize>
+                       <filename>typo3_image2.jpg</filename>
+                       <filemtime>1389878273</filemtime>
+                       <content_sha1>da9acdf1e105784a57bbffec9520969578287797</content_sha1>
+               </file>
+       </files_fal>
+</T3RecordDocument>
diff --git a/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml.files/da9acdf1e105784a57bbffec9520969578287797 b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml.files/da9acdf1e105784a57bbffec9520969578287797
new file mode 100644 (file)
index 0000000..bfb572b
Binary files /dev/null and b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml.files/da9acdf1e105784a57bbffec9520969578287797 differ
index 43907e4..9ccecf3 100644 (file)
@@ -63,4 +63,18 @@ class ImportInEmptyDatabaseTest extends \TYPO3\CMS\Impexp\Tests\Functional\Impor
                $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/uploads/tx_impexpgroupfiles/typo3_image4.jpg', PATH_site . 'uploads/tx_impexpgroupfiles/typo3_image4.jpg');
        }
 
+       /**
+        * @test
+        */
+       public function importGroupFileAndFileReferenceItemButImagesNotIncluded() {
+
+               $this->import->loadFile(PATH_site . 'typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-but-images-not-included.xml', 1);
+               $this->import->importData(0);
+
+               $this->assertAssertionDataSet('importGroupFileAndFileReferenceItem');
+
+               $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image5.jpg', PATH_site . 'fileadmin/user_upload/typo3_image5.jpg');
+               $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/uploads/tx_impexpgroupfiles/typo3_image4.jpg', PATH_site . 'uploads/tx_impexpgroupfiles/typo3_image4.jpg');
+       }
+
 }
\ No newline at end of file
diff --git a/typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/importPagesAndRelatedTtContentWithImagesButNotIncluded.csv b/typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/importPagesAndRelatedTtContentWithImagesButNotIncluded.csv
new file mode 100644 (file)
index 0000000..2ce4d74
--- /dev/null
@@ -0,0 +1,23 @@
+"pages"
+,"uid","pid","sorting","deleted","title"
+,1,0,256,0,"Root"
+,2,1,256,0,"Dummy 1-2"
+"tt_content"
+,"uid","pid","sorting","deleted","header","header_link","image"
+,1,1,256,0,"Test content","file:1",1
+"sys_language"
+,"uid","pid","hidden","title","flag"
+,1,0,0,Deutsch,de
+"sys_file_storage"
+,"uid","pid","name","driver",
+,1,0,"fileadmin/ (auto-created)","Local"
+"sys_file"
+,"uid","pid","storage","type","identifier","identifier_hash","folder_hash","extension","mime_type","name","sha1","size"
+,1,0,1,2,"/user_upload/typo3_image2.jpg","f90bb9a35622f35b5279195e324eddbaec8164b2","19669f1e02c2f16705ec7587044c66443be70725","jpg","image/jpeg","typo3_image2.jpg","da9acdf1e105784a57bbffec9520969578287797","7958"
+"sys_file_reference"
+,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","table_local","title","description","alternative","link"
+,1,1,1,1,"tt_content","image","sys_file",\NULL,\NULL,\NULL,""
+"sys_file_metadata"
+,"uid","pid","file","title","width","height","description","alternative","sys_language_uid","l10n_parent"
+,1,0,1,Dummy image,400,300,"This is a dummy image.","Photo of program code",0,0
+,2,0,1,Beispiel Bild,0,0,"Nur ein Beispielbild.","Foto von Programmcode",1,1
index 8647d7c..e6693cd 100644 (file)
@@ -33,6 +33,8 @@ class ImportInEmptyDatabaseTest extends \TYPO3\CMS\Impexp\Tests\Functional\Impor
 
        protected $assertionDataSetDirectory = 'typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/';
 
+
+
        /**
         * @test
         */
@@ -113,4 +115,18 @@ class ImportInEmptyDatabaseTest extends \TYPO3\CMS\Impexp\Tests\Functional\Impor
                $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image3.jpg', PATH_site . 'fileadmin/user_upload/folder_with_spaces/typo3_image3.jpg');
        }
 
+       /**
+        * @test
+        */
+       public function importPagesAndRelatedTtContentWithImagesButNotIncluded() {
+
+               $this->import->loadFile(PATH_site . 'typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml', 1);
+               $this->import->importData(0);
+
+               $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesButNotIncluded');
+
+               $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
+       }
+
+
 }
\ No newline at end of file
index ad5fa52..f0176ad 100644 (file)
                        <trans-unit id="makeadvanc_excludeHtmlCssFile" xml:space="preserve">
                                <source>Exclude HTML/CSS file resources:</source>
                        </trans-unit>
+                       <trans-unit id="makeadvanc_files" xml:space="preserve">
+                               <source>Files:</source>
+                       </trans-unit>
+                       <trans-unit id="makeadvanc_saveFilesOutsideExportFile" xml:space="preserve">
+                               <source>Save files in extra folder beside the export file:</source>
+                       </trans-unit>
+                       <trans-unit id="makeadvanc_saveFilesOutsideExportFile_limit" xml:space="preserve">
+                               <source>(supported for "Save to filename" only)</source>
+                       </trans-unit>
                        <trans-unit id="makeadvanc_extensionDependencies" xml:space="preserve">
                                <source>Extension dependencies:</source>
                        </trans-unit>