Allow to avoid translation filtering

Created on 15 November 2022, about 2 years ago
Updated 27 October 2023, about 1 year ago

Problem/Motivation

I would like to have the option of avoiding the node translations filtering done in `src/Plugin/migrate/source/MediaEntityGeneratorD7.php:192`

$this->handleTranslations($query);

So, for example, if I am migrating the files from Drupal 7, I would like to get all the files that are referenced by a certain field. Without taking into account the language of the node that is making the reference.

Proposed resolution

Use the translation configuration key to allow the user to avoid the translation filtering.

    if (($this->configuration['translation'] ?? '') != 'all') {
      $this->handleTranslations($query);
    }
✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain unstatu

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.

  • πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine
  • πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine

    This is not only an issue for the D7 migration.
    For D9, there is also a case when you need to migrate all values regardless of language.
    This need arises when the default language of the entity may differ from the default language of the site.
    In this case, the easiest and most effective way is to migrate all files to the media entity, regardless of the language of translation.
    Since this solution is universal, I applied it to all cases when we migrate data with translations.

    How it works for now:
    - source_lang_code is required for the source plugin
    - langcode could be null - it means that we will migrate all files without translation filter
    - when langcode is null then source_lang_code will be used for migration rows

    P.S. Keeping a ticket in review status to allow someone else to review it. If the task remains unchanged for 2 weeks, the solution will be automatically added to the dev branch.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine
  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States ddavisboxleitner

    For anyone else who is updating their D9 site to D10 and ran into an error running 'drush migrate:status' :

    source_langcode configuration key should not be an empty

    Your existing migrations should be updated to include the source_langcode key in the source section.

Production build 0.71.5 2024