-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Cannot get variantId of property #16859
Comments
Hi there @jojo308! 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 @jojo308 Very good case, thanks for reporting this. 🤩 I have made a fix for this, as we surely did miss the VariantID binding to Block Workspace. I see that you got a pretty good understanding of the system, so please share your learning process with me, and let me know how it works for you. Both from a technical and from a learning experience perspective. Then we can use that to improve code or improve Documentation. Feel free to get in contact with me on one of these platforms: Discord: nielslyngsoe Thanks in advance |
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
14.1.1
Bug summary
I have a property editor where I want to retrieve the
unique
andvariantId
of the node that is being edited. However, I am unable to retrieve the variantId/culture. In older versions of Umbraco I could useeditorState.variants.find(x => x.active)
, but this doesn't exist anymore and I can't find any alternatives.I've tried using some available contexts like
UMB_WORKSPACE_CONTEXT
andUMB_PROPERTY_CONTEXT
but when I try to access the variant it returnsundefined
.The following code snippet should return the variantId but it returns undefined instead.
My property editor is located in a block list item if that helps. When the property editor is located in a document directly instead of a block list item, I can actually get the variantId.
Data when the property editor is in a document:
![image](https://private-user-images.githubusercontent.com/66084710/354839345-35509d01-1a05-4e55-8f35-2817876464b9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAi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YXRlPTIwMjQwOTEyVDAyMDk0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThjOGE4OTQ2ZTVhNDUwM2YyOGM3YzBhNmJkM2NlZWMxN2ZhNDA0M2ZlY2M4OTgzMzM3OTk3MzdjNTk0YzM4YjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.aw9vx48aqLu5Nl64YZ7pkhae_wFyDeg3n5m_Oyje7Lc)
Data when the property editor is in a block list:
Specifics
No response
Steps to reproduce
I've made a repo with my property editor: https://github.com/jojo308/Umbraco.Variant.Issue
Expected result / actual result
I expect the variant to have a value instead of undefined.
The text was updated successfully, but these errors were encountered: