Skip to content

Commit

Permalink
Fixed column quoting in GridHelperService
Browse files Browse the repository at this point in the history
  • Loading branch information
brusch committed Apr 22, 2022
1 parent f29d3b2 commit 523a735
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bundles/AdminBundle/Helper/GridHelperService.php
Expand Up @@ -332,12 +332,13 @@ public function getFilterCondition($filterJson, ClassDefinition $class, $tablePr
} elseif ($filterField == 'id') {
$conditionPartsFilters[] = 'oo_id ' . $operator . ' ' . $db->quote($filter['value']);
} else {
$filterField = $db->quoteIdentifier('o_' . $filterField);
if ($filter['type'] == 'date' && $operator == '=') {
//if the equal operator is chosen with the date type, condition has to be changed
$maxTime = $filter['value'] + (86400 - 1); //specifies the top point of the range used in the condition
$conditionPartsFilters[] = '`o_' . $filterField . '` BETWEEN ' . $db->quote($filter['value']) . ' AND ' . $db->quote($maxTime);
$conditionPartsFilters[] = $filterField . ' BETWEEN ' . $db->quote($filter['value']) . ' AND ' . $db->quote($maxTime);
} else {
$conditionPartsFilters[] = '`o_' . $filterField . '` ' . $operator . ' ' . $db->quote($filter['value']);
$conditionPartsFilters[] = $filterField . ' ' . $operator . ' ' . $db->quote($filter['value']);
}
}
}
Expand Down Expand Up @@ -780,6 +781,8 @@ public function prepareAssetListingForGrid($allParams, $adminUser)

if ($filterField == 'fullpath') {
$filterField = 'CONCAT(path,filename)';
}else {
$filterField = $db->quoteIdentifier($filterField);
}

if (isset($filterDef[1]) && $filterDef[1] == 'system') {
Expand Down

0 comments on commit 523a735

Please sign in to comment.