Skip to main content

When migrating a Magento 1.9 website to Magento 2.4.7-pt1 I encountered the error;

Deprecated Functionality: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /vendor/magento/data-migration-tool/src/Migration/Model/PasswordVerifier.php on line 55

This is a PHP version error, as the code errors on PHP 8.1 onwards. As Magento 2.4.7 requires a minimum of 8.1 to compile in SSH (the docs recommend 8.3) this error needed to be fixed or we had to use an older version of Magento 2.

Using Magento 2.3 or 2.4 doesn’t make things any easier as the Maria DB versions, Composer, PHP etc are also outdated. These options are often now removed from hosting platforms due to support and security concerns.

Magento 2 - Deprecated Functionality: explode()

So how do we fix explode(): Passing null to parameter

On line 55 of /vendor/magento/data-migration-tool/src/Migration/Model/PasswordVerifier.php

Change;

$hash = explode(‘:’, $hash)[0];

to;
$hash = explode(‘:’, $hash ?? “”)[0];

A simple Magento code fix, that will hopefully get you further along in your Magento migration.

If your migration stalls and doesn’t complete first time, you may see this error when rerunning the migration tool.

1062 Duplicate entry ‘9-product-details

Magento - Essex ecommerce design

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘9-product-details’ for key ‘EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE’c

Either restore your database back to before your migration attempt or run the following sql in your Magento 2 database.

DELETE FROM eav_attribute_set WHERE attribute_set_name != ‘Default’;

I hope these fixes help.

Andrew Taylor

A senior UI designer with over 25 years of web design and web development experience working for some of the largest companies in the UK. An expert in all things Magento and WordPress.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.