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.

Home Page:http://www.magento.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can not update custom customer attribute value on customer edit page in admin

GrassH opened this issue · comments

Preconditions and environment

  • Magento CE 2.4.7

Please see the following code:

$this->storeManager->setCurrentStore($storeId);

$websiteId = $this->_storeManager->getStore()?->getWebsiteId();

$websiteId = $this->getWebsiteId();

Steps to reproduce

Create two websites: US and CA, US is default website, customer created by CA.

  1. Create a custom customer attribute (Test Attribute) in patch:
$this->customerSetup->addAttribute(
          Customer::ENTITY,
          'test_attribute',
          [
              'type' => 'varchar',
              'label' => __('Test Attribute'),
              'input' => 'text',
              'is_visible' => false,
              'required' => false,
              'user_defined' => true,
              'sort_order' => 999,
              'position' => 999,
              'visible_on_front' => false,
              'unique' => true,
              'system' => false,
              'global' => ScopedAttributeInterface::SCOPE_WEBSITE
          ]
  );

  $customerEntity = $this->customerSetup->getEavConfig()->getEntityType(Customer::ENTITY);
  $attributeSetId = $customerEntity->getDefaultAttributeSetId();
  $attribute = $this->customerSetup->getEavConfig()
      ->getAttribute(Customer::ENTITY, 'test_attribute')
      ->addData([
          'attribute_set_id' => $attributeSetId,
          'attribute_group_id' => $this->attributeSet->getDefaultGroupId($attributeSetId),
          'used_in_forms' => ['adminhtml_customer', 'customer_account_edit']
      ]);

$attribute->save();
  1. Go to customer edit page in admin
  2. Type some value to Test Attribute, e.g: test 1
  3. Click Save and Continue Edit, the value will be saved as test 1
  4. Type a new value to Test Attribute, e.g: test 2
  5. Click Save and Continue Edit, the value was expected to be "test 2", but the value is still "test 1"

image

Expected result

  1. Test Attribute value is updated to test 2

Actual result

  1. Test Attribute value is still test 1

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

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

Hi @engcom-Bravo,

This should not be labeled as a Dev.Experience. In fact the issue also exists in the commerce, the issue still occurs for admin user adding custom attribute from admin panel. This should be a bug.

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.

Hi @GrassH,

Thanks for your reporting and collaboration.

We have verified the issue in 2.4-develop instance and the issue is not reproducible.Kindly refer the attached video.

Screen.Recording.2024-05-17.at.12.51.06.mov

Test Attribute value is updated to test 2.

Could you please let us know if we are missing anything.

Thanks.

Hi @engcom-Bravo,

Thank you for your test. I tested on 2.4.7, and this issue has been fixed in 2.4-develop. The same issue is reported in #ACP2E-2791, I'm not sure if it is an internal ticket, I didn't find this ticket in the community. Please see 6db1257

Hi @GrassH,

Thanks for your update.

As I can see this issue got fixed in the scope of the internal Jira ticket ACP2E-2791 by the internal team
Related commits:https://github.com/search?q=repo%3Amagento%2Fmagento2+ACP2E-2791&type=commits

Thanks.