Try our conversational search powered by Generative AI!

ContentReferenceList does not work when used as a property in a Local Block

Fixed in

EPiServer.CMS.UI 9.8.3

(Or a related package)

Created

Feb 19, 2016

Updated

Jun 27, 2018

Area

CMS UI

State

Closed, Fixed and tested


Description

1. A new Block type has a property of ContentReferenceList.

[ContentType(...)]
public class ImagesBlock : BlockData
{
public virtual string Title

{ get; set; }
public virtual IEnumerable<ContentReference> ImageRefs { get; set; }

}

2. Use this new Block type as a property in the Alloy's StandardPage content type.

public class StandardPage :
{
....
public virtual ImagesBlock ImageRefsBlock

{ get; set; }

...
}

3. Use the PropertyFor helper to render the Local block property (Index.cshtml for StandardPage).
@Html.PropertyFor(x => x.CurrentPage.ImageRefsBlock)

Actual:
With EPiServer.CMS.Core 9.7.0, there is no overlay around the property => could not open the popup editor.

With EPiServer.CMS.Core 9.6.1 and older, if you click the property's overlay, it shows its popup editor but there is an error on the console. The property does not work in On-Page Editing view.
Error in log: System.ArgumentNullException: Value cannot be null.
Parameter name: ids
at EPiServer.Framework.Validator.ThrowIfNull(String name, Object value)
at EPiServer.Cms.Shell.UI.Rest.ContentStructureStore.List(IEnumerable`1 ids) ...