-
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
Accessing settings in a Block custom view always returns the first setting value #17989
Comments
Hi there @johnpscott! 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 🤖 🙂 |
This issue is still present in the 5.1.2 Contrib branch. I have pinpointed the issue to the following code for 'settingsValues' in 'block-entry-context.ts' at line 234.
By replacing this code with the corresponding code pattern for the 'contentValues' method the problem is resolved. I.e.
I am not very familiar with the Umbraco codebase, or the process for proposing code changes, so I haven't been able perform rigorous testing. I hope someone with more experience will pick this up, test and fix the error. It is a major issue for anyone who wants to make use of the custom edit views in block grid, and it is impeding my attempt to upgrade my Umbraco 11/12 sites to the latest version. regards John |
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
15.1.1
Bug summary
When a BlockGrid block element has a settings model with more than one property any attempt to use the values in a Block Custom View an the back office always returns the first declared property in the settings model.
Specifics
So for example if the settings model has the following property aliases: a, b, c, d, e with values Hay, Bee, See, Dee, He
Code to retrieve properties b to e will always retrieve the value of property a, i.e. Hay
return html
<p>${this.settings?.e}</p>
returns
Hay
Steps to reproduce
Add a new block to a BlockGrid data type based on an existing Content model and an existing settings model.
The settings model must have two or more properties (e.g. ForegroundColor and BackgroundColor)
In the custom Typescript view for the grid item access the settings values as so:
Expected result / actual result
When using the two variables they both return the value of the first declared property in the settings model.
This has been reproduced with up to 5 properties - the first declared property is returned despite being accessed by the properties alias.
This has also be noted in the Our Umbraco forum entry: https://our.umbraco.com/forum/using-umbraco-and-getting-started/115164-umbraco-15-custom-block-grid-displaying-data-type-values-from-a-settings-element-in-cms
The text was updated successfully, but these errors were encountered: