From 173fca3fe000f9b4daad19abbde1d1838395de60 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Wed, 1 Oct 2014 10:59:14 +0200
Subject: [PATCH] Issue #2313135 by Berdir: Fixed setting
 page_cache_without_database in settings.php prevents the container from being
 dumped.

---
 core/lib/Drupal/Core/DrupalKernel.php         |  9 +++--
 .../Tests/DrupalKernel/DrupalKernelTest.php   |  4 +--
 .../views/src/Plugin/views/display/Page.php   | 35 +++----------------
 3 files changed, 11 insertions(+), 37 deletions(-)

diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 8514448cc5ad..b4c2567b72b2 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -411,9 +411,6 @@ public function shutdown() {
    * {@inheritdoc}
    */
   public function getContainer() {
-    if ($this->containerNeedsDumping && !$this->dumpDrupalContainer($this->container, static::CONTAINER_BASE_CLASS)) {
-      $this->container->get('logger.factory')->get('DrupalKernel')->notice('Container cannot be written to disk');
-    }
     return $this->container;
   }
 
@@ -712,6 +709,12 @@ protected function initializeContainer($rebuild = FALSE) {
       $this->container->get('session_manager')->start();
     }
     \Drupal::setContainer($this->container);
+
+    // If needs dumping flag was set, dump the container.
+    if ($this->containerNeedsDumping && !$this->dumpDrupalContainer($this->container, static::CONTAINER_BASE_CLASS)) {
+      $this->container->get('logger.factory')->get('DrupalKernel')->notice('Container cannot be written to disk');
+    }
+
     return $this->container;
   }
 
diff --git a/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php b/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
index a7ac85a8abe2..b79eb36f7b02 100644
--- a/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
+++ b/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
@@ -79,9 +79,7 @@ function testCompileDIC() {
     );
 
     $request = Request::createFromGlobals();
-    $this->getTestKernel($request, $modules_enabled)
-      // Trigger Kernel dump.
-      ->getContainer();
+    $this->getTestKernel($request, $modules_enabled);
 
     // Instantiate it a second time and we should get the compiled Container
     // class.
diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php
index 5234f2c387c0..bdbf54a05cab 100644
--- a/core/modules/views/src/Plugin/views/display/Page.php
+++ b/core/modules/views/src/Plugin/views/display/Page.php
@@ -46,9 +46,8 @@ protected function defineOptions() {
     $options['menu'] = array(
       'contains' => array(
         'type' => array('default' => 'none'),
-        // Do not translate menu and title as menu system will.
-        'title' => array('default' => '', 'translatable' => FALSE),
-        'description' => array('default' => '', 'translatable' => FALSE),
+        'title' => array('default' => ''),
+        'description' => array('default' => ''),
         'weight' => array('default' => 0),
         'menu_name' => array('default' => 'main'),
         'parent' => array('default' => ''),
@@ -58,11 +57,9 @@ protected function defineOptions() {
     $options['tab_options'] = array(
       'contains' => array(
         'type' => array('default' => 'none'),
-        // Do not translate menu and title as menu system will.
-        'title' => array('default' => '', 'translatable' => FALSE),
-        'description' => array('default' => '', 'translatable' => FALSE),
+        'title' => array('default' => ''),
+        'description' => array('default' => ''),
         'weight' => array('default' => 0),
-        'menu_name' => array('default' => 'main'),
       ),
     );
 
@@ -336,30 +333,6 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
             ),
           ),
         );
-        // Only display the menu selector if Menu UI module is enabled.
-        if (\Drupal::moduleHandler()->moduleExists('menu_ui')) {
-          $form['tab_options']['menu_name'] = array(
-            '#title' => $this->t('Menu'),
-            '#type' => 'select',
-            '#options' => menu_ui_get_menus(),
-            '#default_value' => $tab_options['menu_name'],
-            '#description' => $this->t('Insert item into an available menu.'),
-            '#states' => array(
-              'visible' => array(
-                ':input[name="tab_options[type]"]' => array('value' => 'normal'),
-              ),
-            ),
-          );
-        }
-        else {
-          $form['tab_options']['menu_name'] = array(
-            '#type' => 'value',
-            '#value' => $tab_options['menu_name'],
-          );
-          $form['tab_options']['markup'] = array(
-            '#markup' => $this->t('Menu selection requires the activation of Menu UI module.'),
-          );
-        }
         $form['tab_options']['weight'] = array(
           '#suffix' => '</div>',
           '#title' => $this->t('Tab weight'),
-- 
GitLab