Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

TinyMCE cannot be rendered within CollectionEditorDescriptor

Found in

EPiServer.CMS.TinyMce 2.0.0

Fixed in

EPiServer.CMS.TinyMce 2.1.0

(Or a related package)

Created

Mar 27, 2018

Updated

Oct 19, 2018

Area

CMS UI

State

Closed, Fixed and tested


Description

Steps to reproduce
1. Create a block that has a Property<T> with an XHtmlString property

[ContentType(GUID = "cb788228-13ce-4cae-aee3-9e08261ccc8f")]
    public class MyBlock : SiteBlockData
    {
        [CultureSpecific]
        [Display(Order = 100, GroupName = SystemTabNames.Content)]
        public virtual string Heading { get; set; }
 
        [CultureSpecific]
        [EditorDescriptor(EditorDescriptorType = typeof(CollectionEditorDescriptor<ValueItem>))]
        [Display(Order = 200, GroupName = SystemTabNames.Content)]
        public virtual IList<ValueItem> Items { get; set; }
 
    }
 
    [PropertyDefinitionTypePlugIn]
    public class AppendixTypeProperty : PropertyList<ValueItem>
    {
        public AppendixTypeProperty()
        {
            _objectSerializer = this._objectSerializerFactory.Service.GetSerializer("application/json");
        }
 
        private Injected<ObjectSerializerFactory> _objectSerializerFactory;
        private IObjectSerializer _objectSerializer;
 
        protected override ValueItem ParseItem(string value)
        {
            return _objectSerializer.Deserialize<ValueItem>(value);
        }
    }
 
    public class ValueItem
    {
        public string Text { get; set; }
 
        public XhtmlString Body { get; set; }
    }

2. Create the block
3. Open "All Properties" View

Expected: there should have a plus button allowing editors to open add a row
Actual: The button cannot be shown and in console, there is a message saying internal server error.