Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Rob C’s picture

Status: Active » Needs review
FileSize
7.22 KB
Rob C’s picture

Rob C’s picture

FreekVR’s picture

Status: Needs review » Needs work

Thanks, it looks good for the most part. A couple of improvements need to be made though.

The complete() and prepareRollback() should use code from the common class. Here's an example from node.inc.

  /**
   * @param $entity_id
   */
  public function prepareRollback($entity_id) {
    $common = new MigrateDefaultContentCommon();
    $common->rollbackEntity($entity_id, 'node');
 }

  /**
   * @param $entity
   * @param stdClass $source_row
   */
  public function complete($entity, stdClass $source_row)  {
    $common = new MigrateDefaultContentCommon();
    $common->completeEntity($entity, 'node');
  }

The 'addReference' and 'resolveReference' methods are now handled by the common class as well and should be removed.

Rob C’s picture

Status: Needs work » Needs review
FileSize
4.48 KB

It's getting smaller and smaller.

private $references removed.
->prepareRollback() replaced.
->complete() replaced.
->addReference() removed
->resolveReferences() removed.

And updated a comment added by the patch.

Rob C’s picture

idebr’s picture

Status: Needs review » Needs work
+++ b/entities/user.inc
@@ -0,0 +1,89 @@
+  /**
+   * @param $entity
+   * @param stdClass $source_row
+   */
+  public function complete($entity, stdClass $source_row)  {

This results in a notice on the Migrate dashboard:

Strict warning: Declaration of DefaultContentUserMigration::complete() should be compatible with DrupalUser7Migration::complete($account, $row)

idebr’s picture

Status: Needs work » Needs review
FileSize
570 bytes
5.87 KB

This patch fixes the notice on the Migrate dashboard.

  • FreekVR committed f2e99d9 on 7.x-1.x authored by Rob C
    Issue #2394133 by Rob C, idebr, FreekVR: Support user-account migrations
    
FreekVR’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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