Problem / motivation

Drupal 7 has a contributed module Entity Translation which allows to have field level translations on fieldable entities. This capability has moved to core in Drupal 8.

The scope of this issue is

  • Migrate the actual translated data of the comment fields.

Remaining tasks

  • Write the patch
  • Review
  • Commit

Comments

maxocub created an issue. See original summary.

maxocub’s picture

Adding relation to meta.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.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

StatusFileSize
new40.64 KB
new15.3 KB
masipila’s picture

maxocub’s picture

Status: Needs work » Needs review
StatusFileSize
new25.39 KB

New patch. No interdiff because it needed a re-roll and a lot have changed since the last patch.

masipila’s picture

I'll do a proper review and manual test tomorrow morning my time, but spotted one nit at the first glance.

+++ b/core/modules/comment/src/Plugin/migrate/source/d7/CommentEntityTranslation.php
@@ -0,0 +1,103 @@
+/**
+ * Drupal 7 comment entity translation source from database.
+ */
+class CommentEntityTranslation extends FieldableEntity {

My default nit on API doc standards. Third person verb, please :)

Markus

masipila’s picture

And some more.

1. 
b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php
@@ -40,6 +42,7 @@ protected function setUp() {
+    $this->installEntitySchema('taxonomy_term')

Is this needed?

2. Typo

b/core/modules/content_translation/migrations/d7_comment_entity_translation.yml
new file mode 100644
index 0000000..9dea06c
--- /dev/null
+++ b/core/modules/content_translation/migrations/d7_comment_entity_translation.yml
@@ -0,0 +1,28 @@
+migration_dependencies:
+  kequired:
masipila’s picture

Status: Needs review » Needs work
maxocub’s picture

Status: Needs work » Needs review
StatusFileSize
new1.22 KB
new25.39 KB

Re #9: Done.
Re #10:

  1. Yes it is needed. Since Taxonomy is enabled and we are running the d7_entity_translation_settings migration, which adds the translation metadata columns to the entity tables, we need to install the taxonomy term schema.
  2. Done.
masipila’s picture

Status: Needs review » Reviewed & tested by the community

I spent the morning on testing and reviewing patch #12. My manual tests were quite extensive with inspections in both UI and database. My test site had English and Finnish enabled.

A. On one content type the comments had Entity Translation enabled together with Title, with additional language neutral and translatable fields.

  • I tested standalone comments in language neutral, Finnish, English. The language was correctly migrated in all of them.
  • I tested the actual Entity Translations of comments, including the 'published' and 'flag translations outdated' metadata. The translations and their metadata was correctly migrated.
  • Conclusion: test passed

B. I also manually tested that we are not causing regression (not that I would not trust our test coverage, but wanted to check this manually as well)

  • On another content type I did not have the Entity Translation / Title enabled.
  • I wanted to see that the comments and their languages were correctly migrated.
  • Results were as expected.
  • Conclusion: my manual regression test passed.

About the patch itself:

  • My earlier feedback in #9 and #10 has been addressed.
  • I read the whole patch again and could not find anything to complain.
  • The test coverage looks good to me.

Conclusion of the review and test: RTBC.

Great work @maxocub! These Entity Translation migrations are conceptually among the most complex ones we have but you mastered them perfectly. Woop, woop!

Cheers,
Markus

masipila’s picture

Status: Reviewed & tested by the community » Needs review

Actually, let's run the testbot still for PostgreSQL and SQLite just to be sure.

masipila’s picture

Status: Needs review » Reviewed & tested by the community

Tests are green also on PostgreSQL and SQLite. Back to RTBC.

  • catch committed e58d1de on 8.7.x
    Issue #2981000 by maxocub, masipila: Migrate Drupal 7 comment entity...
catch’s picture

Version: 8.7.x-dev » 8.6.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed e0ab51cf25 to 8.7.x and 4e430e94e5 to 8.6.x. Thanks!

  • catch committed 1855276 on 8.6.x
    Issue #2981000 by maxocub, masipila: Migrate Drupal 7 comment entity...

Status: Fixed » Closed (fixed)

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