diff --git a/typo3/sysext/filelist/Classes/FileList.php b/typo3/sysext/filelist/Classes/FileList.php index 8722c1af17eafcf2fa6cf98d9a6483f9e54627c5..a09fe7ad2bbb567f22858ae86292e6beda765d07 100644 --- a/typo3/sysext/filelist/Classes/FileList.php +++ b/typo3/sysext/filelist/Classes/FileList.php @@ -1457,13 +1457,21 @@ class FileList $baseParams['bparams'] = $bparams; } + // Keep LinkHandler Settings + if ($act = ($parsedBody['act'] ?? $queryParams['act'] ?? null)) { + $baseParams['act'] = $act; + } + if ($linkHandlerParams = ($parsedBody['P'] ?? $queryParams['P'] ?? null)) { + $baseParams['P'] = $linkHandlerParams; + } + $params = array_replace_recursive($baseParams, $params); // Expanded folder is used in the element browser. // We always map it to the id here. $params['expandFolder'] = $params['id']; $params = array_filter($params, static function ($value) { - return $value !== null && trim($value) !== ''; + return (is_string($value) && trim($value) !== '') || (is_array($value) && $value !== []); }); return (string)$this->uriBuilder->buildUriFromRoute($route->getOption('_identifier'), $params);