- Issue created by @naveed_jadoon
In the ignored product variation, the commerce_price array only has fraction_digits without amount and currency_code, which are essential for the price field. The successful migration has a complete commerce_price array including amount, currency_code, and data.
and i can see these values in d7 DB the screenshots are attached for the ignored product, but still the migration ignore this- Status changed to Needs work
9 months ago 10:09pm 19 March 2024 I’m facing a series of issues during the Drupal 7 commerce migration, specifically related to node-type products and the migration process. Here are the details:
In Drupal 7, the product type is referenced in the content type correctly. However, during the migration D9, the field instance is incorrectly referencing a content type instead of the expected product reference.
When I initiate the migration using the command --execute-dependencies, the process halts with the following error messages
when it reachesupgrade_commerce1_product_variation_product
Undefined array key 0 in ProductVariations.php:70
[warning] Trying to access array offset on the value of type null in ProductVariations.php:70
[error] TypeError: Argument #1 ($currencyCode) must be of type string, null given in CurrencyRepository.php:79The migration also ignores the upgrade_commerce1_product_attribute This indicates that the “currency code” isn’t being recognized, and skips all other product variations field data.
After some research, I discovered a related issue on Drupal.org ( https://www.drupal.org/project/commerce_migrate/issues/2959614 🐛 Products displays Nodes Needs work ) and applied the latest patch. However, attempting to run the command
drush migrate-upgrade --legacy-db-key=migrate --legacy-root=http://localhost/drupal7/ --configure-only results in an error about a missing use Drupal\migrate\MigrateException;
.Adding the missing line
use Drupal\migrate\MigrateException;
in MigratePrepareRow.php seemingly fixed that issue, but a new problem arose when I ran the command
drush migrate-upgrade --legacy-db-key=migrate --legacy-root=http://localhost/drupal7/ --configure-only
[warning] Undefined property: Drupal\commerce_migrate_commerce\EventSubscriber\MigratePrepareRow::$configuration in MigratePrepareRow.php:161
[error] A product variation type could not be determined for the product type: commerce_product_referenceThis suggests there’s still an unresolved issue with product variation types during migration.
- 🇳🇿New Zealand quietone
@naveed_jadoon, thanks for the report and the ongoing analysis!
There are two issues about the lack of a currency code, [3292930] and 🐛 commerce1 payment transaction with empty currency_code crashes migrate Needs review that may help. Having you input on the best way to solve that is welcome. I suggest asking in Drupal Slack, #migration or perhaps #commerce for support.
I have also changed the status. While I appreciate the challenges you are facing Drupal does have definitions for the various values in the issue meta data. There is information in the handbook for the the priority field → .