magento / data-migration-tool

Magento Data Migration Tool
https://devdocs.magento.com/guides/v2.3/migration/bk-migration-guide.html
Open Software License 3.0
334 stars 200 forks source link

In ErrorHandler.php line 61: Notice: Undefined offset: 138 in src/Migration/Step/Eav/Data.php on line 571 #859

Closed tim-breitenstein-it closed 3 years ago

tim-breitenstein-it commented 3 years ago

Preconditions

  1. Magento 2.4.2
  2. Magento 1.3.10
  3. PHP 7.4
  4. MariaDB 10.3.27

Steps to reproduce

  1. Install Magento 2.4.1
  2. Run bin/magento migrate:data

Expected result

  1. Successfully data migration

Actual result

  1. Error in [mode: data][stage: data migration][step: EAV Step]
[2020-12-02 16:45:49][INFO][mode: data][stage: data migration][step: EAV Step]: started
100% [============================] Remaining Time: < 1 sec
In ErrorHandler.php line 61:

  Notice: Undefined offset: 138 in /var/www/htdocs/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php on line 571

Additional notes

If we skip this

            if (isset($this->mapAttributeIdsDestOldNew[$record['attribute_id']])) {

in line L461 we need to skip this also in L571.

Solving this problem:

            foreach ($destinationRecords as $record) {
                if (!isset($this->mapAttributeIdsDestOldNew[$record['attribute_id']])) {
                    continue;
                }
                $record['attribute_id'] = $this->mapAttributeIdsDestOldNew[$record['attribute_id']];
                $destinationRecord = $this->factory->create([
                    'document' => $destinationDocument,
                    'data' => $record
                ]);
                $recordsToSave->addRecord($destinationRecord);
            }

skipping here also:

                if (!isset($this->mapAttributeIdsDestOldNew[$record['attribute_id']])) {
                    continue;
                }
m2-assistant[bot] commented 3 years ago

Hi @tim-breitenstein-it. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


tim-breitenstein-it commented 3 years ago

@magento I am working on this

m2-assistant[bot] commented 3 years ago

Hi @tim-breitenstein-it! :wave: Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

tim-breitenstein-it commented 3 years ago

@magento add to contributors team

m2-assistant[bot] commented 3 years ago

Hi @tim-breitenstein-it! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.