Create a set of migration files to enable users to migrate Drupal 7 Contact to Drupal 8

CommentFileSizeAuthor
#85 2382703-85.patch23.19 KBphenaproxima
#83 2382703-82.patch21.95 KBphenaproxima
#73 2382703-73.patch17.79 KBphenaproxima
#69 2382703-69-EXPERIMENT.patch19.01 KBphenaproxima
#65 2382703-65-EXPERIMENT.patch19 KBphenaproxima
#62 2382703-62-EXPERIMENT.patch18.53 KBphenaproxima
#56 2382703-56.patch16.95 KBphenaproxima
#55 interdiff-2382703-52-55.txt1.8 KBquietone
#55 2382703-55.patch22.52 KBquietone
#52 interdiff-2382703-49-52.txt1.31 KBquietone
#52 2382703-52.patch22.7 KBquietone
#49 interdiff-2382703-46-49.txt2.21 KBquietone
#49 2382703-49.patch21.92 KBquietone
#46 2382703-46.patch21.66 KBquietone
#43 2382703-43.patch20.77 KBquietone
#41 2382703-41.patch14.05 KBphenaproxima
#39 2382703-39.patch11.61 KBphenaproxima
#37 interdiff-2382703-30-37.txt15.31 KBphenaproxima
#37 2382703-37.patch14.33 KBphenaproxima
#30 2382703-30.patch12.13 KBphenaproxima
#25 2382703-25.patch11.68 KBphenaproxima
#22 2382703-22.patch11.74 KBphenaproxima
#21 2382703-21.patch11.83 KBphenaproxima
#15 2382703-15.patch7.34 KBphenaproxima
#13 2382703-13.patch7.34 KBphenaproxima
#6 migration_files_for-2382703-6.patch799 bytesmiguelc303
#1 migration_files_for-2382703-1.patch1.66 KBmiguelc303
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

miguelc303’s picture

I did a patch to enable user to import Drupal 7 Contact in Drupal 8 following the same logic applied in Drupal 6 migrations files.

-enzo-’s picture

benjy’s picture

Category: Feature request » Task
Status: Active » Needs work
Issue tags: +Needs tests

Work on Drupal 7 is still a little quiet so thanks for making a start. This will require tests, there should be plenty of examples in core already.

-enzo-’s picture

@benjy correct I start because I don't see the options, so I'm working in a migrate my own website and creating the code necessary to do the job, I know tests are missing, but I'm tests are not my stuff. so I will add more changes waiting to someone contribute test.

hosef’s picture

Project: Drupal core » IMP
Version: 8.0.x-dev »
Component: migration system » Code

Moving to the IMP issue queue.

miguelc303’s picture

See parent issue #2181257: [meta] Variables to config migration [d7] for instructions.

benjy’s picture

miguelc303’s picture

-enzo-’s picture

Added organization support to Anexus IT

phenaproxima’s picture

Assigned: Unassigned » phenaproxima

Self-assigning -- let's bring it home!

-enzo-’s picture

@phenaproxima what does mean? what is the next step?

phenaproxima’s picture

@-enzo-, that's just an expression :) The next step is to write a passing automated test for the d7_contact_category migration, and add it to the patch in #6.

phenaproxima’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
7.34 KB

Added a test of the migration.

I also made the d6_contact_category source plugin into a generic contact_category source, since it's identical between D6 and D7 and it seems sad-making to not reuse that code.

phenaproxima’s picture

Project: IMP » Drupal core
Version: » 8.0.x-dev
Component: Code » migration system
Assigned: phenaproxima » Unassigned

Moving into the core issue queue so testbot will put the patch through its paces.

phenaproxima’s picture

FileSize
7.34 KB

Re-upping the patch so testbot will (hopefully) test it.

Status: Needs review » Needs work

The last submitted patch, 15: 2382703-15.patch, failed testing.

Status: Needs work » Needs review

phenaproxima queued 15: 2382703-15.patch for re-testing.

The last submitted patch, 13: 2382703-13.patch, failed testing.

The last submitted patch, 6: migration_files_for-2382703-6.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 15: 2382703-15.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
FileSize
11.83 KB

Fixed errors in the contact_category plugin's unit test.

phenaproxima’s picture

FileSize
11.74 KB

Minor test cleanup.

Status: Needs review » Needs work

The last submitted patch, 22: 2382703-22.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Postponed
phenaproxima’s picture

Status: Postponed » Needs review
FileSize
11.68 KB
dawehner’s picture

+++ b/core/modules/migrate_drupal/src/Tests/d7/MigrateContactCategoryTest.php
@@ -0,0 +1,62 @@
+/**
+ * Migrate contact categories to contact.form.*.yml.
+ *
+ * @group migrate_drupal 7.x
+ * @dumpFile d7/Contact.php
+ * @migration d7_contact_category
+ */
+class MigrateContactCategoryTest extends MigrateDrupal7TestBase {

Is it intended to lose d6 test coverage?

benjy’s picture

Status: Needs review » Needs work

Yeah that doesn't seem right.

phenaproxima’s picture

Status: Needs work » Needs review

What? There are two distinct tests of this migration: src/Tests/d6/MigrateContactCategoryTest.php and src/Tests/d7/MigrateContactCategoryTest.php. The former one is already in HEAD, though, so this patch adds the latter one.

benjy’s picture

Ah right, the diff was confusing, bit clearer once I actually applied it. I checked the D7 contact module and the fields are the same so I think this is good apart from a few small bits:

  1. +++ b/core/modules/migrate_drupal/src/Tests/d7/MigrateContactCategoryTest.php
    @@ -0,0 +1,62 @@
    +  protected function assertEntity($id, $expected_label, array $expected_recipients, $expected_reply, $expected_weight) {
    

    Missing function doc.

  2. +++ b/core/modules/migrate_drupal/src/Tests/d7/MigrateContactCategoryTest.php
    @@ -0,0 +1,62 @@
    +    $this->assertEqual($expected_reply, $entity->getReply());
    

    Why is this assertEqual when surrounded by assertIdentical's?

  3. +++ b/core/modules/migrate_drupal/tests/src/Unit/source/ContactCategoryTest.php
    @@ -0,0 +1,74 @@
    +      'plugin' => 'd6_contact_category',
    

    This is contact_category now?

phenaproxima’s picture

FileSize
12.13 KB

Fixed. Regarding #3 -- yes, I've renamed the plugin since the functionality is identical.

Status: Needs review » Needs work

The last submitted patch, 30: 2382703-30.patch, failed testing.

Status: Needs work » Needs review

phenaproxima queued 30: 2382703-30.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 30: 2382703-30.patch, failed testing.

Status: Needs work » Needs review

phenaproxima queued 30: 2382703-30.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 30: 2382703-30.patch, failed testing.

Status: Needs work » Needs review

phenaproxima queued 30: 2382703-30.patch for re-testing.

phenaproxima’s picture

Status: Needs review » Needs work

The last submitted patch, 37: 2382703-37.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
FileSize
11.61 KB

Whoops.

Status: Needs review » Needs work

The last submitted patch, 39: 2382703-39.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
FileSize
14.05 KB

Re-rolling again.

quietone’s picture

Assigned: Unassigned » quietone

Nearly finished rerolling but too late to continue.

quietone’s picture

Reroll

quietone queued 43: 2382703-43.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 43: 2382703-43.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
FileSize
21.66 KB

No interdiff due to changes in Variable.php

Status: Needs review » Needs work

The last submitted patch, 46: 2382703-46.patch, failed testing.

The last submitted patch, 46: 2382703-46.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
FileSize
21.92 KB
2.21 KB

This should fix d7/MigrateContactSettingsTest but not the other errors. And it is too late to continue.

Status: Needs review » Needs work

The last submitted patch, 49: 2382703-49.patch, failed testing.

The last submitted patch, 49: 2382703-49.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
FileSize
22.7 KB
1.31 KB

Putting the schema in the correct file definitely helps.

Status: Needs review » Needs work

The last submitted patch, 52: 2382703-52.patch, failed testing.

The last submitted patch, 52: 2382703-52.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
FileSize
22.52 KB
1.8 KB

Looks like it was some overzealous editing.

phenaproxima’s picture

A few fixes...

Status: Needs review » Needs work

The last submitted patch, 56: 2382703-56.patch, failed testing.

The last submitted patch, 56: 2382703-56.patch, failed testing.

Status: Needs work » Needs review

phenaproxima queued 56: 2382703-56.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 56: 2382703-56.patch, failed testing.

The last submitted patch, 56: 2382703-56.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
FileSize
18.53 KB

@mikeryan tells me that the failures in #59 have to do with the beta update path. So this patch is an experiment to see if adding an update function to Contact will fix the failures...

Status: Needs review » Needs work

The last submitted patch, 62: 2382703-62-EXPERIMENT.patch, failed testing.

quietone’s picture

Assigned: quietone » Unassigned

I meant to mark this unassigned after doing a reroll 3 weeks ago.

phenaproxima’s picture

Status: Needs work » Needs review
FileSize
19 KB

Another experiment.

Status: Needs review » Needs work

The last submitted patch, 65: 2382703-65-EXPERIMENT.patch, failed testing.

The last submitted patch, 62: 2382703-62-EXPERIMENT.patch, failed testing.

The last submitted patch, 65: 2382703-65-EXPERIMENT.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
FileSize
19.01 KB

Yet another experiment, suggested by @gábor-hojtsy -- trying to see if calling save(TRUE) in the update function will avoid these maddening schema errors.

Status: Needs review » Needs work

The last submitted patch, 69: 2382703-69-EXPERIMENT.patch, failed testing.

The last submitted patch, 69: 2382703-69-EXPERIMENT.patch, failed testing.

benjy’s picture

+++ b/core/modules/contact/contact.install
@@ -0,0 +1,38 @@
+function contact_update_8001() {

Surely we don't provide update paths for migrations just yet?

As to the schema errors, could it be possible migrate isn'e enabled?

phenaproxima’s picture

Re-rolled and removed the update path hook.

Status: Needs review » Needs work

The last submitted patch, 73: 2382703-73.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Postponed

Postponing on #2569469: [Policy, no patch] No need to provide an upgrade path for Migrations and potentially #2569605: Remove migrations from update path test fixtures, since they need to be resolved before these tests will pass.

Status: Postponed » Needs work

The last submitted patch, 73: 2382703-73.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Postponed

Nuh-uh.

phenaproxima’s picture

Status: Postponed » Needs review

Unblocked!

phenaproxima queued 73: 2382703-73.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 73: 2382703-73.patch, failed testing.

phenaproxima’s picture

Issue tags: +Needs reroll

The last submitted patch, 73: 2382703-73.patch, failed testing.

phenaproxima’s picture

Status: Needs review » Needs work

The last submitted patch, 83: 2382703-82.patch, failed testing.

phenaproxima’s picture

I'm fixin' to fix them test failures...

neclimdul’s picture

Status: Needs review » Reviewed & tested by the community

Applied and looked at it with git diff -M and mostly moves. New tests look good. Lets do it.

The last submitted patch, 83: 2382703-82.patch, failed testing.

  • webchick committed 8095ded on 8.0.x
    Issue #2382703 by phenaproxima, quietone, miguelc303, benjy: Migration...
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.0.x. Thanks!

Status: Fixed » Closed (fixed)

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