Skip to content

Deleting a nested block removes its content but leaves it in the layout #397

Description

@Luuk1983

Which component is this issue related to?

Umbraco.AI (Core)

Which Umbraco AI version are you using?

17.3.4 (also 17.4.0-rc.4 and v17/main)

Bug summary

I understand block grid v1 is root-level only, and for move that holds: a nested block isn't found, nothing happens.

Delete doesn't hold to it. Content entries are keyed flat, so delete removes a nested block's content even though its position entry is out of reach. What's left is a layout pointing at content that is gone, plus orphaned settings, since resolving those depends on the layout entry it could not find.

Both still report success, so a caller cannot tell an out-of-scope key from a completed operation.

Steps to reproduce

Delete a block nested inside another block's area. Its content entry disappears, its layout entry does not.

Expected result / actual result

Expected: either both go, or neither does and the call reports that the block is out of scope.

Actual: content goes, layout stays, success is reported.

Suggested fix

Reject out-of-scope keys the way ValidateAddItem already rejects Extra, rather than partially applying. BlockGridLayoutItem.ContainsContent already recurses into areas, so spotting a nested key is cheap.

Dependencies

Umbraco CMS 17.x. Found driving the property value dispatcher from a third-party package.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions