diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php b/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php index 9e6a393..83e09b7 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php @@ -112,21 +112,26 @@ public function loadMultiple(EntityStorageInterface $storage, array $sub_ids = N ]; } elseif ($data['type'] === 'text') { - $migration->process[$field_name . '/value'] = $field_name . '/value'; + // The data is store differently depending on whether we're using + // db storage. + $value_key = $data['db_storage'] ? $field_name : "$field_name/value"; + $format_key = $data['db_storage'] ? $field_name . '_format' : "$field_name/format" ; + + $migration->process["$field_name/value"] = $value_key; // See d6_user, signature_format for an example of the YAML that // represents this process array. - $migration->process[$field_name . '/format'] = [ + $migration->process["$field_name/format"] = [ [ 'plugin' => 'static_map', 'bypass' => TRUE, - 'source' => $field_name . '/format', + 'source' => $format_key, 'map' => [0 => NULL] ], ['plugin' => 'skip_process_on_empty'], [ 'plugin' => 'migration', 'migration' => 'd6_filter_format', - 'source' => $field_name . '/format', + 'source' => $format_key, 'no_stub' => 1, ], ]; diff --git a/core/modules/migrate_drupal/src/Tests/Table/Variable.php b/core/modules/migrate_drupal/src/Tests/Table/Variable.php index 0acde36..7616b69 100644 --- a/core/modules/migrate_drupal/src/Tests/Table/Variable.php +++ b/core/modules/migrate_drupal/src/Tests/Table/Variable.php @@ -422,7 +422,7 @@ public function load() { 'value' => 's:29:"core/modules/simpletest/files";', ))->values(array( 'name' => 'file_directory_temp', - 'value' => 's:4:"/tmp";', + 'value' => 's:10:"files/temp";', ))->values(array( 'name' => 'file_downloads', 'value' => 's:1:"1";', diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php index 59a6aa5..5bcb66b 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php @@ -72,6 +72,11 @@ public function testFiles() { ->fields(array('value' => serialize('files/test'))) ->condition('name', 'file_directory_path') ->execute(); + Database::getConnection('default', 'migrate') + ->update('variable') + ->fields(array('value' => serialize('/tmp'))) + ->condition('name', 'file_directory_temp') + ->execute(); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php index 8e6b3db..c23e3b5 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php @@ -39,7 +39,7 @@ public function testSystemFile() { $old_state = \Drupal::configFactory()->getOverrideState(); \Drupal::configFactory()->setOverrideState(FALSE); $config = $this->config('system.file'); - $this->assertIdentical($config->get('path.temporary'), '/tmp'); + $this->assertIdentical($config->get('path.temporary'), 'files/temp'); $this->assertIdentical($config->get('allow_insecure_uploads'), TRUE); \Drupal::configFactory()->setOverrideState($old_state); }