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

Resolves: #14
  • Loading branch information
Siva committed May 9, 2023
1 parent 6d7c571 commit 99425aa
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Classes/Hooks/DatabaseRecordList.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,21 @@ 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');
$url = $normalizedParams->getHttpReferer();
$query = parse_url($url);
$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 99425aa

Please sign in to comment.