Commit 644e8be
committed
Disable
If set, a topic derives all attribute values from its derived topic (indicated via an `TopicId` attribute and `DerivedTopic` property). As a result, no attribute values are mandatory except for `Key`, `ContentType`, and `ParentId`.
The only one of these set via the OnTopic Editor's `Edit.cshtml` output is `Key` (_Folder Name_ in most implementations). As such, if a `DerivedTopic` is set, we use jQuery to remove the `required` attribute as well as any jQuery Validate _required_ `rules()` from all input fields, _except_ for the `Key` attribute.
This effectively removed required field validation for topics that are derived, thus allowing them to potentially inherit those values from their derived topic—or, optionally, override them if the editor chooses. This fixes a new bug as of OnTopic 4.0.0 where those topics still required values, thus only allowing inheritance on optional fields.
No other validators or validation attributes are impacted. As such, for instance, if a `max-length` attribute is set, that will still fire if the value is set.required attributes, validators if topic is derived1 parent 1ba3931 commit 644e8be
1 file changed
Lines changed: 12 additions & 0 deletions
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
111 | 123 | | |
112 | 124 | | |
113 | 125 | | |
| |||
0 commit comments