Closed joerg-seibert-syzygy closed 9 months ago
I've submitted a version containing a fix (1.8.3) to the Optimizely NuGet feed. The new version is setting the properties Link
and Links
instead of directly accessing the private fields when setting Value
.
It should be available in a couple of hours.
Closing due to inactivity
When LinkData (in our case a sub-class of LinkData) is used in content and respective property is culture-specific, duplicating content from Language gadget does not respect LinkData property.
After new content (block/page) is created (from duplication context menu), LinkData property is empty.
Property:
[CultureSpecific] public virtual ExtendedLinkData? Link { get; set; }
public class ExtendedLinkData : LinkData ...
This happens with Versions 1.8.1 and 1.8.2
UPDATE: Language variants are created with LanguageBranchManager in method CopyDataForNestedContentRecursive where the value of property (of type LinkData) is assigned to property of duplicated/cloned content using PropertyData instances. This assignment is directly assigning to private field _linkData of class Geta.Optimizely.GenericLinks.PropertyLinkData. As source property value is not modified, destination value will neither be in modified state.
When I override Value property in our code (PropertyExtendedLink : PropertyLinkData) and assign value in this way
if (value is ExtendedLinkData linkData2) { Link = linkData2; } else { base.Value = value; }
which implicitly sets IsModified to true, the language variant will have set the correct LinkData value.