Validation of properties implemented as interfaces

Found in

EPiServer.CMS.Core 9.7.2

Fixed in

EPiServer.CMS.Core 10.0.1

Created

Mar 15, 2016

Updated

Oct 27, 2016

Area

CMS Core

State

Closed, Fixed and tested


Description

  1. Add interface:

       public interface INewsPage
        {
            PageListBlock NewsList { get; set; }
        }
    

  2. Add the property PageListBlock on a page but do not mark it as virtual.

     public class NewsPage : StandardPage, INewsPage
        {
            [Display(
                GroupName = SystemTabNames.Content,
                Order = 305)]
            public PageListBlock NewsList { get; set; }
    

Expected: An exception that "virtual" is missing.
Actual: Looking at news page, the news list is empty.

Breaking changes note
Validation of content type properties has been changed so properties are checked that PropertyInfo.IsFinal is false. See https://msdn.microsoft.com/en-us/library/system.reflection.methodbase.isfinal(v=vs.110).aspx.
If a property was not supposed to be a content type property (persisted in CMS database) but now throws a validation exception, decorate the property with the [Ignore] attribute.