Fix Magento Product source plugin "all_sku"

Created on 19 April 2023, almost 2 years ago
Updated 27 April 2024, 9 months ago

Problem/Motivation

Out of the box ```Undefined array key "all_sku" Product.php:109``` and unusable

Steps to reproduce

* Enable `commerce_migrate_magento`
* List migrations `drush ms`
* Expected: List of site migrations installed (and maybe some example migrations from `commerce_migrate` suite)
* Instead: Gigantic error dump like:
```
[warning] Undefined array key "all_sku" Product.php:109
[error] TypeError: preg_grep(): Argument #2 ($array) must be of type array, null given in preg_grep() (line 110 of /app/web/modules/contrib/commerce_migrate/modules/magento/src/Plugin/migrate/source/m2/Product.php) #0 /app/web/modules/contrib/commerce_migrate/modules/magento/src/Plugin/migrate/source/m2/Product.php(110): preg_grep('/MSH02.*/', NULL)
#1 /app/web/modules/contrib/commerce_migrate/modules/magento/src/Plugin/migrate/source/m2/Product.php(71): Drupal\commerce_migrate_magento\Plugin\migrate\source\m2\Product->getVariations(Array)
#2 [internal function]: Drupal\commerce_migrate_magento\Plugin\migrate\source\m2\Product->getYield(Object(Generator))
#3 /app/web/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php(538): iterator_count(Object(Generator))
#4 /app/web/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php(509): Drupal\migrate\Plugin\migrate\source\SourcePluginBase->doCount()
#5 /app/web/modules/contrib/migrate_tools/src/Commands/MigrateToolsCommands.php(262): Drupal\migrate\Plugin\migrate\source\SourcePluginBase->count()
...
```

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Magento

Created by

πŸ‡ΊπŸ‡ΈUnited States texas-bronius

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024