Skip to content

[Backport] Set fallback values for email and _website columns to avoid 'undefined index' error in CustomerComposite.php #18681

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

Merged
merged 1 commit into from
Oct 29, 2018
Merged

[Backport] Set fallback values for email and _website columns to avoid 'undefined index' error in CustomerComposite.php #18681

merged 1 commit into from
Oct 29, 2018

Conversation

TomashKhamlai
Copy link
Contributor

@TomashKhamlai TomashKhamlai commented Oct 17, 2018

Original Pull Request

#18679

Description

There are proper validation messages for ERROR_CODE_COLUMN_NOT_FOUND and ERROR_CODE_COLUMN_NAME_INVALID but this code is not reachable.

Manual testing scenarios

  1. Create a Customer
  2. Navigate to Customers -> All Customers and export them all
  3. Navigate to System -> Import and use the CSV of all your customers. Use Add/Update behavior and "Customers and Addresses (single file)" as an entity type.

Expected result:
At least one of the two validation messages:

We can't find required columns: email", "_website.

Column names: "ID", "Name", "Email", "Group", "Phone", "ZIP", "Country", "State/Province", "Customer Since", "Web Site", "Confirmed email", "Account Created in", "Billing Address", "Shipping Address", "Date of Birth", "Tax VAT Number", "Gender", "Street Address", "City", "Fax", "VAT Number", "Company", "Billing Firstname", "Billing Lastname", "Account Lock" are invalid

Actual result:
Notice: Undefined index: email in /var/www/html/pr/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php on line 302

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@TomashKhamlai TomashKhamlai requested a review from sidolov October 17, 2018 21:33
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Oct 17, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @TomashKhamlai. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me $VERSION instance - deploy vanilla Magento instance

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

@rogyar
Copy link
Contributor

rogyar commented Oct 18, 2018

@magento-engcom-team give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

Hi @rogyar, here is your Magento instance.
Admin access: http://ec2-34-228-235-121.compute-1.amazonaws.com/i-18681-2-3-develop//admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@magento-engcom-team
Copy link
Contributor

Hi @TomashKhamlai. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants