Copied to clipboard

Flag this post as spam?

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


  • Thomas 22 posts 142 karma points
    Jun 10, 2024 @ 10:23
    Thomas
    0

    After updating to Umbraco Forms 14, my custom field settings are displaying incorrectly in the backoffice

    As mentioned in the title, my custom fields are not showing the correct name and description. This is what they show:

    enter image description here

    The code for the custom field looks like this:

    public SliderFieldType()
    {
        Id = new Guid("6dff0075-598c-4345-89d7-e0db8684c819");
        Name = "Slider";
        Alias = "slider";
        Description = "Render a UUI Slider field.";
        Icon = "icon-autofill";
        DataType = FieldDataType.String;
        SortOrder = 10;
    
        FieldTypeViewName = "FieldType.Slider.cshtml";
        EditView = "My.PropertyEditorUi.InputNumber";
        PreviewView = "My.FieldPreview.Slider";
    }
    
    [Setting("Minimum", Description = "Minimum value", View = "Umb.PropertyEditorUi.Integer", DisplayOrder = 10)]
    public virtual string? Min { get; set; } = "1";
    
    [Setting("Maximum", Description = "Maximum value", View = "Umb.PropertyEditorUi.Integer", DisplayOrder = 20)]
    public virtual string? Max { get; set; } = "1";
    

    I checked the console log and I'm getting this error:

    Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'replace') at UmbLocalizationController.string (localization.controller.js:125:36) at UmbPropertyLayoutElement.render (property-layout.element.js:56:22) at UmbPropertyLayoutElement.update (index.js:19:239) at UmbPropertyLayoutElement.performUpdate (index.js:9:4905) at UmbPropertyLayoutElement.scheduleUpdate (index.js:9:4443) at UmbPropertyLayoutElement._$ET

  • Thomas 22 posts 142 karma points
    Jun 20, 2024 @ 12:30
    Thomas
    0

    I've still got this issue. Anyone experiencing the same thing?

  • Shaun Ryan 3 posts 93 karma points
    Jul 10, 2024 @ 15:50
    Shaun Ryan
    0

    Hi Thomas,

    yes I had the same issue but finally sorted it.

    I tried following the tutorial here https://docs.umbraco.com/umbraco-forms/developer/extending/adding-a-fieldtype but found it confusing at best

    Did you sort it? I may be able to help if not.

    Shaun

  • Thomas 22 posts 142 karma points
    Jul 11, 2024 @ 08:35
    Thomas
    0

    I also tried following the tutorial and also found it very confusing. I haven't solved it yet and would love some help if possible.

  • Shaun Ryan 3 posts 93 karma points
    Jul 11, 2024 @ 08:40
    Shaun Ryan
    0

    Morning Thomas,

    I can zip up the Lit/Vite/Typescript solution we have along with some documentation if you can provide me with an email address? I think it's too complex to try and detail here.

    Thanks

    Shaun

  • Thomas 22 posts 142 karma points
    Jul 11, 2024 @ 10:12
    Thomas
    0

    That would be great. You can send it to [email protected]. Thank you so much.

  • Thomas 22 posts 142 karma points
    Jul 11, 2024 @ 13:04
    Thomas
    0

    Hi Shaun

    Thank you so much for the code and the very detailed documentation. You're a hero. After setting up everything I get the following errors, though:

    enter image description here

    I'm assuming it's because I need to install the modules into the project, but how would I do that? I apologize if these are dumb questions, but I have no experience with TypeScript and Vite.

  • Shaun Ryan 3 posts 93 karma points
    Jul 11, 2024 @ 13:25
    Shaun Ryan
    100

    Hi Thomas,

    apologies, the following was missing from the documentation:

    npm install --legacy-peer-deps -D @umbraco-cms/backoffice

    Run the above in your Lit project directory to install the required Umbraco packages.

    Bear in mind that you also need the correct version of Node installing in order to run Vite.

    See: https://vitejs.dev/guide/

    Thanks

    Shaun

Please Sign in or register to post replies

Write your reply to:

Draft