Commit 9beeb8a
committed
Fall back to content types of parents
The `ContentTypeListViewComponent` displays a list of content types available to be created under the current topic. It bases this list on the current topic's content type. This is confusing when creating a new topic, however, since the current topic hasn't yet been saved. If the user were to quit creating the current topic, and instead choose a new topic of a different content type, it would be operating against the parent context. As such, if the `actualTopic` can't be found—because it's a new topic!—it should fall back to the parent topic instead.
This additionally fixes a bug when creating a `Container`, since in this scenario it adopts the `PermittedContentTypes` from the current topic, instead of from the `ContentTypeDescriptor`, thus allowing the same `Container` class to target collections of different content types. This previously resulted in a null reference exception, however, since `actualTopic` was `null` in this scenario.1 parent b6868cf commit 9beeb8a
1 file changed
Lines changed: 4 additions & 3 deletions
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | | - | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| |||
0 commit comments