magento-lts icon indicating copy to clipboard operation
magento-lts copied to clipboard

Update Mage_Customer_Model_Convert_Parser_Customer method unparse()

Open matteorossi-thespacesm opened this issue 5 years ago • 2 comments

In class Mage_Customer_Model_Convert_Parser_Customer method unparse, a new CustomerAddress instance is fetched through a call to getCustomerAddressModel(), which in turn gets model instance from Mage::objects() cache.

Such pull request is proposing to bypass cache usage and create always a new CustomerAddress instance.

This is due to the fact that whenever a customer instance has empty field, such as custom customer fields which are not required, if the previous customer has a not empty value in such field, the previous value is exported even with the next customer, so it could be duplicated a number of times for any subsequent customer, until a new value is retrieved.

To test this, create a custom customer attribute with no required value, populate it for a customer and let it blank for subsequent customer. Create a dataflow including such attribute and try and export customers.

matteorossi-thespacesm avatar Sep 17 '20 14:09 matteorossi-thespacesm

Hi @matteorossi-thespacesm Thanks for the PR! Can you please describe the steps I can take to reproduce the issue this PR is fixing? Thanks a lot!

tmotyl avatar Sep 17 '20 15:09 tmotyl

Hello,

as I've stated in pull request description, you 'd have to:

  • populate a number of customers with not required attributes, some with random values, some leaving attribute blank
  • create a dataflow with attribute to export
  • export such dataflow

You'll see that previously populated values are propagated to customers which should have such attribute value blank.

Best Regards

Matteo Rossi

matteorossi-thespacesm avatar Sep 17 '20 15:09 matteorossi-thespacesm

I've tried some different things but I can't reproduce the problem, either on customer or customer_address, the data seems to be correct, any more info is apreciated but since it's a very old PR I'm closing it ATM.

fballiano avatar May 06 '23 16:05 fballiano