Migration run from D6 run several migrations and then stops the batch process.

PHP logs show this message

[03-Oct-2014 13:10:22 Europe/Berlin] Uncaught PHP Exception Drupal\migrate\MigrateException: "Failed to lookup array (
  0 => 'text',
  1 => 'hidden',
) in the static map." at /Users/pedro/Sites/core/8.x/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FieldTypeDefaults.php line 33

Some migrations seems to have run successful, others don't.

Comments

Pedro Lozano’s picture

Title: FieldTypeDefaults » FieldTypeDefaults, Uncaught PHP Exception
benjy’s picture

Project: Migrate Upgrade » Drupal core
Version: 8.x-1.x-dev » 8.0.x-dev
Component: Code » migration system

Seems more like a core migrate issue than anything todo with the UI.

ultimike’s picture

@Pedro Lozano,

Can you provide a little more context for the error? Were you running a full site migration? Do you get the same error when running the migration from Drush?

-mike

matason’s picture

I'm experiencing the same issue whilst attempting to migrate a Drupal 6 site to Drupal 8.

I'm starting with a clean Drupal 8 install using the standard profile then I delete the basic page and article content types then I run:

drush migrate-manifest manifest.yml --legacy-db-url=<my-db-url>

My manifest.yml contains the following:

- d6_field
- d6_field_formatter_settings
- d6_field_instance
- d6_field_instance_widget_settings
- d6_filter_format
- d6_locale_settings
- d6_menu
- d6_menu_settings
- d6_node
- d6_node_revision
- d6_node_setting_promote
- d6_node_setting_status
- d6_node_setting_sticky
- d6_node_settings
- d6_node_type
- d6_taxonomy_settings
- d6_taxonomy_term
- d6_taxonomy_vocabulary
- d6_term_node
- d6_term_node_revision
- d6_text_settings
- d6_user
- d6_user_mail
- d6_user_role
- d6_vocabulary_entity_display
- d6_vocabulary_entity_form_display
- d6_vocabulary_field
- d6_vocabulary_field_instance
- d6_view_modes
- d6_field_formatter_settings
- d6_user_picture_entity_display

and the error I get is:

Running d6_field_formatter_settings                                                                                               [ok]
exception 'Drupal\migrate\MigrateException' with message 'Failed to lookup array (                                                [error]
  0 => 'text',
  1 => 'hidden',
) in the static map.' in
/vagrant/daringosmosis/www/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FieldTypeDefaults.php:33
matason’s picture

I made this change to core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FieldTypeDefaults.php

diff --git a/www/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FieldTypeDefaults.php b/www/core/modules/migrate_drupal/src/Plugin
/migrate/process/d6/FieldTypeDefaults.php
index 0deedd0..dd890b3 100644
--- a/www/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FieldTypeDefaults.php
+++ b/www/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FieldTypeDefaults.php
@@ -26,12 +26,7 @@ class FieldTypeDefaults extends ProcessPluginBase {
    */
   public function transform($value, MigrateExecutable $migrate_executable, Row $row, $destination_property) {
     if (is_array($value)) {
-      if ($row->getSourceProperty('module') == 'date') {
-        $value = 'datetime_default';
-      }
-      else {
-        throw new MigrateException(sprintf('Failed to lookup %s in the static map.', var_export($value, TRUE)));
-      }
+      $value = array_shift($value);
     }
     return $value;
   }

which appears to allow me to get beyond the original error although a bunch of these errors:

The &quot;filefield&quot; plugin does not exist.                                                                                  [error]
(/vagrant/daringosmosis/www/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:57)

appeared when I re-ran the migration.

I'll see what the outcome is, perhaps I need to create plugins for the missing fields...

ultimike’s picture

Status: Active » Closed (duplicate)

@matason,

Let's mark this one as a duplicate of #2361401: Skip the row when we don't recognize the the field type - let's continue this discussion there.

Thanks,
-mike