Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • bheimer 2 posts 82 karma points
    Jan 27, 2021 @ 20:41
    bheimer
    0

    Block Editor won't save

    I'm experimenting with custom BlockEditors (base of BlockList) ref: https://our.umbraco.com/Documentation/Extending/Property-Editors/Build-a-Block-Editor

    When I setup a custom plugin data type (no manifest, just data annotations on code), it is recognized and works fine, allowing me to add items in backoffice. On save however, the content is removed (confirmed its not saved by refreshing and checking database).

    This happens when using even the most basic setup I can try:

    [DataEditor("Cloned.BlockList", "Cloned Block List", "blocklist", ValueType = "JSON", Group = "Lists", Icon = "icon-thumbnail-list")]
    public class ClonedBlockListPropertyEditor : BlockListPropertyEditor
    {
        public ClonedBlockListPropertyEditor(ILogger logger, Lazy<PropertyEditorCollection> propertyEditors, IDataTypeService dataTypeService, IContentTypeService contentTypeService, ILocalizedTextService localizedTextService) 
            : base(logger, propertyEditors, dataTypeService, contentTypeService, localizedTextService)
        {
    
        }
    }
    

    When checking in browser console by looking at the returned server response I can see that it return null as the new value. browser console output

    The above image returns from format:

    console.log('fn:onAmountOfBlocksChanged', vm.layout.length);
    console.log('fn:onServerValueChanged', vm.layout.length, newVal, oldVal);
    

    I compared and confirmed that the oldVal object is the same correct format as the documentation.

    Is there another server side property required to allow BlockEditor to save to database? I saw on github quite a few internal only references using BlockList/BlockEditor, but most seemed related to tests. ie: ComplexPropertyEditorContentEventHandler Link to composer

    I really like the idea of "Umbraco.BlockList" but wanted to extend functionality in ways that BlockEditor seemed destined for, but really stuck... Any help would be greatly appreciated!

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Feb 09, 2021 @ 05:29
    Shannon Deminick
    100

    Hi, I've created a bug report for you here https://github.com/umbraco/Umbraco-CMS/issues/9781

Please Sign in or register to post replies

Write your reply to:

Draft