Skip to content
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

Load attribute's default_value in hub when no existing value exists #1310

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Load attribute's default_value in hub when no existing value exists #1310

merged 1 commit into from
Oct 16, 2023

Conversation

kylekanderson
Copy link
Contributor

This pull request makes use of the the default_value property of Attributes in the hub.

Currently, if an Attribute has a default_value set, when that Attribute is linked to a Model and displayed in the hub, the field displayed for that Attribute is blank on create and when no pre-existing value exists.

For example, if I have an Attribute Group called "Foo" that contains an Attribute call "Bar" that is an Attribute of type "Number" with a default value of 42, I will see the following on the Product Creation page (when that Attribute is linked to my Product Type):
2023-10-13 at 15 34 01

With this pull request, when an Attribute has a default_value set, that value will be loaded into the field in the Hub. When applied to the previous example, this will now display the default_value (42, in this case) in the field:
2023-10-13 at 15 35 55

@vercel
Copy link

vercel bot commented Oct 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 13, 2023 7:37pm

@kylekanderson kylekanderson changed the title Load attribute's default_value in hub when no existing value Load attribute's default_value in hub when no existing value exists Oct 13, 2023
Copy link
Collaborator

@alecritson alecritson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kylekanderson ! Good spot.

@alecritson alecritson merged commit d7b6eac into lunarphp:0.6 Oct 16, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants