Feb 20, 2023
Apr 18, 2023
CMS Core
Closed, Fixed and tested
Fixed an issue where a SQL exception occurred when deleting a block that was being used as inlineBlock of ContentArea.
Steps to reproduce:
1. Create a block type (either typed on a .NET model or through Admin view) with a property (such as a string property called Heading).
2. Create a page instance of a type that contains a content area and assign an instance of an inline block using above block type, such as through the following code.
var page = _contentRepository.GetDefault<StandardPage>(ContentReference.StartPage);{{ }} page.Name = "ToBeDeleted";{{ }} page.MainContentArea = new ContentArea(); {{ page.MainContentArea.Items.Add(new ContentAreaItem { }} InlineBlock = _blockPropertyFactory.Create<InlineBlock>(b => b.Heading = "someting") }); _contentRepository.Save(page, SaveAction.Publish, AccessLevel.NoAccess);
3. If you created the block type from .NET code, remove the block type from the .NET code.
4. Go to Admin view and try to delete the block.