How to make your custom form elements work after upgrading Optimizely.Forms

Updating Optimizely Forms is not always problem free.

This is not something that most solutions have a problem with, but for some projects the custom elements you have written for Optimizely.Forms will stop showing in your views.

The reason for this is not always a bug in Optimizely.Forms, it could be your own fault...

The Optimizely.Forms code is placed inside your /modules/_protected folder in your project. By default, that is also the place Optimizely.Forms stores its fundamental configuration (in the _protected/EPiServer.Forms/Forms.config file).

If your custom FormElements are placed in a different location than the default one, that file is where you fix it. Inside the <episerverforms> tag, the default value for the FormElement location is:

formElementViewsFolder="~/Views/Shared/ElementBlocks"

When updating the Optimizely.Forms NuGet, all contents of the /protected/Episerver.Forms/ folder will be replaced with the new Optimizely.Forms code, including the Forms.config file that contained your custom Forms changes.

So if your form elements are placed in a different location than default, remember to change this path back to your correct path, for instance:

formElementViewsFolder="~/Areas/Shared/Forms/Views"

Voilà, that can be all you need to make your newly updated Optimizely.Forms package work like a charm again :)