Skip to content

Commit

Permalink
[BUGFIX] Fix issue with download csv and filter params
Browse files Browse the repository at this point in the history
Tasks:
* Add functionality to check normalised params and the get the query values
* Add condition to check array before processing

Resolves: TYPO3GmbH#14
  • Loading branch information
Siva committed May 10, 2023
1 parent 6d7c571 commit 6a8c9a5
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Classes/Hooks/DatabaseRecordList.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,24 @@ public function modifyQuery(
$route = $queryParams['route'] ?? '';
if (!empty($table) && $route === '/module/web/list') {
$query = $queryParams['query'] ?? '';
if ($query !== null) {
if (!empty($query)) {
$filter = json_decode($query);
$filter ? $queryBuilder = GeneralUtility::makeInstance(QueryParser::class)->parse($filter, $queryBuilder) : null;
}else{
$normalizedParams = $request->getAttribute('normalizedParams');
$httpReferer = $normalizedParams->getHttpReferer();
$query = parse_url($httpReferer);
if(!empty($query['query'])){
$response = rawurldecode($query['query']);
// Recommended
parse_str($response, $output);
if(!empty($output['query'])){
$filter = json_decode($output['query']);
}
}

}

$filter ? $queryBuilder = GeneralUtility::makeInstance(QueryParser::class)->parse($filter, $queryBuilder) : null;
}
return $queryBuilder;
}
Expand Down

0 comments on commit 6a8c9a5

Please sign in to comment.