MigrationPluginManager::getDefinitions() blows up in node derivers

Created on 23 November 2016, about 8 years ago
Updated 11 September 2023, over 1 year ago

Problem/Motivation

Calling MigrationPluginManager::getDefinitions() when the migrate_drupal module is enabled and no connection is defined for the drupal migrations, we get ConnectionNotDefinedException from the node derivers, and thus get no migrations back (even the ones that are fine). This happens because the derivers execute the node_type source plugin - with no explicit database connection configured, SqlBase attempts to use a connection named 'migrate' and if no such connection exists ConnectionNotDefinedException is thrown.

Proposed resolution

When SqlBase falls back to attempting the 'migrate' connection, the lack of such a connection should be treated as a RequirementsException rather than allowing ConnectionNotDefinedException to propagate. SqlBase should also implement RequirementsInterface, which should throw RequirementsException in this instance. And, the node derivers should check the requirements on the node_type migration and return without deriving any node migrations when the requirements are not met.

Remaining tasks

Extract the relevant parts of the patch in #2700693: [meta] Make MigratePluginManager::getDefinitions() work cleanly with migrate_drupal enabled β†’ .

User interface changes

N/A

API changes

getDatabase() will now throw RequirementsException in the absence of a configured database connection.

SqlBase and all derived source plugins will implement RequirementsInterface, and thus checkRequirements() will now be available on all such source plugins.

Data model changes

N/A

πŸ› Bug report
Status

Fixed

Version

8.3 ⚰️

Component
MigrationΒ  β†’

Last updated 24 minutes ago

Created by

πŸ‡ΊπŸ‡ΈUnited States mikeryan Murphysboro, IL, USA

Live updates comments and jobs are added and updated live.
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