Problem/Motivation

\Drupal\field\Plugin\migrate\source\d6\Field::prepareRow() can cause deprecations on PHP 8.1 because it passes a NULL into a function that expects a string.

Steps to reproduce

Run \Drupal\Tests\field\Kernel\Plugin\migrate\source\d6\FieldInstanceOptionTranslationTest on PHP 8.1
https://3v4l.org/o1fO9

Proposed resolution

Ensure we have a string before passing to unserialize()

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3240186-2.patch832 bytesalexpott

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new832 bytes
alexpott’s picture

Issue summary: View changes
daffie’s picture

Status: Needs review » Reviewed & tested by the community

The patch does not change the value of $db_columns. The return value of unserialize() is: "In case the passed string is not unserializeable, false is returned". See: https://www.php.net/manual/en/function.unserialize.php
Looks good to me.

  • catch committed 0de357a on 9.3.x
    Issue #3240186 by alexpott, daffie: \Drupal\field\Plugin\migrate\source\...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0de357a and pushed to 9.3.x. Thanks!

Status: Fixed » Closed (fixed)

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