Problem/Motivation

In order to migrate translations and any other i18n-type stuff, enabled languages must be migrated from Drupal 6 and 7 to configurable_language entities.

This blocks all other i18n work.

Proposed Resolution

Create a migration to do just that.

Remaining Tasks

Write, review, commit.

API/UI/Data Model Changes

None.

Commit Credit

This patch is an updated version of #2166875: Migrate D6 languages, so credit should be carried over from there. Suggested commit message:

Issue #2596793 by phenaproxima, penyaskito, weal, Sutharsan: Migrate legacy languages to configurable language entites

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Status: Active » Needs review
StatusFileSize
new5.81 KB

Status: Needs review » Needs work

The last submitted patch, 2: 2596793-2.patch, failed testing.

penyaskito’s picture

penyaskito’s picture

As you can see in the related issue, we agreed on adding English even when no English was visible, as it is not safe to assume that there is no content in English.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new6.54 KB
new2.76 KB

You SHALL pass!

phenaproxima’s picture

Issue summary: View changes
penyaskito’s picture

Status: Needs review » Needs work

Still needs #5.

penyaskito’s picture

Issue tags: +sprint

Adding to sprint, as it is actively worked.

xjm’s picture

Issue tags: -rc target triage +rc eligible

Today the D8 core committers agreed that patches that only change "Experimental" functionality (like Migrate) can be treated as "rc eligible" rather than rc targets. Reference: https://www.drupal.org/core/d8-allowed-changes#rc

svendecabooter’s picture

With the patch in #6, all languages get migrated, also the disabled ones.

I did some tests with a D6 site with Dutch and English nodes, even though the English language was disabled.
All languages get migrated to Drupal 8, and all nodes get the proper language assigned to them.

So I don't see why we'd need to extend the source plugin to explicitly add the English language.
Virtually any Drupal 6 and Drupal 7 site will have English in the languages table (be it disabled or enabled).
I don't think there are much uses cases where English wouldn't be available in the source data, since you'd have removed the "en" entry from your D6/D7 {languages} table then, and in the process probably corrupted your whole D6/D7 installation.

The migration experience might be a bit weird for people migrating a site that's for example only in French (French enabled, core English disabled). Their D8 site in French will suddenly also have English in their list of languages after migration, even though they might not expect it. But then it should only be a matter of removing English again, once they verified they truly have no English content on their site.

So the current state of things as far as I can see, with the patch in #6:
All languages (enabled & disabled) from D6/D7 get migrated to D8. Migrated content gets assigned the correct language. There is no data loss.
Possibly the "Problem/Motivation" for this issue needs to be altered, since it mentions migrating *enabled* languages, whereas the current patch migrates *all* languages.

Correct me if I'm wrong.

penyaskito’s picture

@svendecabooter The issue of not having English arise if you install D8 in another language. You won't have English on your site, but you will have content which may be English. That's why we decided to install English anyway.

For more info on disabled language, check Gábor's comment on https://www.drupal.org/node/2166875#comment-8706173

svendecabooter’s picture

With the patch in #6, you will have English installed in D8 after performing a migration, even if your D6 site has it disabled, and your D8 site is installed in another language (and hasn't activated English afterwards).

So all that's left to do is perhaps write additional tests for this?

svendecabooter’s picture

Status: Needs work » Needs review

More feedback welcome on this, so we can unblock the other i18n-migrate issues

The last submitted patch, 2: 2596793-2.patch, failed testing.

penyaskito’s picture

How can it be that English is in your site? I don't see that in the patch at #6.

svendecabooter’s picture

Because the English language (amongst potential others) gets selected by this query:

  public function query() {
    return $this->select('languages')->fields('languages');
  }

Or is there a situation where English would need to be migrated, but not be in the D6 / D7 {languages} table?

penyaskito’s picture

Status: Needs review » Reviewed & tested by the community

I tried with both d6 and d7 and you are right, English is there. I don't know why we added that there then.
So +1 to RTBC.

The last submitted patch, 2: 2596793-2.patch, failed testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 6: 2596793-6.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Reviewed & tested by the community

This is a CI failure, not a test error.

The last submitted patch, 2: 2596793-2.patch, failed testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 6: 2596793-6.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Reviewed & tested by the community

The last submitted patch, 2: 2596793-2.patch, failed testing.

  • webchick committed 9692d18 on 8.0.x
    Issue #2596793 by phenaproxima, penyaskito, svendecabooter: Migrate...
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Great to see that both D6/D7 code is the same here. :)

One thing we talked about was that the tests are located in the D6 directory, and that code will eventually go away. However, it should be possible at that time to do a find/replace for D6 MigrateBase to D7 MigrateBase if we detect that a migration uses both.

Committed and pushed to 8.0.x. Thanks!

gábor hojtsy’s picture

Issue tags: -sprint

Yay, good first step :)

  • webchick committed 9692d18 on 8.1.x
    Issue #2596793 by phenaproxima, penyaskito, svendecabooter: Migrate...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.