U4-2129 - 6.1 Beta - PropertyEditorConverters don't work for inherited properties

Created by Tom Fulton 18 Apr 2013, 20:10:40 Updated by Tom Fulton 22 Apr 2013, 17:20:58

Relates to: U4-1958

Using the latest build as of today.

PropertyEditorConverters work fine for properties that exist on the current document type. But they don't work for properties that are inherited.

For example, I have a "Callouts" MNTP on a Base document type that Textpage inherits from. The PropertyEditorConverter never gets fired for this MNTP, but it does for MNTPs that exist directly on Textpage.

I think the problem is in PublishedContentHelper.GetDataType - it returns a blank GUID for the inherited properties. This method checks against ContentType.PropertyTypes, and I'm guessing this isn't including inherited properties.

Screencast showing example and quick debug in VS: http://screencast.com/t/FfRoBxSU


Tom Fulton 18 Apr 2013, 20:15:59

Confirmed, this code:

var result = applicationContext.Services.ContentTypeService.GetContentType(docTypeAlias);

result.PropertyTypes only contains properties from the 'local' doctype, not inherited properties, thus causing the GetDataType method to fail on this line:

if (!result.PropertyTypes.Any(x => x.Alias.InvariantEquals(propertyAlias))) { return Guid.Empty; } (Umbraco.Core.PublishedContentHelper - line 84)

Shannon Deminick 19 Apr 2013, 15:17:52

Hey @Tom, I'd assume that this affects version before 6.1, do you know off the top of your head if that is the case ?

Shannon Deminick 19 Apr 2013, 17:11:01

Have tested this with 4.x and seems to work, will move on to 6.x :)

Shannon Deminick 19 Apr 2013, 17:48:41

Fixed in 5ad572d24c99, only affected 6.1 because we were using the new persistence api instead of the old one. I didn't realize we need to use the property CompositionPropertyTypes instead of just PropertyTypes.

Tom Fulton 22 Apr 2013, 16:55:21

Just tested and seems to work well - thanks!

For future reference, do you know the difference between CompositionPropertyTypes and PropertyTypes? Besides that I guess the first includes inherited properties?

Tom Fulton 22 Apr 2013, 17:20:58

Nevermind :) - https://github.com/umbraco/Umbraco4Docs/blob/master/Documentation/Reference/Management-v6/Models/ContentType.md#contenttypecomposition

Priority: Major

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 6.1.0

Due in version:


Story Points: