Closed hfloyd closed 1 year ago
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 :robot: :slightly_smiling_face:
Hmm I cannot reproduce this sadly 😕
This is me on 10.6.1:
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...
Yea apparently I just forgot to re-build my models after switching to the Limbo modelsbuilder 🙈 We had a talk and agreed this is a bug, and have made a PR implementing your suggestion @hfloyd 🙌 Fixed in https://github.com/umbraco/Umbraco-CMS/pull/14776
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?