Closed joshreid closed 6 years ago
Hi @joshreid,
Awesome, thank you!
Just to avoid creating the list if we don't have to, could you try this code and see if that works for you as well?
public static PropertyType GetFormModelProperty(IContentType contentType)
{
bool IsFormModelPropertyEditor(PropertyType p) => p.PropertyEditorAlias == FormModel.PropertyEditorAlias;
return contentType.PropertyTypes.FirstOrDefault(IsFormModelPropertyEditor)
?? contentType.CompositionPropertyTypes.FirstOrDefault(IsFormModelPropertyEditor);
}
All good thanks @kjac - yep that's better, and works as expected.
Whoops, this one's in the latest version :) closing it now.
Hi @kjac
I have found that the GetFormModelProperty function does not consider the possibility of property being in a composition in the contentType.
So I have revised code in ContentHelper.cs below to fix - can give pull request if you want.
Let me know if you need anything else and when you'll repackage - I'll run my custom built dll for now.