diff -u b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php --- b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php @@ -426,7 +426,7 @@ 'source_module' => 'simpletest', 'destination_module' => 'simpletest', ], - 'd6_statistics_settings' => [ + 'statistics_settings' => [ 'source_module' => 'statistics', 'destination_module' => 'statistics', ], @@ -854,15 +854,6 @@ $default_options = []; - - $form['version'] = [ - '#type' => 'radios', - '#default_value' => 6, - '#title' => $this->t('Drupal version of the source site'), - '#options' => [6 => t('Drupal 6'), 7 => t('Drupal 7')], - '#required' => TRUE, - ]; - $form['database'] = [ '#type' => 'details', '#title' => $this->t('Source database'), @@ -871,6 +862,15 @@ $default_options = []; + + $form['version'] = [ + '#type' => 'radios', + '#default_value' => 7, + '#title' => $this->t('Drupal version of the source site'), + '#options' => [6 => $this->t('Drupal 6'), 7 => $this->t('Drupal 7')], + '#required' => TRUE, + ]; + $form['database'] = [ '#type' => 'details', '#title' => $this->t('Source database'), @@ -924,17 +924,39 @@ '#title' => $this->t('Source files'), '#open' => TRUE, ]; - $form['source']['source_base_path'] = [ + $form['source']['d6_source_base_path'] = [ '#type' => 'textfield', '#title' => $this->t('Files directory'), '#description' => $this->t('To import files from your current Drupal site, enter a local file directory containing your site (e.g. /var/www/docroot), or your site address (for example http://example.com).'), + '#states' => [ + 'invisible' => [ + ':input[name="version"]' => ['value' => 7], + ], + 'visible' => [ + ':input[name="version"]' => ['value' => 6], + ], + ], + ]; + + $form['source']['source_base_path'] = [ + '#type' => 'textfield', + '#title' => $this->t('Public files directory'), + '#description' => $this->t('To import public files from your current Drupal site, enter a local file directory containing your site (e.g. /var/www/docroot), or your site address (for example http://example.com).'), + '#states' => [ + 'invisible' => [ + ':input[name="version"]' => ['value' => 6], + ], + 'visible' => [ + ':input[name="version"]' => ['value' => 7], + ], + ], ]; $form['source']['source_private_file_path'] = [ '#type' => 'textfield', '#title' => $this->t('Private file directory'), '#default_value' => '', - '#description' => $this->t('To import private files from your current Drupal site, enter a local file directory containing your site (e.g. /var/www/docroot), or your site address (for example http://example.com).'), + '#description' => $this->t('To import private files from your current Drupal site, enter a local file directory containing your site (e.g. /var/www/docroot).'), '#states' => [ 'invisible' => [ ':input[name="version"]' => ['value' => 6], @@ -1015,6 +1037,7 @@ // Store the retrieved migration IDs in form storage. $form_state->set('migrations', $migration_array); + $form_state->set('d6_source_base_path', $form_state->getValue('d6_source_base_path')); $form_state->set('source_base_path', $form_state->getValue('source_base_path')); $form_state->set('source_private_file_path', $form_state->getValue('source_private_file_path')); @@ -1164,7 +1187,12 @@ $storage = $form_state->getStorage(); $migrations = $storage['migrations']; - $config['source_base_path'] = $storage['source_base_path']; + if ($storage['version'] == '6') { + $config['source_base_path'] = $storage['d6_source_base_path']; + } + else { + $config['source_base_path'] = $storage['source_base_path']; + } $config['source_private_file_path'] = $storage['source_private_file_path']; $batch = [ 'title' => $this->t('Running upgrade'),