OrchardCore icon indicating copy to clipboard operation
OrchardCore copied to clipboard

Liquid templates ContentItems property names became case insensitive

Open SzymonSel opened this issue 1 month ago • 17 comments

After upgrading from 1.9 to 2.0 we've noticed some of our liquid templates failing with a the error

ArgumentException: An item with the same key has already been added. Key: Camelcase (Parameter 'propertyName')

This happend because we are calling {{ field.MyProperty.CamelCase.Text }}

This just so happens that in some time during design and development we misstyped the name of the field and later changed it from Camelcase to CamelCase which left us with some harmless rubish in the JSON content... well at least until we upgraded to OC 2.0

{"CamelCase":{"Text":null},"Camelcase":{"Text":null}}

Is this switch, to case-insensitiveness was done intentionally?

SzymonSel avatar May 08 '24 18:05 SzymonSel