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\uc6\MigrateUpgradeUbercart6Test::testMigrateUpgradeExecute
Exception: Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
Drupal\field\Plugin\migrate\process\d6\FieldInstanceSettings->convertSizeUnit()() (Line: 80)

process\d6\FieldInstanceSettings->convertSizeUnit() is converting the max_filesize_per_file field setting which in the Ubercart database is a NULL. I then checked imagefield and it turns out that in Drupal 6 the setting max_filesize_per_file can be set to NULL so that case should be handled in core. See https://git.drupalcode.org/project/imagefield/-/blob/6.x-3.x/imagefield.....

Steps to reproduce

Proposed resolution

If max_filesize_per_file is NULL set it to an empty string.

Remaining tasks

Patch, review, commit.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Comments

quietone created an issue. See original summary.

quietone’s picture

Issue summary: View changes
Related issues: +#3270534: Test failures with PHP 8.1
StatusFileSize
new3.24 KB
new4.26 KB
quietone’s picture

Status: Active » Needs review
quietone’s picture

Title: \Drupal\field\Plugin\migrate\process\d6\FieldInstanceSettings::convertSizeUnit » Handle NULL for max_filesize_per_file in d6\FieldInstanceSettings::convertSizeUnit
quietone’s picture

StatusFileSize
new3.27 KB
new4.29 KB

Oops, cspell error.

The last submitted patch, 5: 3270556-5-fail.patch, failed testing. View results

mikelutz’s picture

Status: Needs review » Reviewed & tested by the community

Seems reasonable. Not sure why this sat at NR for so long...

The last submitted patch, 5: 3270556-5-fail.patch, failed testing. View results

mikelutz’s picture

Queuing the right patch for the testbot.

catch’s picture

Version: 10.0.x-dev » 9.4.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x, cherry-picked to 10.0.x, 9.5.x, 9.4.x, thanks!

  • catch committed 93ff7b2 on 10.0.x
    Issue #3270556 by quietone: Handle NULL for max_filesize_per_file in d6\...
  • catch committed 54816af on 10.1.x
    Issue #3270556 by quietone: Handle NULL for max_filesize_per_file in d6\...
  • catch committed 3f9da98 on 9.4.x
    Issue #3270556 by quietone: Handle NULL for max_filesize_per_file in d6\...
  • catch committed f2dfd3e on 9.5.x
    Issue #3270556 by quietone: Handle NULL for max_filesize_per_file in d6\...

Status: Fixed » Closed (fixed)

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