[BUGFIX] Re-enable export of multiple records via clipboard 87/35887/5
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 8 Jan 2015 08:43:17 +0000 (09:43 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 9 Oct 2015 12:07:45 +0000 (14:07 +0200)
The change of #57873 introduced a regression which doesn't allow
the export of multiple records via the clipboard module anymore.

The wrong parameter generation is fixed with this patch.

Resolves: #59180
Releases: master
Change-Id: Iffa9e0ec4b816903bd935c65e5f9ba7230695802
Reviewed-on: http://review.typo3.org/35887
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/backend/Classes/Clipboard/Clipboard.php
typo3/sysext/impexp/Classes/Controller/ImportExportController.php

index b3dce77..234c7b0 100644 (file)
@@ -748,7 +748,7 @@ class Clipboard
         // Init
         $pad = $this->current;
         $params = array();
-        $params['tx_impexp[action]'] = 'export';
+        $params['tx_impexp']['action'] = 'export';
         // Traverse items:
         if (is_array($this->clipData[$pad]['el'])) {
             foreach ($this->clipData[$pad]['el'] as $k => $v) {
@@ -757,13 +757,13 @@ class Clipboard
                     // Rendering files/directories on the clipboard
                     if ($table == '_FILE') {
                         if (file_exists($v) && GeneralUtility::isAllowedAbsPath($v)) {
-                            $params['tx_impexp[' . (is_dir($v) ? 'dir' : 'file') . '][]'] = $v;
+                            $params['tx_impexp'][is_dir($v) ? 'dir' : 'file'][] = $v;
                         }
                     } else {
                         // Rendering records:
                         $rec = BackendUtility::getRecord($table, $uid);
                         if (is_array($rec)) {
-                            $params['tx_impexp[record][]'] = $table . ':' . $uid;
+                            $params['tx_impexp']['record'][] = $table . ':' . $uid;
                         }
                     }
                 }
index 03249be..3848c7c 100644 (file)
@@ -666,12 +666,14 @@ class ImportExportController extends \TYPO3\CMS\Backend\Module\BaseScriptClass
                 $rUid = $rParts[1];
                 $nameSuggestion .= $tName . '_' . $rUid;
                 $rec = BackendUtility::getRecordWSOL($tName, $rUid);
-                $row[] = '
-                               <tr class="bgColor4">
-                                       <td><strong>' . $this->lang->getLL('makeconfig_record', true) . '</strong></td>
-                                       <td>' . $this->iconFactory->getIconForRecord($tName, $rec, Icon::SIZE_SMALL)->render() . BackendUtility::getRecordTitle($tName, $rec, true)
-                        . '<input type="hidden" name="tx_impexp[record][]" value="' . htmlspecialchars(($tName . ':' . $rUid)) . '" /></td>
-                               </tr>';
+                if (!empty($rec)) {
+                    $row[] = '
+                                       <tr class="bgColor4">
+                                               <td><strong>' . $this->lang->getLL('makeconfig_record', true) . '</strong></td>
+                                               <td>' . $this->iconFactory->getIconForRecord($tName, $rec, Icon::SIZE_SMALL)->render() . BackendUtility::getRecordTitle($tName, $rec, true)
+                            . '<input type="hidden" name="tx_impexp[record][]" value="' . htmlspecialchars(($tName . ':' . $rUid)) . '" /></td>
+                                       </tr>';
+                }
             }
         }
         // Single tables/pids: