LibrarySites.Banner

Resolving InvalidOperationException: Field in Rendering Parameters with Sitecore

This blog post provides one solution for resolving InvalidOperationException that may appear when working with rendering parameters in the Sitecore ASP.NET web Content Management System (CMS) and Customer Engagement Platform (CEP).

When working with a rendering that specifies a rendering parameters template, if you encounter the following exception:

[InvalidOperationException: field]
Sitecore.Data.FieldDescriptor..ctor(Item item, String fieldName) +221
Sitecore.Shell.Applications.Layouts.DeviceEditor.RenderingParameters.GetAdditionalParameters(List`1 fieldDescriptors, Item standardValues, Dictionary`2 additionalParameters) +430
Sitecore.Shell.Applications.Layouts.DeviceEditor.RenderingParameters.GetFields(RenderingDefinition renderingDefinition, Dictionary`2 parameters) +902
Sitecore.Shell.Applications.Layouts.DeviceEditor.RenderingParameters.Show() +303
Sitecore.Shell.Applications.Layouts.DeviceEditor.DeviceEditorForm.Edit(ClientPipelineArgs args) +184

The problem is most likely that your rendering parameters template does not inherit from the default rendering parameters template that defines fields common to all renderings. I believe I may have experienced this myself, and encountered two people on the Sitecore Developer Network (SDN) forums who have as well.

To address this issue, set base templates for your rendering parameters template to include the System/Layout/Rendering Parameters/Standard Rendering Parameters template.

Resources