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

Backward compatibility provided by #19765 #23407

Closed
wants to merge 1 commit into from
Closed

Backward compatibility provided by #19765 #23407

wants to merge 1 commit into from

Conversation

Nazar65
Copy link
Member

@Nazar65 Nazar65 commented Jun 25, 2019

Description (*)

Current fixes still don't provide complete backward compatibility with code designed for Magento 2.0.X, 2.1.X, 2.2.X.
IMO it is not good at all to have any variables related to SKU in abstract entity code. In the best case new class must be implemented and extended from abstract entity.
In case it is impossible to achieve that, then it would be probably better to introduce one more variable to the constructor.

Fixed Issues (if relevant)

  1. Backward compatibility provided by #19765 #22761: Backward compatibility

Manual testing scenarios (*)

  1. Create a custom import adapter extending Magento\ImportExport\Model\Import\Entity\AbstractEntity
    (override 'uniqueField' to your unique field)
  2. Add valid columns in getValidColumnNames() function.
  3. e.g. ['column1', 'column2', 'column3']
  4. Create CSV file with columns stated above and add data.
  5. Go to System > Import
  6. Select your adapter from "Entity Type" dropdown
  7. Select your CSV file in "Select File to Import" field.
  8. Click on "Check Data" button
  9. CSV file should get validated if column and data are available

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)

@Nazar65 Nazar65 requested a review from sidolov June 25, 2019 19:05
@m2-assistant
Copy link

m2-assistant bot commented Jun 25, 2019

Hi @Nazar65. 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 give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

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

@VladyslavSikailo
Copy link
Contributor

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

Hi @Dren7755, here is your Magento instance.
Admin access: https://i-23407-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@orlangur orlangur self-assigned this Jun 26, 2019
@@ -408,8 +416,8 @@ protected function _saveValidatedBunches()
if ($source->valid()) {
try {
$rowData = $source->current();
if (array_key_exists('sku', $rowData)) {
$skuSet[$rowData['sku']] = true;
if ($this->uniqueField !== null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, revert array_key_exists check. We'll have undefined index error if $rowData does not contain $this->uniqueField field

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@sidolov
Copy link
Contributor

sidolov commented Aug 29, 2019

@Nazar65 , I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for the collaboration!

@sidolov sidolov closed this Aug 29, 2019
@m2-assistant
Copy link

m2-assistant bot commented Aug 29, 2019

Hi @Nazar65, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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.

5 participants