Open

Description
Preconditions and environment
- Magento 2.4.4,2.4-develop
- REST API access
- Create Product attributes with options through rest API
Steps to reproduce
Issue a request following these criteria
- Request method: POST
- Endpoint: /rest/V1/products/attributes
- example Body:
{
"attribute": {
"is_wysiwyg_enabled": false,
"is_html_allowed_on_front": false,
"used_for_sort_by": false,
"is_filterable": true,
"is_filterable_in_search": true,
"is_used_in_grid": true,
"is_visible_in_grid": false,
"is_filterable_in_grid": true,
"position": 0,
"apply_to": [],
"is_searchable": "1",
"is_visible_in_advanced_search": "1",
"is_comparable": "1",
"is_used_for_promo_rules": "0",
"is_visible_on_front": "0",
"used_in_product_listing": "1",
"is_visible": true,
"scope": "global",
"attribute_code": "brand",
"frontend_input": "select",
"entity_type_id": "4",
"is_required": false,
"options": [
{
"label": "test1"
},
{
"label": "test2"
},
{
"label": "test3"
}
],
"is_user_defined": true,
"default_frontend_label": "Brand",
"frontend_labels": null,
"backend_type": "decimal",
"source_model": "Magento%5C%5CEav%5C%5CModel%5C%5CEntity%5C%5CAttribute%5C%5CSource%5C%5CTable",
"default_value": "",
"is_unique": "0"
}
}
-> attribute will be created, but with BE type text (due to getBackendTypeByInput() function)
Expected result
Correct backend_type will be created if valid in body, or throw exception if wrong backend_type provided or fallback to current behavior if backend_type not mentioned.
Actual result
Wrong backend type is set on attribute
Additional information
Please do not use select frontend type for this case. to reproduce the issue use the text front end type.
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Use with concrete module component label E.g. "Component: Api" + "Catalog"Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branch
Type
Projects
Status
Pull Request In Progress
Activity
m2-assistant commentedon Oct 18, 2022
Hi @mansourwalid. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x releaseFor more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue:
@magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
m2-assistant commentedon Oct 19, 2022
Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇
1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is valid
appears.2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
Issue: Clear Description
label to the issue by yourself.3. Add
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.4. Verify that the issue is reproducible on
2.4-develop
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.- If the issue is reproducible on
2.4-develop
branch, please, add the labelReproduced on 2.4.x
.- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
5. Add label
Issue: Confirmed
once verification is complete.6. Make sure that automatic system confirms that report has been added to the backlog.
engcom-Bravo commentedon Oct 19, 2022
@magento give me 2.4-develop instance
magento-deployment-service commentedon Oct 19, 2022
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
magento-deployment-service commentedon Oct 19, 2022
Hi @engcom-Bravo, here is your Magento Instance: https://0deb0e79ae377da4a9abffb95472f464.instances.magento-community.engineering
Admin access: https://0deb0e79ae377da4a9abffb95472f464.instances.magento-community.engineering/admin_475b
Login: e8bbb47e
Password: c173ad63f57f
engcom-Bravo commentedon Oct 19, 2022
Hi @mansourwalid,
Thank you for reporting and collaboration.Verified the issue on Magento 2.4-develop instance.
We have used this body for attributes
{
"attribute": {
"is_wysiwyg_enabled": false,
"is_html_allowed_on_front": false,
"used_for_sort_by": false,
"is_filterable": true,
"is_filterable_in_search": true,
"is_used_in_grid": true,
"is_visible_in_grid": false,
"is_filterable_in_grid": true,
"position": 0,
"apply_to": [],
"is_searchable": "1",
"is_visible_in_advanced_search": "1",
"is_comparable": "1",
"is_used_for_promo_rules": "0",
"is_visible_on_front": "0",
"used_in_product_listing": "1",
"is_visible": true,
"scope": "global",
"attribute_code": "brand",
"frontend_input": "select",
"entity_type_id": "4",
"is_required": false,
"options": [
{
"label": "test1"
},
{
"label": "test2"
},
{
"label": "test3"
}
],
"is_user_defined": true,
"default_frontend_label": "Brand",
"frontend_labels": null,
"backend_type": "int",
"source_model": "Magento%5C%5CEav%5C%5CModel%5C%5CEntity%5C%5CAttribute%5C%5CSource%5C%5CTable",
"default_value": "",
"is_unique": "0"
}
}
please confirm in your case also you are getting same kind of Difference.
As you mentioned repeat call not possible it shows attribute is already created.kindly provide more steps about this.
Please let us know we miss anything.
Thanks.
engcom-Bravo commentedon Oct 20, 2022
Hi @mansourwalid,
Thanks for quick update.
We tried with "frontend_input": "text"..Please provide more information about repeat call.Kindly refer screenshots.
Please let us know we miss anything.
Thanks.
engcom-Bravo commentedon Oct 21, 2022
Hi @mansourwalid,
Thank you for reporting and collaboration.
Verified the issue on Magento 2.4-develop instance and the issue is reproducible. Kindly refer the screenshots.
We are getting Wrong backend type in the response.
Hence confirming this issue.
Thanks.
23 remaining items