diff --git a/core/modules/field_ui/src/DisplayOverview.php b/core/modules/field_ui/src/DisplayOverview.php
index 2bc07c1..a711047 100644
--- a/core/modules/field_ui/src/DisplayOverview.php
+++ b/core/modules/field_ui/src/DisplayOverview.php
@@ -78,11 +78,8 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $bundle = NULL) {
-    if ($this->getRequest()->attributes->has('view_mode_name')) {
-      $this->mode = $this->getRequest()->attributes->get('view_mode_name');
-    }
-
+  public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $bundle = NULL, $view_mode_name = NULL) {
+    $this->mode = $view_mode_name;
     return parent::buildForm($form, $form_state, $entity_type_id, $bundle);
   }
 
diff --git a/core/modules/field_ui/src/FormDisplayOverview.php b/core/modules/field_ui/src/FormDisplayOverview.php
index aacd423..cb202be 100644
--- a/core/modules/field_ui/src/FormDisplayOverview.php
+++ b/core/modules/field_ui/src/FormDisplayOverview.php
@@ -77,11 +77,8 @@ public function getFormId() {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $bundle = NULL) {
-    if ($this->getRequest()->attributes->has('form_mode_name')) {
-      $this->mode = $this->getRequest()->attributes->get('form_mode_name');
-    }
-
+  public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $bundle = NULL, $form_mode_name = NULL) {
+    $this->mode = $form_mode_name;
     return parent::buildForm($form, $form_state, $entity_type_id, $bundle);
   }
 
diff --git a/core/modules/system/tests/modules/entity_test/src/Controller/EntityTestController.php b/core/modules/system/tests/modules/entity_test/src/Controller/EntityTestController.php
index a9d114a..01b9d94 100644
--- a/core/modules/system/tests/modules/entity_test/src/Controller/EntityTestController.php
+++ b/core/modules/system/tests/modules/entity_test/src/Controller/EntityTestController.php
@@ -66,14 +66,16 @@ public function testAdd($entity_type) {
    *
    * @param \Symfony\Component\HttpFoundation\Request $request
    *   The request object to get entity type from.
+   * @param string $_entity_type_id
+   *   The entity type ID.
    *
    * @return array
    *   The processed form for the edited entity.
    *
    * @see \Drupal\entity_test\Routing\EntityTestRoutes::routes()
    */
-  public function testEdit(Request $request) {
-    $entity = $request->attributes->get($request->attributes->get('_entity_type'));
+  public function testEdit(Request $request, $_entity_type_id) {
+    $entity = $request->attributes->get($_entity_type_id);
     $form = $this->entityFormBuilder()->getForm($entity);
     $form['#title'] = $entity->label();
     return $form;
diff --git a/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php b/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php
index 5902b09..a3cad77 100644
--- a/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php
+++ b/core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php
@@ -35,7 +35,7 @@ public function routes() {
 
       $routes["entity.$entity_type.edit_form"] = new Route(
         "$entity_type/manage/{" . $entity_type . '}',
-        array('_content' => '\Drupal\entity_test\Controller\EntityTestController::testEdit', '_entity_type' => $entity_type),
+        array('_content' => '\Drupal\entity_test\Controller\EntityTestController::testEdit', '_entity_type_id' => $entity_type),
         array('_permission' => 'administer entity_test content'),
         array('parameters' => array(
           $entity_type => array('type' => 'entity:' . $entity_type),
diff --git a/core/modules/views_ui/src/ViewFormBase.php b/core/modules/views_ui/src/ViewFormBase.php
index 9544040..9271a66 100644
--- a/core/modules/views_ui/src/ViewFormBase.php
+++ b/core/modules/views_ui/src/ViewFormBase.php
@@ -30,10 +30,6 @@
   public function init(FormStateInterface $form_state) {
     parent::init($form_state);
 
-    if ($display_id = \Drupal::request()->attributes->get('display_id')) {
-      $this->displayID = $display_id;
-    }
-
     // @todo Remove the need for this.
     $form_state->loadInclude('views_ui', 'inc', 'admin');
     $form_state->set('view', $this->entity);
@@ -42,6 +38,17 @@ public function init(FormStateInterface $form_state) {
   /**
    * {@inheritdoc}
    */
+  public function buildForm(array $form, FormStateInterface $form_state, $display_id = NULL) {
+    if (isset($display_id) && $form_state->has('display_id') && ($display_id !== $form_state->get('display_id'))) {
+      throw new \InvalidArgumentException('Mismatch between $form_state->get(\'display_id\') and $display_id.');
+    }
+    $this->displayID = $form_state->has('display_id') ? $form_state->get('display_id') : $display_id;
+    return parent::buildForm($form, $form_state);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   protected function prepareEntity() {
     // Determine the displays available for editing.
     if ($tabs = $this->getDisplayTabs($this->entity)) {
diff --git a/core/modules/views_ui/src/ViewPreviewForm.php b/core/modules/views_ui/src/ViewPreviewForm.php
index f132b64..bdfb80f 100644
--- a/core/modules/views_ui/src/ViewPreviewForm.php
+++ b/core/modules/views_ui/src/ViewPreviewForm.php
@@ -8,8 +8,6 @@
 namespace Drupal\views_ui;
 
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\user\TempStoreFactory;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Form controller for the Views preview form.
@@ -17,32 +15,6 @@
 class ViewPreviewForm extends ViewFormBase {
 
   /**
-   * The views temp store.
-   *
-   * @var \Drupal\user\TempStore
-   */
-  protected $tempStore;
-
-  /**
-   * Constructs a new ViewPreviewForm object.
-   *
-   * @param \Drupal\user\TempStoreFactory $temp_store_factory
-   *   The factory for the temp store object.
-   */
-  public function __construct(TempStoreFactory $temp_store_factory) {
-    $this->tempStore = $temp_store_factory->get('views');
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('user.tempstore')
-    );
-  }
-
-  /**
    * {@inheritdoc}
    */
   public function form(array $form, FormStateInterface $form_state) {
@@ -129,15 +101,6 @@ protected function actions(array $form, FormStateInterface $form_state) {
    * Form submission handler for the Preview button.
    */
   public function submitPreview($form, FormStateInterface $form_state) {
-    // Rebuild the form with a pristine $view object.
-    $view = $this->entity;
-    // Attempt to load the view from temp store, otherwise create a new one.
-    if (!$new_view = $this->tempStore->get($view->id())) {
-      $new_view = new ViewUI($view);
-    }
-    $build_info = $form_state->getBuildInfo();
-    $build_info['args'][0] = $new_view;
-    $form_state->setBuildInfo($build_info);
     $form_state->set('show_preview', TRUE);
     $form_state->setRebuild();
   }
