Skip to content

Commit e47c869

Browse files
cancan101fashxp
andauthored
Allow filtering on reverse relation (#965)
* Allow filtering on reverse relation Reverts #375 * pass in table prefix * Update src/Helper/GridHelperService.php Co-authored-by: Christian Fasching <[email protected]> * Update src/Helper/GridHelperService.php Co-authored-by: Christian Fasching <[email protected]> * pump pimcore version * formatting --------- Co-authored-by: Christian Fasching <[email protected]>
1 parent f116f50 commit e47c869

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"endroid/qr-code": "^6.0.1",
1818
"nesbot/carbon": "^3.8.4",
1919
"phpoffice/phpspreadsheet": "^2.2 || ^3.3",
20-
"pimcore/pimcore": "^12.0",
20+
"pimcore/pimcore": "^12.2",
2121
"symfony/webpack-encore-bundle": "^1.17 || ^2.0"
2222
},
2323
"require-dev": {

public/js/pimcore/object/tags/reverseObjectRelation.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ pimcore.object.tags.reverseObjectRelation = Class.create(pimcore.object.tags.man
1616

1717
pathProperty: "fullpath",
1818

19-
getGridColumnConfig: function ($super, fieldConfig) {
20-
const gridColumnConfig = $super(fieldConfig);
21-
delete gridColumnConfig.getRelationFilter;
22-
return gridColumnConfig;
23-
},
24-
2519
removeObject: function (index) {
2620

2721
if (pimcore.globalmanager.exists("object_" + this.getStore().getAt(index).data.id) == false) {

src/Helper/GridHelperService.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,14 @@ public function getFilterCondition(string $filterJson, ClassDefinition $class, ?
363363
$conditionPartsFilters[] = '(' . implode(' OR ', $fieldConditions) . ')';
364364
}
365365
} else {
366-
$conditionPartsFilters[] = $field->getFilterCondition($filter['value'] ?? null, $operator, ['brickPrefix' => ($tablePrefix ? $tablePrefix . '.' : null)]);
366+
$conditionPartsFilters[] = $field->getFilterCondition(
367+
$filter['value'] ?? null,
368+
$operator,
369+
[
370+
'brickPrefix' => ($tablePrefix ? $tablePrefix . '.' : null),
371+
'tablePrefix' => ($tablePrefix ? $tablePrefix . '.' : null)
372+
]
373+
);
367374
}
368375
} elseif (in_array($filterField, $systemFields)) {
369376
// system fields

0 commit comments

Comments
 (0)