[BUGFIX] Sql query export to use search_result_labels setting 06/58406/3
authorlsascha <lsascha@gmail.com>
Wed, 26 Sep 2018 22:43:34 +0000 (00:43 +0200)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Sat, 29 Sep 2018 12:03:52 +0000 (14:03 +0200)
Releases: master, 8.7
Resolves: #86396
Change-Id: I198fe52a8024dcf392582a78c3fce0f134ed6b7a
Reviewed-on: https://review.typo3.org/58406
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
typo3/sysext/sys_action/Classes/ActionTask.php

index f5837e2..638ecd6 100644 (file)
@@ -807,9 +807,6 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
             $sql_query = unserialize($record['t2_data']);
             if (!is_array($sql_query) || is_array($sql_query) && stripos(trim($sql_query['qSelect']), 'SELECT') === 0) {
                 $actionContent = '';
-                $fullsearch = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\QueryView::class);
-                $fullsearch->formW = 40;
-                $fullsearch->noDownloadB = 1;
                 $type = $sql_query['qC']['search_query_makeQuery'];
                 if ($sql_query['qC']['labels_noprefix'] === 'on') {
                     $this->taskObject->MOD_SETTINGS['labels_noprefix'] = 'on';
@@ -821,10 +818,13 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
                         $dataRows = GeneralUtility::makeInstance(ConnectionPool::class)
                             ->getConnectionForTable($sql_query['qC']['queryTable'])
                             ->executeQuery($sqlQuery)->fetchAll();
-                        $fullsearch->formW = 48;
                         // Additional configuration
-                        $this->taskObject->MOD_SETTINGS['search_result_labels'] = 1;
+                        $this->taskObject->MOD_SETTINGS['search_result_labels'] = $sql_query['qC']['search_result_labels'];
                         $this->taskObject->MOD_SETTINGS['queryFields'] = $sql_query['qC']['queryFields'];
+
+                        $fullsearch = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\QueryView::class, $GLOBALS['SOBE']->MOD_SETTINGS);
+                        $fullsearch->noDownloadB = 1;
+                        $fullsearch->formW = 48;
                         $cP = $fullsearch->getQueryResultCode($type, $dataRows, $sql_query['qC']['queryTable']);
                         $actionContent = $cP['content'];
                         // If the result is rendered as csv or xml, show a download link