Magento2: Group_Id set to default if saving account information

Created on 18 Feb 2020  路  21Comments  路  Source: magento/magento2

Preconditions (*)

  1. Magento 2.3.4

Steps to reproduce (*)

  1. Create a user account
  2. Change customer group to differnent than default group
  3. Login with user account
  4. Save contact information in customer account

Expected result (*)

  1. Contact information are saved and the customer is still assigned to the assigned customer group

Actual result (*)

  1. Contact information are saved but the customer account is now assigned to the default customer group

https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Customer/Model/CustomerExtractor.php#L88

Related: https://github.com/magento/magento2/pull/23764

User Clear Description Confirmed Format is valid Ready for Work P3 done Reported on 2.3.4 S3 Done

Most helpful comment

For anyone looking for a quick fix to this;

File: Magento\Customer\Model\CustomerExtractor

Line 83'ish, change;

$isGroupIdEmpty = !isset($allowedAttributes['group_id']);

To;

$isGroupIdEmpty = !isset($customerData['group_id']);

All 21 comments

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

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

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.

@reply-jpetersen do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

@magento give me 2.4-develop instance

Hi @reply-jpetersen. Thank you for your request. I'm working on Magento 2.4-develop instance for you

Hi @reply-jpetersen, here is your Magento instance.
Admin access: https://i-26908-2-4-develop.instances.magento-community.engineering/admin_7dcc
Login: ecc0db69 Password: 8c0b63e2f449
Instance will be terminated in up to 3 hours.

Hi @krishprakash. 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:

  • [x] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [x] 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.

  • [x] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [x] 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_!

  • [x] 5. Add label Issue: Confirmed once verification is complete.

  • [x] 6. Make sure that automatic system confirms that report has been added to the backlog.

:white_check_mark: Confirmed by @krishprakash
Thank you for verifying the issue. Based on the provided information internal tickets MC-31656 were created

Issue Available: @krishprakash, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

Same problem exists in the adminhtml_customer form, btw...

@sdzhepa what about this pull request? I can confirm the issue exists and @vishal-7037 patch resolves it. Problem seems to be relevant to 2.4-develop branch and looks like it was caused by ENGCOM-5728 https://github.com/magento/magento2/commit/c5c5f393814e3a89a4f0e0e880a50c8b0dfdc479

This is also reproduced in Magento 2.3.5, FYI.

@magento give me 2.4-develop instance

Hi @CarmineDamore78. Thank you for your request. I'm working on Magento 2.4-develop instance for you

Hi @CarmineDamore78, here is your Magento instance.
Admin access: https://i-26908-2-4-develop.instances.magento-community.engineering/admin_cc0f
Login: 80035028 Password: f3429e277c7c
Instance will be terminated in up to 3 hours.

@magento, @magento-admin The issue is not reproducible on M2.4-develop

For anyone looking for a quick fix to this;

File: Magento\Customer\Model\CustomerExtractor

Line 83'ish, change;

$isGroupIdEmpty = !isset($allowedAttributes['group_id']);

To;

$isGroupIdEmpty = !isset($customerData['group_id']);

@magento give me 2.4-develop instance

Hi @AbdulRahmanAbouzaid. Thank you for your request. I'm working on Magento 2.4-develop instance for you

The issue is not reproducible on M2.4-develop

It is closed but still present in 2.4.0.
For a B2B but also a general webshop this has quite bad implications.

Still present in 2.4.0.

@lewisvoncken: the PR you reference got closed because they said it was fixed in MC-33554: B2B - Customer Group Resets to Default (General) whenever the customer saves their account which is included in Magento 2.4.1

Can you confirm that the issue got fixed in 2.4.1 ?

Was this page helpful?
0 / 5 - 0 ratings