Skip to content

Commit

Permalink
[TASK] Properly quote fields in query
Browse files Browse the repository at this point in the history
  • Loading branch information
schloram authored Sep 21, 2023
1 parent 9489777 commit f29b4ec
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Classes/DataProcessing/CategoriesProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function process(

$defaultQueryConfig = [
'pidInList' => 'root',
'selectFields' => 'uid AS id,title',
'selectFields' => '{#sys_category}.{#uid} AS id, {#sys_category}.{#title}',
];
$queryConfig = [];

Expand All @@ -79,7 +79,6 @@ public function process(
];
}


if (!empty($processorConfiguration['relation.'])) {
$referenceConfiguration = $processorConfiguration['relation.'];
$relationField = $cObj->stdWrapValue('fieldName', $referenceConfiguration ?? []);
Expand All @@ -88,8 +87,8 @@ public function process(

if (!empty($relationTable)) {
$queryConfig = [
'join' => 'sys_category_record_mm on sys_category_record_mm.uid_local = sys_category.uid',
'where' => '({#sys_category_record_mm.tablenames} = \'' . $relationTable . '\' AND {#sys_category_record_mm.fieldname} = \'' . $relationField . '\' AND {#sys_category_record_mm.uid_foreign}=' . $cObj->data['uid'] . ')',
'join' => '{#sys_category_record_mm} on {#sys_category_record_mm}.{#uid_local} = {#sys_category}.{#uid}',
'where' => '({#sys_category_record_mm}.{#tablenames} = \'' . $relationTable . '\' AND {#sys_category_record_mm}.{#fieldname} = \'' . $relationField . '\' AND {#sys_category_record_mm}.{#uid_foreign}=' . $cObj->data['uid'] . ')',
];
}
}
Expand Down

0 comments on commit f29b4ec

Please sign in to comment.