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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

quietone’s picture

A simple patch with a test.

The last submitted patch, 2: 3270564-2-fail.patch, failed testing. View results

mikelutz’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: 3270564-2.patch, failed testing. View results

quietone’s picture

Status: Needs work » Reviewed & tested by the community

Failure in Drupal\Tests\quickedit\FunctionalJavascript\QuickEditFileTest::testRemove, restoring RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: 3270564-2.patch, failed testing. View results

quietone’s picture

Status: Needs work » Reviewed & tested by the community

Failure 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

  • catch committed 36a579e on 10.0.x
    Issue #3270564 by quietone: Handle NULL for data blob in User source...
  • catch committed c8b2c11 on 10.1.x
    Issue #3270564 by quietone: Handle NULL for data blob in User source...
  • catch committed 7190a52 on 9.4.x
    Issue #3270564 by quietone: Handle NULL for data blob in User source...
  • catch committed a59f520 on 9.5.x
    Issue #3270564 by quietone: Handle NULL for data blob in User source...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x, cherry-picked back through to 9.4.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.