Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customer objects are equal to eachother after observing event customer_save_after_data_object #7915

Closed
anthonycouckhuyt opened this issue Dec 21, 2016 · 5 comments
Assignees
Labels
bug report Component: Customer Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@anthonycouckhuyt
Copy link

Preconditions

  1. Magento CE 2.1.2 without sample data is installed.
  2. Running on Linux Webserver with PHP 7, MySQL 5.0.12

Steps to reproduce

  1. Log in with existing user in frontend.
  2. Change first name of customer to 'test35'.
  3. Observe the event 'customer_save_after_data_object'. Two objects are given called : 'orig_customer_data_object' & 'customer_data_object'.
  4. Those two objects are identical to each other. First name in both objects is equal to 'test35'

Expected result

  1. 'customer_data_object' firstname should not be equal to 'orig_customer_data_object'

Actual result

  1. orig_customer_data_object and customer_data_object are equal to each other
    Screenshot here: http://imgur.com/a/IDV1t

This also happens with last name and email. There may be more, but I haven't checked.

@medinadato
Copy link

medinadato commented Mar 27, 2017

The problem here is a bug in the file vendor/magento/module-customer/Model/ResourceModel/CustomerRepository.php line 227. See below:

['customer_data_object' => $savedCustomer, 'orig_customer_data_object' => $customer]

It should be:

['customer_data_object' => $savedCustomer, 'orig_customer_data_object' => $prevCustomerData]

Until Magento Team fixes it, you should overwrite the method to fix the issue. I've written a how to here https://blog.mdnsolutions.com/magento-2-customer_save_after_data_object-equal-objects/

Cheers,

@magento-engcom-team magento-engcom-team added 2.1.x bug report Component: Customer Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Sep 11, 2017
@magento-engcom-team
Copy link
Contributor

@Koekoet, thank you for your report.
We've created internal ticket(s) MAGETWO-81900 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Oct 13, 2017
okorshenko pushed a commit that referenced this issue Oct 24, 2017
…bserving event customer_save_after_data_object #11649

 - Merge Pull Request #11649 from RomaKis/magento2:7915
 - Merged commits:
   1. d22516d
   2. 0c0fcbf
okorshenko pushed a commit that referenced this issue Oct 24, 2017
…bserving event customer_save_after_data_object #11649
okorshenko pushed a commit that referenced this issue Oct 24, 2017
#11546 Add AuthenticationInterface to the public API by @navarr
#11659 [TASK] Removed Typo in Paypal TestCase didgit => digit by @lewisvoncken
#11649 #7915: customer objects are equal to eachother after observing event customer_save_after_data_object by @RomaKis
#11587 #11586 Fix duplicated crontab 2>&1 expression by @adrian-martinez-interactiv4
#11609 Fix a typo by @ajpevers
#11582 M2 11581 by @tzyganu
#11452 #11328 : app:config:dump adds extra space every time in multiline array value by @adrian-martinez-interactiv4
#11457 Added carrier code to ID to distinguish shipping methods [port 2.3] by @peterjaap
#10769 Fix: Keep packages sorted by @localheinz
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-82529

@RomaKis RomaKis self-assigned this Oct 24, 2017
okorshenko pushed a commit that referenced this issue Oct 25, 2017
…bserving event customer_save_after_data_object #11676

 - Merge Pull Request #11676 from RomaKis/magento2:7915-2.2
 - Merged commits:
   1. 0055fb8
   2. cfdc0d7
okorshenko pushed a commit that referenced this issue Oct 25, 2017
…bserving event customer_save_after_data_object #11676
@okorshenko
Copy link
Contributor

The issue has been fixed in 2.2-develop branch

@okorshenko okorshenko added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Oct 25, 2017
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-82652

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Customer Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

7 participants