[BUGFIX] Checkbox "Display thumbnails" does not work in filebrowser 85/42485/2
authorManuel Selbach <manuel_selbach@yahoo.de>
Mon, 10 Aug 2015 17:38:34 +0000 (19:38 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 10 Aug 2015 20:20:40 +0000 (22:20 +0200)
Generates the link if a route is given and adds additional parameters.

Resolves: #68911
Releases: master
Change-Id: I895867f0a7c0056181e2a6ab9755cf35a987ab91
Reviewed-on: http://review.typo3.org/42485
Reviewed-by: Josef Glatz <jousch@gmail.com>
Tested-by: Josef Glatz <jousch@gmail.com>
Reviewed-by: Daniel Maier <dani-maier@gmx.de>
Tested-by: Daniel Maier <dani-maier@gmx.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index a6697e8..c515f55 100755 (executable)
@@ -3107,7 +3107,14 @@ class BackendUtility {
                if (!$script) {
                        $script = basename(PATH_thisScript);
                }
-               if ($script === 'index.php' && GeneralUtility::_GET('M')) {
+
+               if (GeneralUtility::_GP('route')) {
+                       $router = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\Router::class);
+                       $route = $router->match(GeneralUtility::_GP('route'));
+                       $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
+                       $scriptUrl = (string)$uriBuilder->buildUriFromRoute($route->getOption('_identifier'));
+                       $scriptUrl .= $addParams;
+               } elseif ($script === 'index.php' && GeneralUtility::_GET('M')) {
                        $scriptUrl = self::getModuleUrl(GeneralUtility::_GET('M'), $mainParams) . $addParams;
                } else {
                        $scriptUrl = $script . '?' . GeneralUtility::implodeArrayForUrl('', $mainParams) . $addParams;