class OverviewForm in Drupal 10
Same name and namespace in other branches
- 8 core/modules/migrate_drupal_ui/src/Form/OverviewForm.php \Drupal\migrate_drupal_ui\Form\OverviewForm
- 9 core/modules/migrate_drupal_ui/src/Form/OverviewForm.php \Drupal\migrate_drupal_ui\Form\OverviewForm
Migrate Upgrade Overview form.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, RedirectDestinationTrait, StringTranslationTrait
- class \Drupal\migrate_drupal_ui\Form\MigrateUpgradeFormBase uses MigrationConfigurationTrait
- class \Drupal\migrate_drupal_ui\Form\OverviewForm
- class \Drupal\migrate_drupal_ui\Form\MigrateUpgradeFormBase uses MigrationConfigurationTrait
Expanded class hierarchy of OverviewForm
1 string reference to 'OverviewForm'
- migrate_drupal_ui.routing.yml in core/
modules/ migrate_drupal_ui/ migrate_drupal_ui.routing.yml - core/modules/migrate_drupal_ui/migrate_drupal_ui.routing.yml
File
- core/
modules/ migrate_drupal_ui/ src/ Form/ OverviewForm.php, line 13
Namespace
Drupal\migrate_drupal_ui\FormView source
class OverviewForm extends MigrateUpgradeFormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'migrate_drupal_ui_overview_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
// If an upgrade has already been performed, redirect to the incremental
// form.
if ($this->state
->get('migrate_drupal_ui.performed')) {
$this->store
->set('step', 'incremental');
return $this
->redirect('migrate_drupal_ui.upgrade_incremental');
}
$form = parent::buildForm($form, $form_state);
$form['#title'] = $this
->t('Upgrade');
$form['info_header'] = [
'#markup' => '<p>' . $this
->t('Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal @version. See the <a href=":url">Drupal site upgrades handbook</a> for more information.', [
'@version' => $this->destinationSiteVersion,
':url' => 'https://www.drupal.org/upgrade/migrate',
]),
];
$form['legend']['#markup'] = '';
$form['legend']['#markup'] .= '<h3>' . $this
->t('Definitions') . '</h3>';
$form['legend']['#markup'] .= '<dl>';
$form['legend']['#markup'] .= '<dt>' . $this
->t('Old site') . '</dt>';
$form['legend']['#markup'] .= '<dd>' . $this
->t('The site you want to upgrade.') . '</dd>';
$form['legend']['#markup'] .= '<dt>' . $this
->t('New site') . '</dt>';
$form['legend']['#markup'] .= '<dd>' . $this
->t('This empty Drupal @version installation you will import the old site to.', [
'@version' => $this->destinationSiteVersion,
]) . '</dd>';
$form['legend']['#markup'] .= '</dl>';
$info[] = $this
->t('Make sure that <strong>access to the database</strong> for the old site is available from this new site.');
$info[] = $this
->t('<strong>If the old site has private files</strong>, a copy of its files directory must also be accessible on the host of this new site.');
$info[] = $this
->t('<strong>Enable all modules on this new site</strong> that are enabled on the old site. For example, if the old site uses the Book module, then enable the Book module on this new site so that the existing data can be imported to it.');
$info[] = $this
->t('<strong>Do not add any content to the new site</strong> before upgrading. Any existing content is likely to be overwritten by the upgrade process. See <a href=":url">the upgrade preparation guide</a>.', [
':url' => 'https://www.drupal.org/docs/8/upgrade/preparing-an-upgrade#do_not_create_content',
]);
$info[] = $this
->t('Put this site into <a href=":url">maintenance mode</a>.', [
':url' => Url::fromRoute('system.site_maintenance_mode')
->toString(TRUE)
->getGeneratedUrl(),
]);
$form['info'] = [
'#theme' => 'item_list',
'#title' => $this
->t('Preparation steps'),
'#list_type' => 'ol',
'#items' => $info,
];
$form['info_footer'] = [
'#markup' => '<p>' . $this
->t('The upgrade can take a long time. It is better to upgrade from a local copy of your site instead of directly from your live site.'),
];
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->store
->set('step', 'credential');
$form_state
->setRedirect('migrate_drupal_ui.upgrade_credential');
}
/**
* {@inheritdoc}
*/
public function getConfirmText() {
return $this
->t('Continue');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
public | function | 2 | |
DependencySerializationTrait:: |
public | function | 2 | |
FormBase:: |
protected | property | The request stack. | |
FormBase:: |
protected | property | The route match. | |
FormBase:: |
protected | function | Retrieves a configuration object. | |
FormBase:: |
protected | function | Gets the config factory for this form. | 3 |
FormBase:: |
private | function | Returns the service container. | |
FormBase:: |
protected | function | Gets the current user. | |
FormBase:: |
protected | function | Gets the request object. | |
FormBase:: |
protected | function | Gets the route match. | |
FormBase:: |
protected | function | Gets the logger for a specific channel. | |
FormBase:: |
protected | function | Returns a redirect response object for the specified route. | |
FormBase:: |
public | function | Resets the configuration factory. | |
FormBase:: |
public | function | Sets the config factory for this form. | |
FormBase:: |
public | function | Sets the request stack object to use. | |
FormBase:: |
public | function |
Form validation handler. Overrides FormInterface:: |
65 |
LoggerChannelTrait:: |
protected | property | The logger channel factory service. | |
LoggerChannelTrait:: |
protected | function | Gets the logger for a specific channel. | |
LoggerChannelTrait:: |
public | function | Injects the logger channel factory. | |
MessengerTrait:: |
protected | property | The messenger. | 18 |
MessengerTrait:: |
public | function | Gets the messenger. | 18 |
MessengerTrait:: |
public | function | Sets the messenger. | |
MigrateUpgradeFormBase:: |
protected | property | The destination site major version. | |
MigrateUpgradeFormBase:: |
protected | property | Private temporary storage. | |
MigrateUpgradeFormBase:: |
public static | function |
Instantiates a new instance of this class. Overrides FormBase:: |
3 |
MigrateUpgradeFormBase:: |
protected | function | Helper to redirect to the Overview form. | |
MigrateUpgradeFormBase:: |
public | function | Constructs the Migrate Upgrade Form Base. | 3 |
MigrationConfigurationTrait:: |
protected | property | The config factory service. | |
MigrationConfigurationTrait:: |
protected | property | The follow-up migration tags. | |
MigrationConfigurationTrait:: |
protected | property | The migration plugin manager service. | |
MigrationConfigurationTrait:: |
protected | property | The state service. | |
MigrationConfigurationTrait:: |
protected | function | Creates the necessary state entries for SqlBase::getDatabase() to work. | |
MigrationConfigurationTrait:: |
protected | function | Gets the config factory service. | |
MigrationConfigurationTrait:: |
protected | function | Gets the database connection for the source Drupal database. | |
MigrationConfigurationTrait:: |
protected | function | Returns the follow-up migration tags. | |
MigrationConfigurationTrait:: |
public static | function | Determines what version of Drupal the source database contains. | |
MigrationConfigurationTrait:: |
protected | function | Gets the migration plugin manager service. | |
MigrationConfigurationTrait:: |
protected | function | Gets the migrations for import. | |
MigrationConfigurationTrait:: |
protected | function | Gets the state service. | |
MigrationConfigurationTrait:: |
protected | function | Gets the system data from the system table of the source Drupal database. | |
OverviewForm:: |
public | function |
Form constructor. Overrides MigrateUpgradeFormBase:: |
|
OverviewForm:: |
public | function |
Returns a caption for the button that confirms the action. Overrides MigrateUpgradeFormBase:: |
|
OverviewForm:: |
public | function |
Returns a unique string identifying the form. Overrides FormInterface:: |
|
OverviewForm:: |
public | function |
Form submission handler. Overrides FormInterface:: |
|
RedirectDestinationTrait:: |
protected | property | The redirect destination service. | 1 |
RedirectDestinationTrait:: |
protected | function | Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. | |
RedirectDestinationTrait:: |
protected | function | Returns the redirect destination service. | |
RedirectDestinationTrait:: |
public | function | Sets the redirect destination service. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 3 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 1 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |