Topographical sorting of compositions . #542
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sorts the list of items to be imported based on the graph created from the compositions.
But it might not really be worth doing. 馃槥
The theory is if we can import in the correct order we can set compositions as we go, and maybe reduce the second pass.
however :
structure (what pages are allowed under what) also requires the content types be in place before the content types can be set. and that can be cyclical. (e.g you have have page a set to allow child types of "page b" and "page b" have child types of "page a" - so you can't get rid of the need to second pass the content types.
that might be an edge case, so maybe we could attempt this - if it fails fall back to a second pass, but that would require some thinking about how we tell the second pass that the first pass didn't mange to set it.
second pass also fixes tabs for the times when people rename a tab / group across multiple content types and we have to do a temp tab alias thing on first pass and a rename on second. so second pass isn't going away (for ContentTypes) any time soon :(
Still this can stay here as a reminder of how a topographical sort works - and why its not yet in the core.