-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[Forwardport] Creating custom customer attribute with default value 0 will cause not saving value for customer entity #18718
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
Conversation
…0 will cause not saving value for customer entity. Remove curly braces.
Hi @gelanivishal. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gelanivishal please reimplement the solution according to my comment
@@ -0,0 +1,58 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gelanivishal Thank you for up-porting the issue but for 2.3 this solution should be modified since there we introduced Declarative Schema and you shouldn't use UpgradeData
scripts together with setup_version
of modules. Please reimplement that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slavvka I have performed changes as requested.
@@ -142,7 +142,7 @@ public function apply() | |||
'visible' => false, | |||
'required' => false, | |||
'user_defined' => false, | |||
'default' => '0', | |||
'default' => null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gelanivishal Thank you but that's not correct since this change won't apply to already installed instances of Magento. You need to create another named patch.
Hey @gelanivishal are you going to proceed with this PR? |
@gelanivishal I am closing this PR due to non-activity. Please feel free to reopen it once you decide to proceed with it. |
Original Pull Request
#16915
Description
Fixed Issues
Manual testing scenarios
Steps to
Create attribute with type "boolean" and default value via Data Install.
Open Swagger.
Create new product with REST API via CATALOGPRODUCTREPOSITORYV1. Attribute 'custom_product' should be missed.
{ "product": { "status": 2, "visibility": 4, "type_id": "simple", "sku": "testattr", "name": "TEST ATTR", "attribute_set_id": 4, "price": 0.5, "weight": 0.0, "extension_attributes": { "stock_item": { "qty": 0, "is_in_stock": true, "use_config_backorders": false, "backorders": 1, "use_config_manage_stock": false } }, "custom_attributes": [ { "attribute_code": "description", "value": "" }, { "attribute_code": "short_description", "value": "" }, { "attribute_code": "weight", "value": "" } ] } }
Check a product attribute 'custom_product' value in DB.
Expected result
Actual result
Contribution checklist