class OverviewForm

Same name in other branches
  1. 9 core/modules/migrate_drupal_ui/src/Form/OverviewForm.php \Drupal\migrate_drupal_ui\Form\OverviewForm
  2. 8.9.x core/modules/migrate_drupal_ui/src/Form/OverviewForm.php \Drupal\migrate_drupal_ui\Form\OverviewForm
  3. 11.x 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

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
DependencySerializationTrait::$_entityStorages protected property
DependencySerializationTrait::$_serviceIds protected property
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 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. 3
FormBase::container private function Returns the service container.
FormBase::currentUser protected function Gets the current user. 2
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 Overrides FormInterface::validateForm 57
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. 16
MessengerTrait::messenger public function Gets the messenger. 16
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 Overrides FormBase::create 3
MigrateUpgradeFormBase::restartUpgradeForm protected function Helper to redirect to the Overview form.
MigrateUpgradeFormBase::__construct public function Constructs the Migrate Upgrade Form Base. 3
MigrationConfigurationTrait::$configFactory protected property The config factory service.
MigrationConfigurationTrait::$followUpMigrationTags protected property The follow-up migration tags.
MigrationConfigurationTrait::$migrationPluginManager protected property The migration plugin manager service.
MigrationConfigurationTrait::$state protected property The state service.
MigrationConfigurationTrait::createDatabaseStateSettings protected function Creates the necessary state entries for SqlBase::getDatabase() to work.
MigrationConfigurationTrait::getConfigFactory protected function Gets the config factory service.
MigrationConfigurationTrait::getConnection protected function Gets the database connection for the source Drupal database.
MigrationConfigurationTrait::getFollowUpMigrationTags protected function Returns the follow-up migration tags.
MigrationConfigurationTrait::getLegacyDrupalVersion public static function Determines what version of Drupal the source database contains.
MigrationConfigurationTrait::getMigrationPluginManager protected function Gets the migration plugin manager service.
MigrationConfigurationTrait::getMigrations protected function Gets the migrations for import.
MigrationConfigurationTrait::getState protected function Gets the state service.
MigrationConfigurationTrait::getSystemData protected function Gets the system data from the system table of the source Drupal database.
OverviewForm::buildForm public function Overrides MigrateUpgradeFormBase::buildForm
OverviewForm::getConfirmText public function Overrides MigrateUpgradeFormBase::getConfirmText
OverviewForm::getFormId public function Overrides FormInterface::getFormId
OverviewForm::submitForm public function Overrides FormInterface::submitForm
RedirectDestinationTrait::$redirectDestination protected property The redirect destination service. 2
RedirectDestinationTrait::getDestinationArray protected function Prepares a &#039;destination&#039; 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. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.