-
-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MBS-12781: Avoid admin accidentally breaking options trees
When editing attributes, relationship types and relationship attributes, you can change their parent type. There's currently nothing stopping an admin from accidentally selecting the entity itself from the dropdown, which makes MB so confused it doesn't know where to show the entity - so it doesn't. Fun times. I also tried blocking linking a type as a child of its own child, which also causes similar breaking loop messes. I don't think it's possible to do that completely with the tools we have now, though. This code blocks a root from being set under any of its children and a direct parent from being set under its direct children, which should cover most possible cases; in a very deep tree a->b->c->d it's probably still possible to set b as a child of d but I don't think it's worth adding a new recursive query to get all child IDs just to avoid that scenario.
- Loading branch information
1 parent
7f437e5
commit 755360e
Showing
4 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters