Undefined array key "inspections" and "source_operations"

Created on 25 October 2023, almost 2 years ago
Updated 17 December 2023, almost 2 years ago

Problem/Motivation

Before version 8.x-2.7 having no inspections key under an operation: get_field entry, or no source_operations key under the top level migration_tools key would not prevent a migration from running. Since 2.7 these conditions result in the following warnings:

Warning: Undefined array key "inspections" in Drupal\migration_tools\Operations::process() (line 116 of /var/www/web/modules/contrib/migration_tools/src/Operations.php)

and

Warning: Undefined array key "source_operations" in Drupal\migration_tools\Operations::process() (line 73 of /var/www/web/modules/contrib/migration_tools/src/Operations.php)

respectively. The migrations then fail.

Steps to reproduce

Make a migration_tools migration with no source_operations key.

Make a migration_tools migration with no inspections key inside an operation: get_field.

Proposed resolution

Gracefully handle these missing array keys.

We have addressed this for now by adding source_operations: null and inspections: { } where needed.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.7

Component

Code

Created by

🇺🇸United States msielski

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024