magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.47k stars 9.28k forks source link

Unique values are Duplicating when a Product is Duplicated #34328

Open TheRealHunzik opened 2 years ago

TheRealHunzik commented 2 years ago

Preconditions (*)

  1. Magento EE 2.3.4-p2, Magento 2.4-develop

Steps to reproduce (*)

  1. Created new attribute 'New Product Attribute' with Unique Value set to 'Yes'.
  2. Created product 'New Test Product' and assigned newly created attribute to it.
  3. Edited that product and clicked on 'Save & Duplicate' in which I got below error and success messages of saved product:
Screenshot 2021-10-14 at 2 07 57 PM
  1. Went back to Product list and found that same attribute got assigned to duplicated product irrespective of the error which got on saving.
Screenshot 2021-10-21 at 3 11 54 PM
  1. It should be noted that same behaviour can not be observed when you try to 'Save & Duplicate' the newly duplicated product. That time you get proper error like below:
Screenshot 2021-10-21 at 3 13 30 PM

Expected result (*)

  1. It Should Not duplicate and an error should appear that attribute value should be unique

Actual result (*)

  1. New Product is Created and Saved with the same Attribute Value

Additional Info (*)

During the detailed investigation, observed below info. Behaviour 1: If we have the unique attribute set to one product, and we try to save & duplicate to another product, we are able duplicate along with the message “The value of attribute(s) “New Product Attribute” must be unique”. Behaviour 2: Continuing to Behaviour 1, if we retry to save & duplicate the already duplicated product, then we are getting the proper error message saying “The value of the “New Product Attribute” isn’t unique. Set a unique value and try again.” Behaviour 3: If we try to save a new product using the attribute set that is marked with Unique Value where the value is already used, then also we get the proper error message saying “The value of the “New Product Attribute” isn’t unique. Set a unique value and try again.”.

After the discussion, concluded to below:

The outcome should be: the same value can’t be created for the same attribute through the creation/duplication of products. So Behaviour #1 is not acceptable Behaviour 2 & 3 are.. but we need better error messages.

A product should not be allowed to be saved if it uses a value of an attribute that another product uses and it’s free text. That is because each product defines another new value for the free-text attribute.

Wouldn’t say “” isn’t unique. Set a unique value and try again.”” Would say “the value already exist and has to be unique” – something like that

Also instead of “the value is already used” On behaviour 3, I would also say instead of “value used” something like “the value THE ACTUAL VALUE is already assigned to another product SKU” or “Name” “Set a unique value and try again” – this is good, but I would even include the value in the text.

We need to make this experience as less ambiguous as possible

We can collaborate with a technical writer for the right wording


Please provide Severity assessment for the Issue as a Reporter. This information will help during the Confirmation and Issue triage processes.

m2-assistant[bot] commented 2 years ago

Hi @TheRealHunzik. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

TheRealHunzik commented 2 years ago

@magento give me 2.3-develop instance

magento-deployment-service[bot] commented 2 years ago

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

magento-deployment-service[bot] commented 2 years ago

Hi @TheRealHunzik, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

m2-assistant[bot] commented 2 years ago

Hi @engcom-Lima. 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: :point_down:

engcom-Lima commented 2 years ago

Hi @TheRealHunzik,

Thank you for reporting the issue.

However I tried to reproduce this issue and got the error 'The value of attribute(s) "New Product Attribute" must be unique' instead while trying to Duplicate the product as you suggested. Please below below screenshot of the same:

Screenshot 2021-10-14 at 2 07 57 PM

Can you please check and confirm if this issue is reproducible on Magento 2.4-develop ? If yes, can you please provide more specific 'Steps to reproduce' so that I can follow the same. If you can share some screenshots of the issue, that would also be helpful.

Thanks

TheRealHunzik commented 2 years ago

@engcom-Lima please go back to product grid and add filter of specific attribute and value you will see two products

engcom-Lima commented 2 years ago

Hi @TheRealHunzik,

I am able to see duplicating the unique attributes even after getting error on the product saving page. Verified the issue and it is reproducible on Magento 2.4-develop.

Below are the steps of what I did:

  1. Created new attribute 'New Product Attribute' with Unique Value set to 'Yes'.
  2. Created product 'New Test Product' and assigned newly created attribute to it.
  3. Edited that product and clicked on 'Save & Duplicate' in which I got below error and success messages of saved product:
Screenshot 2021-10-14 at 2 07 57 PM
  1. Went back to Product list and found that same attribute got assigned to duplicated product irrespective of the error which got on saving.
Screenshot 2021-10-21 at 3 11 54 PM
  1. It should be noted that same behaviour can not be observed when you try to 'Save & Duplicate' the newly duplicated product. That time you get proper error like below:
Screenshot 2021-10-21 at 3 13 30 PM

So confirming this issue on the basis of above analysis.

github-jira-sync-bot commented 2 years ago

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-1535 is successfully created for this GitHub issue.

m2-assistant[bot] commented 2 years ago

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

engcom-Alfa commented 2 years ago

To check the required functional fix of the issue, the discussion has been taken forward to PO. Thanks for your patience!

engcom-Alfa commented 2 years ago

Updated additional info in the above issue description and hence removing the On Hold label. Thanks

IlyaCid commented 2 years ago

@magento I am working on this