New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relational fields are broken in advanced settings and cannot be updated #9182
Comments
Here is what the {
"m2o": {
"meta": {
"one_field": null,
"sort_field": null,
"one_deselect_action": "nullify"
},
"schema": {
"on_delete": "SET NULL"
}
},
"o2m": {
"related_collection": "foo",
"schema": {
"table": "foo_baz",
"column": "foo_id",
"foreign_key_table": "foo",
"foreign_key_column": "id",
"foreign_key_schema": "public",
"constraint_name": "foo_baz_foo_id_foreign",
"on_update": "NO ACTION",
"on_delete": "SET NULL"
},
"meta": {
"id": 15,
"many_collection": "foo_baz",
"many_field": "foo_id",
"one_collection": "foo",
"one_field": "baz",
"one_collection_field": null,
"one_allowed_collections": null,
"sort_field": null,
"one_deselect_action": "nullify"
}
}
} Here's what it looks like when passed to the {
"m2o": {
"collection": "foo_files_1",
"field": "directus_files_id",
"related_collection": "directus_files",
"meta": {
"one_field": null,
"sort_field": null,
"one_deselect_action": "nullify",
"junction_field": "foo_id"
},
"schema": {
"on_delete": "SET NULL"
}
},
"o2m": {
"collection": "foo_files_1",
"field": "foo_id",
"related_collection": "foo",
"schema": {
"table": "foo_files",
"column": "foo_id",
"foreign_key_table": "foo",
"foreign_key_column": "id",
"foreign_key_schema": "public",
"constraint_name": "foo_files_foo_id_foreign",
"on_update": "NO ACTION",
"on_delete": "SET NULL"
},
"meta": {
"id": 7,
"many_collection": "foo_files",
"many_field": "foo_id",
"one_collection": "foo",
"one_field": "files",
"one_collection_field": null,
"one_allowed_collections": null,
"junction_field": "directus_files_id",
"sort_field": null,
"one_deselect_action": "nullify"
}
}
} In |
@Oreilles Looks like o2m and m2o might be flipped 🤔 |
Have there been changes in the new field flow commits that could have done that ? 🤔 |
Oh yes absolutely. This split between o2m and m2o wasn't there before at all 🙂 |
Preflight Checklist
Describe the Bug
When creating a relational field on a collection, we can edit the display template in the new field flow - but when we try to change it again from the data-model route (with the drawer), the display template indicates "Please select a collection" (even though the relation is already configured).
EDIT: The relation is actually misconfigured is the whole field drawer, and it happens the moment you open it. If you open the advanced setting of a relational field, close the drawer, go to the collection owning that field and try to set its value, the app will crash with
To Reproduce
Errors Shown
Other example:
What version of Directus are you using?
rc.99
What version of Node.js are you using?
16
What database are you using?
MySQL
What browser are you using?
Firefox
What operating system are you using?
macOS
How are you deploying Directus?
local
The text was updated successfully, but these errors were encountered: