Properly handle M2A fields in fieldStore and useFieldTree (#9432)

* Properly handle M2A fields in fieldStore and useFieldTree

* Fix addNode

* Rewrote use-field-tree

* Remember visited paths

* Fix error whith undefined relation.meta
This commit is contained in:
Oreille
2021-11-05 01:35:05 +01:00
committed by GitHub
parent b2f3091826
commit ef3da32ab3
8 changed files with 109 additions and 181 deletions

View File

@@ -221,7 +221,7 @@ export function applyFilter(
.on(
`${parentAlias || parentCollection}.${relation.field}`,
'=',
knex.raw(`CAST(?? AS TEXT)`, `${alias}.${schema.collections[pathScope].primary}`)
knex.raw(`CAST(?? AS VARCHAR(255))`, `${alias}.${schema.collections[pathScope].primary}`)
)
.andOnVal(relation.meta!.one_collection_field!, '=', pathScope);
});