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:
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
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.
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:
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.
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:
The code for the custom field looks like this:
I checked the console log and I'm getting this error:
I've still got this issue. Anyone experiencing the same thing?
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
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.
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
That would be great. You can send it to [email protected]. Thank you so much.
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:
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.
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
is working on a reply...