i18nWarningForm example

if ($content_conflicts || $translated_content_conflicts) {
      $this->messenger()->addWarning($this->t('WARNING: Content may be overwritten on your new site.'));

      $form = parent::buildForm($form$form_state);
      $form['#title'] = $this->t('Upgrade analysis report');

      if ($content_conflicts) {
        $form = $this->conflictsForm($form$content_conflicts);
      }
      if ($translated_content_conflicts) {
        $form = $this->i18nWarningForm($form$translated_content_conflicts);
      }
      return $form;
    }
    else {
      $this->store->set('step', 'review');
      return $this->redirect('migrate_drupal_ui.upgrade_review');
    }
  }

  /** * Build the markup for conflict warnings. * * @param array $form * An associative array containing the structure of the form. * @param \Drupal\migrate\Audit\AuditResult[] $conflicts * The failing audit results. * * @return array * The form structure. */
Home | Imprint | This part of the site doesn't use cookies.