Closed cmwalolo closed 2 years ago
So the problem was that the property on one of your document types was named key
, do I understand that correctly?
And then it generates Model.Key
but that's a conflict because the class it inherits from already has a Key
property, right?
That's it, and that property overwrites the one generated by the IPublishedElement. But it fails when we try to get the nested content values, with that error "Guid is empty"
From: Sebastiaan Janssen notifications@github.com Sent: Thursday, October 31, 2019 2:01 PM To: umbraco/Umbraco-CMS Umbraco-CMS@noreply.github.com Cc: Laurent llequenne@hotmail.com; Author author@noreply.github.com Subject: Re: [umbraco/Umbraco-CMS] IPublishedElement in Nested Content with a property "Key" fails (#7009)
So the problem was that the property on one of your document types was named key, do I understand that correctly?
And then it generates Model.Key but that's a conflict because the class it inherits from already has a Key property, right?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/umbraco/Umbraco-CMS/issues/7009?email_source=notifications&email_token=ACBGO665ZSCBGO4QYCYE6H3QRLQLLA5CNFSM4JHHNM3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECX4EHY#issuecomment-548389407, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACBGO64GUQRSJPBOGA77TNDQRLQLLANCNFSM4JHHNM3A.
This is a ModelsBuilder issue. ModelsBuilder performs validation of the property aliases, because when it's generating models, the property aliases must not clash with the property names of IPublishedContent
and IPublishedElement
.
Attempt any other (I think, haven't tried every last one to be honest) property name from either of these interfaces and you'll get:
I believe Key
simply needs to be added to the list of property aliases being validated (blacklisted) by ModelsBuilder.
Hey folks,
I've recreated this in the latest release - key should be added to the list of reserved aliases, as Kenn has said above. I'll label as up-for-grabs as this would be a nice first-time issue.
Emma
Hi @cmwalolo,
We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.
For more information about issues and states, have a look at this blog post
Thanks muchly, from your friendly Umbraco GitHub bot :-)
Hiya @cmwalolo,
Just wanted to let you know that we noticed that this issue got a bit stale and might not be relevant any more.
We will close this issue for now but we're happy to open it up again if you think it's still relevant (for example: it's a feature request that's not yet implemented, or it's a bug that's not yet been fixed).
To open it this issue up again, you can write @umbrabot still relevant
in a new comment as the first line. It would be super helpful for us if on the next line you could let us know why you think it's still relevant.
For example:
@umbrabot still relevant This bug can still be reproduced in version
x.y.z
This will reopen the issue in the next few hours.
Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:
Reproduction
I created an element with a key as property, and added it into a nested content editor. I build the models, everything is ok, i don't get any errors. At run time when using the model I receive an error "Guid is empty."
There should be a validationwhen creating a property with the alias "key" or any reserved property name to avoid that kind of time consuming debug and useless google sessions :-)