Don't miss out Virtual Happy Hour this Friday (April 26).
Don't miss out Virtual Happy Hour this Friday (April 26).
Jan 23, 2017
Mar 30, 2017
CMS Core
Closed, Fixed and tested
A read-only ContentArea contains a read-only collection of ContentAreaItem (ContentArea.Items). But the properties on the ContentAreaItem can be modified, causing corruption to the dictionary. Changing properties should throw exceptions to clearly indicate they are read-only.
For example, changing ContentAreaItem.RenderSettings from multiple threads could cause exceptions like "ArgumentException: An item with the same key has already been added" or "System.ArgumentNullException: Value cannot be null. Parameter name: key"
It could also corrupt the dictionary causing problems that can only be solved by restarting the application. In addition, such changes can cause more subtle errors, such as rendering sometimes shows incorrect values since multiple threads are using the same instance. It could also be that the editor is shown incorrect values when editing content areas.
This fix applies read-only semantics where it was missing to protect against this type of errors.
Workaround: ContentAreaItem originating from a read-only content should not be modified at runtime. To make changes to a stand-alone ContentAreaItem, create a new instance, copy the existing properties, then make changes (or use ContentAreaItem.CreateWritableClone, which this bugfix adds).