Skip to content

Visual Swatch is deleted when updating option through REST API #37794

Open
@elzekool

Description

@elzekool

Preconditions and environment

  • Magento version 2.4.*
  • Attribute that uses a visual swatch (e.g. color)

Steps to reproduce

  1. Make sure that you have an attribute with a visual swatch (in default example this is color)
  2. Update option value through REST API /rest/all/V1/products/attributes/[attribute_code]/options/[option_id] (for example to update translations)

Expected result

Attribute labels are updated and swatches remain as-is

Actual result

Attribute labels are updated but swatch data is deleted

Additional information

No response

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”.

Activity

m2-assistant

m2-assistant commented on Jul 24, 2023

@m2-assistant

Hi @elzekool. Thank you for your report.
To speed up processing of this issue, 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:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 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.

elzekool

elzekool commented on Jul 24, 2023

@elzekool
ContributorAuthor

@magento give me 2.4-develop instance

magento-deployment-service

magento-deployment-service commented on Jul 24, 2023

@magento-deployment-service

Hi @elzekool. Thank you for your request. I'm working on Magento instance for you.

elzekool

elzekool commented on Jul 24, 2023

@elzekool
ContributorAuthor

Could reproduce in vanilla environment.

Setup:

  • Created additional storeview (nb: this is to explain use case, it is not a prerequisite)
  • Setup integration

State before:

The color attribute in the sample data contains swatches by default. Currently labels for the default store and the new store are empty.
image

Request:

PUT https://dd4f397647dbb146742b0032e3d8edc8.instances-prod.magento-community.engineering/rest/all/V1/products/attributes/color/options/49

{
  "option": {
    "label": "Black",
    "sort_order": 0,
    "store_labels": [
      {
        "label": "Black",
        "store_id": 0
      },
      {
        "label": "Black",
        "store_id": 1
      },
      {
        "label": "Zwart",
        "store_id": 2
      }
    ]
  }
}

Result

Note that now the swatch is removed for the "Black" attribute. Where it is expected that the current swatch value remains as-is.
image

self-assigned this
on Jul 25, 2023
m2-assistant

m2-assistant commented on Jul 25, 2023

@m2-assistant

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).
    2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    4. Verify that the issue is reproducible on 2.4-develop branch
    Details- 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 label Reproduced 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

engcom-Bravo commented on Jul 25, 2023

@engcom-Bravo
Contributor

Hi @elzekool,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.

Steps to reproduce

  • Make sure that you have an attribute with a visual swatch (in default example this is color)
  • Update option value through REST API /rest/all/V1/products/attributes/[attribute_code]/options/[option_id] (for example to update translations)
Screenshot 2023-07-25 at 5 08 51 PM Screenshot 2023-07-25 at 5 08 42 PM

When we are updating Values of Your Attribute through Rest Api the swatch is getting crossed out.

Hence Confirming the issue.

Thanks.

added
Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch
Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Priority: P2A defect with this priority could have functionality issues which are not to expectations.
on Jul 25, 2023

11 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: APIsComponent: AttributesIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @elzekool@piuga@engcom-Bravo@github-jira-sync-bot

        Issue actions

          Visual Swatch is deleted when updating option through REST API · Issue #37794 · magento/magento2