Problem/Motivation
If one enables Responsive Images module, and tries to upgrate a Drupal 7 instance without the picture module's tables being available, an exception is thrown:
Migration failed with source plugin exception: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_blue.picture_mapping' doesn't exist: SELECT "p".*, "map"."sourceid1" AS "migrate_map_sourceid1", "map"."source_row_status" AS "migrate_map_source_row_status"\n
FROM\n
"picture_mapping" "p"\n
LEFT OUTER JOIN drupal_blue.migrate_map_d7_responsive_image_styles "map" ON machine_name = map.sourceid1\n
WHERE ("map"."sourceid1" IS NULL) OR ("map"."source_row_status" = :db_condition_placeholder_0); Array\n
(\n
[:db_condition_placeholder_0] => 1\n
)\n
in [docroot]/core/lib/Drupal/Core/Database/Driver/mysql/ExceptionHandler.php line 53'
This happens because the ResponsiveImageStyles
migrate source plugin extends SqlBase
instead of DrupalSqlBase, so the source module requirement aren't checked by Migrate Drupal's MigrationPluginManager.
Proposed resolution
ResponsiveImageStyles source plugin must extend DrupalSqlBase.
Remaining tasks
- Patch.
- Test.
User interface changes
Nothing.
API changes
ResponsiveImageStyles source plugin extends DrupalSqlBase (following Drupal's Migrate API best practices).
Data model changes
Nothing.