Same name and namespace in other branches
  1. 8.9.x core/modules/migrate_drupal_ui/src/Form/OverviewForm.php \Drupal\migrate_drupal_ui\Form\OverviewForm
  2. 9 core/modules/migrate_drupal_ui/src/Form/OverviewForm.php \Drupal\migrate_drupal_ui\Form\OverviewForm

Migrate Upgrade Overview form.

@internal

Hierarchy

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\Form
View 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>Install 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 install 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

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property
DependencySerializationTrait::$_serviceIds protected property
DependencySerializationTrait::__sleep public function 2
DependencySerializationTrait::__wakeup public function 2
FormBase::$configFactory protected property The config factory. 2
FormBase::$requestStack protected property The request stack. 1
FormBase::$routeMatch protected property The route match.
FormBase::config protected function Retrieves a configuration object.
FormBase::configFactory protected function Gets the config factory for this form. 2
FormBase::container private function Returns the service container.
FormBase::currentUser protected function Gets the current user.
FormBase::getRequest protected function Gets the request object.
FormBase::getRouteMatch protected function Gets the route match.
FormBase::logger protected function Gets the logger for a specific channel.
FormBase::redirect protected function Returns a redirect response object for the specified route.
FormBase::resetConfigFactory public function Resets the configuration factory.
FormBase::setConfigFactory public function Sets the config factory for this form.
FormBase::setRequestStack public function Sets the request stack object to use.
FormBase::validateForm public function Form validation handler. Overrides FormInterface::validateForm 47
LoggerChannelTrait::$loggerFactory protected property The logger channel factory service.
LoggerChannelTrait::getLogger protected function Gets the logger for a specific channel.
LoggerChannelTrait::setLoggerFactory public function Injects the logger channel factory.
MessengerTrait::$messenger protected property The messenger. 8
MessengerTrait::messenger public function Gets the messenger. 8
MessengerTrait::setMessenger public function Sets the messenger.
MigrateUpgradeFormBase::$destinationSiteVersion protected property The destination site major version.
MigrateUpgradeFormBase::$store protected property Private temporary storage.
MigrateUpgradeFormBase::create public static function Instantiates a new instance of this class. Overrides FormBase::create 1
MigrateUpgradeFormBase::restartUpgradeForm protected function Helper to redirect to the Overview form.
MigrateUpgradeFormBase::__construct public function Constructs the Migrate Upgrade Form Base. 1
OverviewForm::buildForm public function Form constructor. Overrides MigrateUpgradeFormBase::buildForm
OverviewForm::getConfirmText public function Returns a caption for the button that confirms the action. Overrides MigrateUpgradeFormBase::getConfirmText
OverviewForm::getFormId public function Returns a unique string identifying the form. Overrides FormInterface::getFormId
OverviewForm::submitForm public function Form submission handler. Overrides FormInterface::submitForm
RedirectDestinationTrait::$redirectDestination protected property The redirect destination service. 1
RedirectDestinationTrait::getDestinationArray protected function Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
RedirectDestinationTrait::getRedirectDestination protected function Returns the redirect destination service.
RedirectDestinationTrait::setRedirectDestination public function Sets the redirect destination service.
StringTranslationTrait::$stringTranslation protected property The string translation service. 3
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 1
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.