Move I18nQueryTrait from content_translation to migrate_drupal

Created on 14 January 2022, over 2 years ago
Updated 3 June 2024, 24 days ago

Problem/Motivation

Drupal\content_translation\Plugin\migrate\source\I18nQueryTrait is also used in multiple migrate source plugins of other modules (e.g. Drupal\block_content\Plugin\migrate\source\d7\BlockCustomTranslation). This may make sense as translations usually require to have content_translation enabled. However it prevents e.g. the type checking of such plugins without instantiating them, as done in https://www.drupal.org/project/entity_import β†’ , Drupal\entity_import\EntityImportSourceManager::getDefinitions().

Steps to reproduce

  • Install Drupal standard installation profile in English, make sure content_translation is not enabled
  • Install migrate_drupal module
  • Install https://www.drupal.org/project/entity_import β†’
  • Login in and go to /admin/config/system/entity-importer/add (Content > Importers > entity importer creation page)

Instead of displaying a form to add an entity importer, the following fatal error occurs:

Trait 'Drupal\content_translation\Plugin\migrate\source\I18nQueryTrait' not found in /var/www/html/web/core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustomTranslation.php on line 22

Proposed resolution

I18nQueryTrait is used for source plugins that require migrate_drupal. So, move it and the source plugins to migrate_drupal. This is on MR 7616

I18nQueryTrait is used in the context of migrations and the migrate module already contains Drupal\migrate\Plugin\migrate\source\DummyQueryTrait. Hence it seems reasonable to move Drupal\content_translation\Plugin\migrate\source\I18nQueryTrait to Drupal\migrate\Plugin\migrate\source\I18nQueryTrait in order to avoid unnecessary dependencies.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
MigrationΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¨πŸ‡­Switzerland boromino

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

Merge Requests

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.69.0 2024