Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Getting this error while working on PHP8.1 compatibility in Commerce Migrate. See #3270534: Test failures with PHP 8.1.
1) Drupal\Tests\commerce_migrate_ubercart\Functional\uc7\MigrateUpgradeUbercart7Test::testMigrateUpgradeExecute
Exception: Deprecated function: unserialize(): Passing null to parameter #1 ($data) of type string is deprecated
Drupal\user\Plugin\migrate\source\d7\User->prepareRow()() (Line: 79)
I brought a plain D7 site, 7.90-dev, and created a user and then looked at the users table. And sure enough, there is a NULL. The migrate test fixtures do not have a entry in the users table where data is NULL.
MariaDB [db]> select uid,name,mail,data from users;
+-----+------+-------------------+------+
| uid | name | mail | data |
+-----+------+-------------------+------+
| 0 | | | NULL |
| 1 | x | admin@example.com | b:0; |
| 2 | test | test@example.com | NULL |
+-----+------+-------------------+------+
3 rows in set (0.00 sec)
Steps to reproduce
Proposed resolution
Make sure the unserialize is not sent a NULL.
Remaining tasks
Patch, review, commit.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Comment | File | Size | Author |
---|---|---|---|
#2 | 3270564-2.patch | 3.22 KB | quietone |
| |||
#2 | 3270564-2-fail.patch | 2.5 KB | quietone |
Comments
Comment #2
quietone CreditAttribution: quietone at PreviousNext commentedA simple patch with a test.
Comment #4
mikelutzLooks good.
Comment #6
quietone CreditAttribution: quietone at PreviousNext commentedFailure in Drupal\Tests\quickedit\FunctionalJavascript\QuickEditFileTest::testRemove, restoring RTBC
Comment #8
quietone CreditAttribution: quietone at PreviousNext commentedFailure was in unrelated test, Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayBlockFormTest::testEditModeEnableDisable which is not listed on #2829040: [meta] Known intermittent, random, and environment-specific test failures.
Restoring RTBC
Comment #10
catchCommitted/pushed to 10.1.x, cherry-picked back through to 9.4.x, thanks!