-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Customer attributes default value #39605
Comments
Hi @sheepfy. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
Hi @sheepfy, Thanks for your reporting and collaboration. We have tried to reproduce the issue in Latest 2.4-develop instance and we are not able to reproduce the issue.Kindly refer the screenshots. ![]() ![]() The default value was loaded in customer account information.Could you please let us know if we are missing anything. Thanks. |
@engcom-Bravo According to your screenshots, the default value set in admin is "No" (you can also try it with yes). Then in order to same the customer, you have to select a value from that dropdown, which is empty: |
@engcom-Bravo ah, now I see. You were checking the attribute label. |
HI @sheepfy, Thanks for your update. ![]() In order to save the customer we are able to see the dropdown values.Could you please let us know if we are missing anything. Thanks. |
@engcom-Bravo The default value, which is set from admin to be "No", is not preselected. |
Hi @engcom-November. Thank you for working on this issue.
|
Hello @sheepfy, Thank you for your report and collaboration. We have reviewed the issue, and it is reproducible on the latest 2.4-develop instance. Please refer to the attached screenshots for reference. Steps to Reproduce:
![]() ![]() ![]() The issue has been confirmed, and we will proceed with further investigation and updates. Thank you. |
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Once all required labels are present, please add |
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Once all required labels are present, please add |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-14246 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-November. Thank you for verifying the issue. |
@sheepfy @engcom-November - I have investigated this and confirmed that it is not an issue but rather expected Magento behavior. When a new customer attribute is created in Magento, it works as expected for customers who are registered after the attribute is created. This is because Magento automatically assigns the default value to new customer records. However, for existing old customers, the attribute's default value is not applied automatically. Magento does not retroactively update old customer records with the newly assigned default value. As a result, these customers will not have any entry for the attribute in the relevant database table (e.g., customer_entity_int, customer_entity_varchar, etc.). Thanks |
@ajay2108 I am using the enterprise version. Also, I think the "default value" should be used when there is no value set at all anywhere.(So no patch, import should be required) If you have a "No" set in the customer_entity_int (or whatever), then that "No" is not a default value, is a customer choice. That is the whole point of the default value. Think of it like a "default value" for a column in mysql. When you do an insert, without a value for that column, that value will just take the default value along the way automatically So from my point of view, the default attribute value is used for nothing in there. |
Preconditions and environment
Steps to reproduce
Create random customer attribute for customer edit page.
Login, go to check the attribute into the edit page
Notice that the default value is not there.
Expected result
The default value to be autofilled in the form (or at least loaded on the Magento\Customer\Model\Customer object at vendor/magento/module-custom-attribute-management/Block/Form/Renderer/AbstractRenderer.php :: getValue method)
Actual result
Null value comes instead of the default value
Additional information
No response
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: