[BUGFIX] Fix generated preview URL for single element preview 82/38482/3
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 4 Apr 2015 15:51:45 +0000 (17:51 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 7 Apr 2015 16:33:26 +0000 (18:33 +0200)
The changed backpath handling lead to double /typo3 inclusion into
the URL, so it fails.
There was an occurence of backpath overlooked, which is removed now.

Change-Id: I22284d4dc74e95fe752d4d1311581f93d4678ff4
Resolves: #66272
Relates: #66052
Releases: master
Reviewed-on: http://review.typo3.org/38482
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Benjamin Kott <info@bk2k.info>
Tested-by: Benjamin Kott <info@bk2k.info>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/workspaces/Classes/Service/WorkspaceService.php

index 416cf1f..f5f94f0 100644 (file)
@@ -622,15 +622,11 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
                }
                /** @var $uriBuilder \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder */
                $uriBuilder = $this->getObjectManager()->get(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class);
-               // This seems to be very harsh to set this directly to "/typo3 but the viewOnClick also
-               // has /index.php as fixed value here and dealing with the backPath is very error-prone
-               // @todo make sure this would work in local extension installation too
-               $backPath = '/' . TYPO3_mainDir;
-               $redirect = $backPath . 'index.php?redirect_url=';
+               $redirect = 'index.php?redirect_url=';
                // @todo this should maybe be changed so that the extbase URI Builder can deal with module names directly
                $originalM = GeneralUtility::_GET('M');
                GeneralUtility::_GETset('web_WorkspacesWorkspaces', 'M');
-               $viewScript = $backPath . $uriBuilder->uriFor('index', array(), 'Preview', 'workspaces', 'web_workspacesworkspaces') . '&id=';
+               $viewScript = $uriBuilder->uriFor('index', array(), 'Preview', 'workspaces', 'web_workspacesworkspaces') . '&id=';
                GeneralUtility::_GETset($originalM, 'M');
                if ($addDomain === TRUE) {
                        return BackendUtility::getViewDomain($uid) . $redirect . urlencode($viewScript) . $uid;
@@ -666,4 +662,4 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
                return GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
        }
 
-}
+}
\ No newline at end of file