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

Attributes with dash in attribute codes give errors #578

Closed
peterjaap opened this issue Aug 21, 2018 · 1 comment
Closed

Attributes with dash in attribute codes give errors #578

peterjaap opened this issue Aug 21, 2018 · 1 comment

Comments

@peterjaap
Copy link

peterjaap commented Aug 21, 2018

Preconditions

  1. Magento 2.2.5
  2. DMT 2.2.5
  3. An attribute with attribute code containing a dash (in my case category-extra-image)

Steps to reproduce

  1. bin/magento migrate:data -r vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.9/config.xml.dist -a

Expected result

  1. The attribute should be migrated

Actual result

  [Exception]                                                                                                                                          
  Notice: Undefined index: 3-category in /data/client/magento2/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php on line 915  

Proposed solution

Limit the number of elements explode() returns to 2, causing the remainder of the attribute code to remain intact. So change line 909 to;

            list($entityTypeId, $attributeCodeDest) = explode('-', $keyOld, 2);

and line 916 to;

                list($entityTypeIdDest, $attributeCodeDest) = explode('-', $keyDest, 2);

This fixes the error and the attribute migrates correctly.

@victor-v-rad
Copy link
Collaborator

Hi @peterjaap

Sorry for late reply. Thank you for reporting this issue. Your solution looks good. Internal ticket MAGETWO-94410 to process it.

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

No branches or pull requests

2 participants