Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

quietone’s picture

Status: Active » Needs review
FileSize
5.63 KB
quietone’s picture

Added blank line after namespace in two files.

quietone’s picture

+++ b/core/modules/language/tests/src/Unit/Migrate/d6/NodeTranslationSettingsTest.php
@@ -0,0 +1,44 @@
+        'name' => 'language_content_type_article',
+        'value' => 'i:2;',

This should be a serialized string. My D6 test site and the D6 dump have, < s:1:"2"; >

quietone’s picture

Changed the value to string to match the source data.

quietone’s picture

How to run this test with PHP 5.5 & MySQL 5.5?

quietone’s picture

thx drumm for removing the test that was stuck in the queue.

This is really ready for review now.

Gábor Hojtsy’s picture

Issue tags: +D8MI, +language-content, +sprint
quietone’s picture

Issue tags: +migrate-d6-d8
Kristen Pol’s picture

Thanks for the patch! Here's some feedback:

  1. +++ b/core/modules/language/src/Plugin/migrate/source/d6/NodeTranslationSettings.php
    @@ -0,0 +1,67 @@
    +        // Trim off the language_content_type_ prefix.
    +        'node_type' => substr($row['name'], 22),
    

    Nitpick: Rather than use 22, I think it would be more clear to count the characters of the 'language_content_type_' string.

  2. +++ b/core/modules/language/src/Plugin/migrate/source/d6/NodeTranslationSettings.php
    @@ -0,0 +1,67 @@
    +      'value' => $this->t("Whether translation is enabled for the node type."),
    

    Nitpick: Use single quotes instead of double.

  3. +++ b/core/modules/language/src/Tests/Migrate/d6/MigrateNodeTranslationSettingsTest.php
    @@ -0,0 +1,49 @@
    + * Contains \Drupal\language\Tests\Migrate\d6\MigrateNodeTranslationSettingsTest.
    

    Nitpick: Over 80 characters.

  4. +++ b/core/modules/language/src/Tests/Migrate/d6/MigrateNodeTranslationSettingsTest.php
    @@ -0,0 +1,49 @@
    +
    +    // Translation is specifically disabled for the Company node type, so it
    +    // should not have any translation settings.
    +    $this->assertNull(ContentLanguageSettings::load('node.company'));
    

    Where is the Company node type defined? Perhaps this is leftover from some other code?

quietone’s picture

Thx for the review.

1. Changed.
2. Fixed.
3. I guess you are referring to line 5. If so, I'm not sure how to fix it. (Quick search of the standards and I didn't see it. Can do more , I have to catch a bus).
4. The Company node is in the Drupal 6 test fixture, migrate_drupal/tests/fixtures/drupal6.php, the source db for these tests.

And on looking at this again, I think the source_provider is wrong.

Kristen Pol’s picture

Wow! That was fast. :)

  1. Looks good!
  2. Thanks!
  3. Agreed. Since it's not obvious how to fit this in 80 characters unless moving the entire class path down, then it can stay as is.
  4. Ah! Thanks for pointing that out.

What's the best way to test this?

quietone’s picture

To test, I suppose you can run a full migration and then edit the article and company content types to see how the language settings are different.

And the source_provider is correct.

Kristen Pol’s picture

Thanks for the info. How does one "run a full migration"? :) I haven't done any migration testing before (though I've done migrations between Drupal to Drupal before... just not to D8 yet).

quietone’s picture

Start with a fresh D8, then install Drupal Upgrade. Then you can use the UI or drush. For the UI, go to /upgrade. For drush just use, drush migrate-upgrade --legacy-db-url=mysql://user:pass@12.34.56.78/d6db --legacy-root=http://myd6site.com .

To use the drupal6 test fixture as the source import it using db-tools. php core/scripts/db-tools.php import --database d6_connection core/modules/migrate_drupal/tests/fixtures/drupal6.php

Generating database fixtures for D8 Migrate tests has more info about working with the test fixture.

That should do it, I hope.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Status: Needs review » Needs work

The last submitted patch, 11: 2660028-11.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
FileSize
7.63 KB
4.94 KB

Reroll for 8.1.x

Status: Needs review » Needs work

The last submitted patch, 18: 2660028-18.patch, failed testing.

quietone’s picture

Ah, #18 is a bad patch, ignore it. (Where I work is full of interruptions and noise).

Try again.

quietone’s picture

Status: Needs work » Needs review
Gábor Hojtsy’s picture

Status: Needs review » Needs work

Hm, so what does this do that #2225271: Migrate content type language settings from Drupal 6 & 7 did not do? That one is marked fixed and it deals with 'language_content_type_' . $type and even i18n node type level settings. How is this different? :) That one landed on June 21st.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

maxocub’s picture

Issue summary: View changes
quietone’s picture

Status: Needs work » Closed (duplicate)

Yes, it does appear that #2225271: Migrate content type language settings from Drupal 6 & 7 takes care of migrating the node translation settings. Therefore, closing this as a duplicate.

Gábor Hojtsy’s picture

Issue tags: -sprint

Removing from sprint too.