ReviewForm.php in Drupal-to-Drupal data migration 8.3
File
migrate_d2d_ui/src/Form/ReviewForm.php
View source
<?php
namespace Drupal\migrate_d2d_ui\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class ReviewForm extends FormBase {
public function getFormId() {
return 'migrate_d2d_review_form';
}
public function buildForm(array $form, FormStateInterface $form_state) {
dpm($form_state
->getTemporaryValue('wizard'));
$form['description'] = [
'#markup' => $this
->t('Please review your migration configuration. When you submit this form, migration processes will be created and you will be left at the migration dashboard.'),
];
$form['group_id'] = [
'#type' => 'machine_name',
'#max_length' => 64,
'#title' => t('ID to assign to the generated migration group'),
'#default_value' => 'my_drupal',
];
$form['prefix'] = [
'#type' => 'machine_name',
'#max_length' => 64 - strlen('drupal_content_page'),
'#title' => t('ID to prepend to each generated migration'),
'#default_value' => 'my_',
];
return $form;
}
public function submitForm(array &$form, FormStateInterface $form_state) {
$cached_values = $form_state
->getTemporaryValue('wizard');
$cached_values['group_id'] = $form_state
->getValue('group_id');
$cached_values['prefix'] = $form_state
->getValue('prefix');
$form_state
->setTemporaryValue('wizard', $cached_values);
}
}