Skip to content

API get attributes return wrong frontend_input #28094

@fohnbit

Description

@fohnbit

#26097 # Preconditions (*)

  1. Magento 2.3.5-p1

Steps to reproduce (*)

  1. Create a new "swatch text" product attribute via API or admin panel
  2. Send to:
    https://company.com/rest/V1/products/attributes/
    payload:
    { "attribute": { "is_wysiwyg_enabled": false, "is_html_allowed_on_front": true, "used_for_sort_by": true, "is_filterable": true, "is_filterable_in_search": true, "is_used_in_grid": true, "is_visible_in_grid": true, "is_filterable_in_grid": true, "position": 100, "apply_to": [], "is_searchable": true, "is_visible_in_advanced_search": true, "is_comparable": true, "is_used_for_promo_rules": false, "is_visible_on_front": true, "used_in_product_listing": true, "is_visible": true, "scope": "global", "attribute_code": "test_specs", "frontend_input": "swatch_text", "entity_type_id": "4", "is_required": false, "options": [ { "label": "2 cm (Admin)", "value": "2cm", "sort_order": 2, "is_default": false, "store_labels": [ { "store_id": 1, "label": "2 cm (Store 1)" }, { "store_id": 2, "label": "2 cm (Store 2)" } ] } ], "is_user_defined": true, "default_frontend_label": "Test Specs", "frontend_labels": [ { "label": "Test Specs", "store_id": 0 } ], "backend_type": "int", "source_model": "Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Table", "is_unique": true, "validation_rules": [] } }

Expected result (*)

  1. receive for "frontend_input" the value "swatch_text"

Actual result (*)

  1. receive for "frontend_input" the value "select"
    https://company.com/rest/V1/products/attributes/?searchCriteria[filter_groups][0][filters][0][field]=attribute_id&searchCriteria[filter_groups][0][filters][0][value]=**148**&searchCriteria[filter_groups][0][filters][0][condition_type]=like
    { "items": [ { "is_wysiwyg_enabled": false, "is_html_allowed_on_front": true, "used_for_sort_by": true, "is_filterable": true, "is_filterable_in_search": true, "is_used_in_grid": true, "is_visible_in_grid": true, "is_filterable_in_grid": true, "position": 100, "apply_to": [], "is_searchable": "1", "is_visible_in_advanced_search": "0", "is_comparable": "1", "is_used_for_promo_rules": "0", "is_visible_on_front": "1", "used_in_product_listing": "1", "is_visible": true, "scope": "global", "attribute_id": 148, "attribute_code": "bildsensor", "frontend_input": "select", "entity_type_id": "4", "is_required": false, "options": [ { "label": " ", "value": "" }, { "label": "21/1.7” 12 Megapixel Progressiv CMOS", "value": "5431" }, { "label": "red en", "value": "5476" } ], "is_user_defined": true, "default_frontend_label": "Bildsensor", "frontend_labels": [], "backend_type": "int", "source_model": "Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Table", "default_value": "", "is_unique": "0", "validation_rules": [] } ], "search_criteria": { "filter_groups": [ { "filters": [ { "field": "attribute_id", "value": "148", "condition_type": "like" } ] } ] }, "total_count": 1 }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions