Try our conversational search powered by Generative AI!

Incorrect localization when block and page have the same property name

Fixed in

EPiServer.CMS.UI 11.2.5

(Or a related package)

Created

Jan 26, 2018

Updated

Jun 27, 2018

Area

CMS UI

State

Closed, Fixed and tested


Description

Steps to reproduce:
1. Create page and block class that have the same property name "Heading"

[ContentType(Description = "Content Page Type")]
public class ContentPageType : PageData
{
public virtual string Heading { get; set; }
public virtual GeneralContentBlock InfoBox { get; set; }
}

[ContentType(DisplayName = "General Content Block", GUID = "f388d255-035f-4300-906a-0c71e4b5ce7e", Description = "")]
public class GeneralContentBlock : BlockData
{
public virtual string Heading { get; set; }
}

2. Use a language file with this content:

<?xml version="1.0" encoding="utf-8"?>
<languages>
<language id="en" name="English">
<contenttypes>
<GeneralContentBlock>
<properties>
<Heading>
<caption>Heading in GeneralContentBlock</caption>
</Heading>
</properties>
</GeneralContentBlock>
<ContentPageType>
<properties>
<Heading>
<caption>Heading in ContentPageType</caption>
</Heading>
</properties>
</ContentPageType>
</contenttypes>
</language>
</languages>

3. Create a page with ContentPageType and observer Heading caption

Expected Result: Heading in block should show "Heading in GeneralContentBlock"
Actual Result: Heading in block show "Heading in ContentPageType"