Skip to content

Unable to clear wishlist item comment via updateProductsInWishlist GraphQL mutation #39911

Open
@Syamsg

Description

@Syamsg

Preconditions and environment

  1. Magento Open Source 2.4.7 (or your version)
  2. PHP 8.1 (or 8.2)
  3. Sample data installed, GraphQL module enabled
  4. A customer with at least one wishlist item that already has a non-empty description field

Steps to reproduce

  1. Authenticate as that customer and obtain a valid bearer token.
  2. Send this GraphQL mutation:

`

mutation {
  updateProductsInWishlist(
    wishlistId: "1",
    wishlistItems: [
      {
        wishlist_item_id: "1",
        quantity: 2,
        description: ""
      }
    ]
  ) {
    wishlist {
      id
      items {
        id
        description
        product { name }
      }
    }
  }
}`

### Expected result

The description (comment) on wishlist item 1 should be cleared (i.e. set to null or an empty string) in the database, and the GraphQL response should show either:

"description": null or "description": ""

### Actual result

The GraphQL response still returns the old, non-empty description.
Reviewing the database, the wishlist_item.comment column remains unchanged.

{
"data": {
 "updateProductsInWishlist": {
   "wishlist": {
     "items": [
       {
         "id": "1",
         "description": "My original comment",
         "product": {
           "name": "24-MB01"
         }
       }
     ]
   }
 }
}
}

### Additional information

_No response_

### Release note

_No response_

### Triage and priority

- [x] 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, “qualityorusability”._

Activity

m2-assistant

m2-assistant commented on May 13, 2025

@m2-assistant

Hi @Syamsg. 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.


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.

m2-assistant

m2-assistant commented on May 13, 2025

@m2-assistant

Hi @engcom-November. 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- 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-November

engcom-November commented on May 14, 2025

@engcom-November
Contributor

Hello @Syamsg ,

Thank you for your report and collaboration.

We attempted to reproduce the issue in the latest 2.4-develop instance. We are able to reproduce the issue. Please refer to the attached screenshot for details.

Image

Steps to Reproduce:

  • Authenticate as that customer and obtain a valid bearer token.
  • Send this GraphQL mutation:
mutation {
  updateProductsInWishlist(
    wishlistId: "1",
    wishlistItems: [
      {
        wishlist_item_id: "1",
        quantity: 2,
        description: ""
      }
    ]
  ) {
    wishlist {
      id
      items {
        id
        description
        product { name }
      }
    }
  }
}

We followed the preconditions and steps as provided and encountered the issue.

Therefore, we are marking this ticket as "Issue: Confirmed."

Thank you!

github-jira-sync-bot

github-jira-sync-bot commented on May 14, 2025

@github-jira-sync-bot

✅ Jira issue https://jira.corp.adobe.com/browse/AC-14682 is successfully created for this GitHub issue.

m2-assistant

m2-assistant commented on May 14, 2025

@m2-assistant

✅ Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

KrasnoshchokBohdan

KrasnoshchokBohdan commented on May 22, 2025

@KrasnoshchokBohdan
Contributor

@engcom-November @Syamsg
I checked this issue, and in my opinion, the problem is with the wishlist_item_id parameter.

Screenshot from comment:#39911 (comment)

Image

In the request, wishlist_item_id: "1", but in the response, wishlist_item_id: "5".

In this situation, we don't have $wishlistItemToUpdate in:
\Magento\WishlistGraphQl\Model\Resolver\UpdateProductsInWishlist::resolve
\Magento\WishlistGraphQl\Model\UpdateWishlistItem::execute

Image

However, if we set an existing wishlist_item_id (from the wishlist_item table):

Image

Everything looks OK. Please correct me if I misunderstood something.

engcom-November

engcom-November commented on May 30, 2025

@engcom-November
Contributor

Hello @Syamsg ,

Could you please follow the steps provided above and let us know if the issue still persists?

Thank you!

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: AccountComponent: GraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Reported on 2.4.7Indicates 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

    Status

    Ready for Development

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @engcom-Bravo@engcom-November@github-jira-sync-bot@Syamsg@KrasnoshchokBohdan

      Issue actions

        Unable to clear wishlist item comment via `updateProductsInWishlist` GraphQL mutation · Issue #39911 · magento/magento2