New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModelsBuilder GetModelPropertyType fails when the "itemType" is "Element" #14694
Comments
Hi there @hfloyd! Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better. We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
Hi @Zeegaan , Thanks for looking into this. Do you see what the "itemType" is returning when you step into that method? When I run it, "itemType" = "Element" - which isn't included in the switch statement... |
Awesome 👍 I hadn't even spotted this. I tried to do the same as Umbraco's models builder for my package, so not sure if something has changed in Umbraco since then, or I just ended up doing this part slightly different. |
Great news, @Zeegaan ! Thanks for checking again. |
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
10.6.1
Bug summary
I have a Composition Document type, lets call it "CompMyData". It has some properties, and is on some Document types used for nodes.
I have some code like this, to get the exact alias of a composition property:
var aliasMyProp = CompMyData.GetModelPropertyType(_publishedSnapshotAccessor, x => x.MyProperty).Alias;
but it throws an error when it runs:
I am using Limbo ModelsBuilder for the model generation, and the code in question looks like this:
Specifics
The error occurs in
Umbraco.Cms.Infrastructure.ModelsBuilder.PublishedModelUtility.GetModelContentType()
Steps to reproduce
Attempt to use
GetModelPropertyType()
on a Model for a Composition.Expected result / actual result
I just wanted to get the property alias.
Resolution?
Should "Element" be added as an acceptable itemType?
The text was updated successfully, but these errors were encountered: