[FEATURE] Transfer query parameters in preview 12/21112/3
authorFrancois Suter <francois@typo3.org>
Tue, 16 Oct 2012 07:58:31 +0000 (09:58 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 6 Oct 2013 20:46:14 +0000 (22:46 +0200)
The workspace preview does not transfer query parameters to the
iframes used for preview. This prevents extensions passing custom
parameters from functioning properly.

Change-Id: If25f24f7d7252333c3d3a36419d81d7f611408ea
Resolves: #31996
Releases: 6.2
Reviewed-on: https://review.typo3.org/21112
Reviewed-by: Sascha Egerer
Tested-by: Sascha Egerer
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/workspaces/Classes/Controller/PreviewController.php

index dc9183e..e2b42bb 100644 (file)
@@ -95,9 +95,15 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
         * @return void
         */
        public function indexAction($previewWS = NULL) {
-               // @todo language doesn't always come throught the L parameter
-               // @todo Evaluate how the intval() call can be used with Extbase validators/filters
-               $language = intval(GeneralUtility::_GP('L'));
+                       // Get all the GET parameters to pass them on to the frames
+               $queryParameters = GeneralUtility::_GET();
+                       // Remove the GET parameters related to the workspaces module and the page id
+               unset($queryParameters['tx_workspaces_web_workspacesworkspaces']);
+               unset($queryParameters['M']);
+               unset($queryParameters['id']);
+                       // Assemble a query string from the retrieved parameters
+               $queryString = GeneralUtility::implodeArrayForUrl('', $queryParameters);
+
                // fetch the next and previous stage
                $workspaceItemsArray = $this->workspaceService->selectVersionsInWorkspace($this->stageService->getWorkspaceId(), ($filter = 1), ($stage = -99), $this->pageId, ($recursionLevel = 0), ($selectionType = 'tables_modify'));
                list(, $nextStage) = $this->stageService->getNextStageForElementCollection($workspaceItemsArray);
@@ -120,7 +126,7 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
                $wsSettingsParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Review';
                $wsSettingsUrl = $wsSettingsPath . $wsSettingsUri . $wsSettingsParams;
                $viewDomain = BackendUtility::getViewDomain($this->pageId);
-               $wsBaseUrl = $viewDomain . '/index.php?id=' . $this->pageId . '&L=' . $language;
+               $wsBaseUrl = $viewDomain . '/index.php?id=' . $this->pageId . $queryString;
                // @todo - handle new pages here
                // branchpoints are not handled anymore because this feature is not supposed anymore
                if (\TYPO3\CMS\Workspaces\Service\WorkspaceService::isNewPage($this->pageId)) {