array_file STRING INTEGER warnings in d6_term_node migration

Created on 1 February 2018, almost 7 years ago
Updated 4 October 2023, about 1 year ago

The warning looks something like this:

 [ok] Running d6_term_node_revision:11
 [warning] array_flip(): Can only flip STRING and INTEGER values! EntityStorageBase.php:227
 [warning] array_flip(): Can only flip STRING and INTEGER values! EntityStorageBase.php:227
 [warning] array_flip(): Can only flip STRING and INTEGER values! EntityStorageBase.php:227
 [warning] array_flip(): Can only flip STRING and INTEGER values! EntityStorageBase.php:227
 [warning] array_flip(): Can only flip STRING and INTEGER values! EntityStorageBase.php:227
 [warning] array_flip(): Can only flip STRING and INTEGER values! EntityStorageBase.php:227
 [warning] array_flip(): Can only flip STRING and INTEGER values! EntityStorageBase.php:227

The cause is something like this. In the EntityRevision destination the following code resolves $entity_id to NULL.

      $entity_id = $row->getDestinationProperty($this->getKey('id'));
      $entity = $this->storage->load($entity_id);

EntityStorageBase has no validation on its input value so that NULL gets passed in an array to loadMultiple which does an array flip and we get the warning.

Now all of that technical bit is pretty straight forward, how we got there is a bit more confusing to me because the d6_term_node migration seems to be set up to skip empty values resolved for the nid field but that doesn't seem to be happening for some reason.

๐Ÿ› Bug report
Status

Needs work

Version

9.5

Component
Migrationย  โ†’

Last updated about 9 hours ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States neclimdul Houston, TX

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024