Skip to content

Apply field rules to inline block data in rich text - #2765

Merged
pournasserian merged 3 commits into
mainfrom
feat/2757-inline-block-field-rules
Nov 4, 2026
Merged

pournasserian merged 3 commits into
mainfrom
feat/2757-inline-block-field-rules

Conversation

@pournasserian

@pournasserian pournasserian commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Closes #2757.

The data of 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:

  • Write: the canonicalizer coerces it with the block's fields (ReadObject, ReportUnknown), the declarative validator recurses into it (through the mapper's block view, so field validators see the same values), and FieldAccess refuses a hidden, read-only or unknown field in it, reading the document in every form the rich text field type accepts.
  • Read: HiddenFields handles rich text, so hidden fields leave JSON, HTML and Markdown reads, versions, diffs, populated entries, discard and version restore. NestedTargets now skips hidden fields of inline data as it does for blocks, and TargetsOf no longer counts a hidden reference in inline data as shown, so publish neither names it under Warn nor Block.
  • Errors: EntryErrors follows 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.
  • Carry: EntryComposer pairs 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

  • An invalid value in inline block data is refused on write: InlineBlockRulesTests.AnInvalidValueIsRefusedOnWrite, ARequiredFieldIsCheckedOnPublish, AValueIsStoredAsItsFieldTypeReadsIt, AWriterCannotSetAHiddenReadOnlyOrUnknownField, AHiddenFieldCannotBeSetThroughRichTextInAnyFormTheFieldTakes
  • A hidden field in inline block data is 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.AHiddenReferenceInABlockIsNamedUnderNeitherPolicy
  • A read then a write keeps hidden values in inline block data: InlineBlockRulesTests.AReadThenAWriteKeepsHiddenValues (update and patch), HiddenValuesFollowBlocksThatMove, TheSystemPrincipalMayChangeAHiddenValue, AnUnreadableTargetIsNoTargetOnReadAndKeptOnWrite

Every 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 pack and markdownlint pass locally. FluentCmsTestHostTests.ABootSeedsTheTypesAndQueriesThemInUnderTwoSeconds failed once in a full parallel run on a loaded machine and passes on its own (3 of 3).

@pournasserian
pournasserian merged commit e579cb6 into main Nov 4, 2026
9 of 10 checks passed
@pournasserian
pournasserian deleted the feat/2757-inline-block-field-rules branch November 4, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply field rules to inline block data in rich text

1 participant