Repository navigation
Apply field rules to inline block data in rich text - #2765
Merged
Merged
Conversation
This was referenced Nov 4, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #2757.
The
dataof a block placed inline in rich text now gets the rules of the same block in a block list, through the paths the blocks field already uses:ReadObject,ReportUnknown), the declarative validator recurses into it (through the mapper's block view, so field validators see the same values), andFieldAccessrefuses a hidden, read-only or unknown field in it, reading the document in every form the rich text field type accepts.HiddenFieldshandles rich text, so hidden fields leave JSON, HTML and Markdown reads, versions, diffs, populated entries, discard and version restore.NestedTargetsnow skips hidden fields of inline data as it does for blocks, andTargetsOfno longer counts a hidden reference in inline data as shown, so publish neither names it under Warn nor Block.EntryErrorsfollows an error path through a rich text document into inline block data, so an error on a hidden field there is masked and compared with the stored entry as for a block list, on save, publish and scheduled publish.EntryComposerpairs the inline blocks of a changed document as it pairs the blocks of a list (PairUp, now given an owner function) and carries hidden and read-only values and unseen targets into them.An inline block of a type the schema does not know is left as written, as before. A shared walker,
InlineBlockJson, reads documents as deep as the field type accepts (128).Acceptance
datais refused on write:InlineBlockRulesTests.AnInvalidValueIsRefusedOnWrite,ARequiredFieldIsCheckedOnPublish,AValueIsStoredAsItsFieldTypeReadsIt,AWriterCannotSetAHiddenReadOnlyOrUnknownField,AHiddenFieldCannotBeSetThroughRichTextInAnyFormTheFieldTakesdatais absent from JSON, HTML and Markdown reads, and from version reads and diffs:InlineBlockRulesTests.AHiddenFieldIsAbsentFromEveryRead(draft, published, HTML, Markdown, list, versions, diff, population; editor and a plain reader),AFilterCannotReachAHiddenField,APublishErrorOnAHiddenFieldDoesNotNameIt,AnInvalidStoredHiddenValueIsNotQuotedAndDoesNotBlockASave,ReferenceIntegrityTests.AHiddenReferenceInABlockIsNamedUnderNeitherPolicydata:InlineBlockRulesTests.AReadThenAWriteKeepsHiddenValues(update and patch),HiddenValuesFollowBlocksThatMove,TheSystemPrincipalMayChangeAHiddenValue,AnUnreadableTargetIsNoTargetOnReadAndKeptOnWriteEvery case runs for a blocks field and for an inline block, so both paths are held to the same result. Without the source change the inline cases fail and the blocks cases pass.
Spec
Section 4.2 now says what the rules on inline block data are. Section 9.2 did not list this gap on
main, so there was nothing to remove there.Dependencies
None.
Checks
dotnet build -c Release -warnaserror,dotnet test,dotnet packand markdownlint pass locally.FluentCmsTestHostTests.ABootSeedsTheTypesAndQueriesThemInUnderTwoSecondsfailed once in a full parallel run on a loaded machine and passes on its own (3 of 3).