Issue #2313135 by Berdir: Fixed setting page_cache_without_database in settings.php prevents the container from being dumped.

8.0.x
catch 2014-10-01 10:59:14 +02:00
parent de5830d665
commit 173fca3fe0
3 changed files with 11 additions and 37 deletions

View File

@ -411,9 +411,6 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getContainer() { 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; return $this->container;
} }
@ -712,6 +709,12 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
$this->container->get('session_manager')->start(); $this->container->get('session_manager')->start();
} }
\Drupal::setContainer($this->container); \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; return $this->container;
} }

View File

@ -79,9 +79,7 @@ class DrupalKernelTest extends KernelTestBase {
); );
$request = Request::createFromGlobals(); $request = Request::createFromGlobals();
$this->getTestKernel($request, $modules_enabled) $this->getTestKernel($request, $modules_enabled);
// Trigger Kernel dump.
->getContainer();
// Instantiate it a second time and we should get the compiled Container // Instantiate it a second time and we should get the compiled Container
// class. // class.

View File

@ -46,9 +46,8 @@ class Page extends PathPluginBase {
$options['menu'] = array( $options['menu'] = array(
'contains' => array( 'contains' => array(
'type' => array('default' => 'none'), 'type' => array('default' => 'none'),
// Do not translate menu and title as menu system will. 'title' => array('default' => ''),
'title' => array('default' => '', 'translatable' => FALSE), 'description' => array('default' => ''),
'description' => array('default' => '', 'translatable' => FALSE),
'weight' => array('default' => 0), 'weight' => array('default' => 0),
'menu_name' => array('default' => 'main'), 'menu_name' => array('default' => 'main'),
'parent' => array('default' => ''), 'parent' => array('default' => ''),
@ -58,11 +57,9 @@ class Page extends PathPluginBase {
$options['tab_options'] = array( $options['tab_options'] = array(
'contains' => array( 'contains' => array(
'type' => array('default' => 'none'), 'type' => array('default' => 'none'),
// Do not translate menu and title as menu system will. 'title' => array('default' => ''),
'title' => array('default' => '', 'translatable' => FALSE), 'description' => array('default' => ''),
'description' => array('default' => '', 'translatable' => FALSE),
'weight' => array('default' => 0), 'weight' => array('default' => 0),
'menu_name' => array('default' => 'main'),
), ),
); );
@ -336,30 +333,6 @@ class Page extends PathPluginBase {
), ),
), ),
); );
// 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( $form['tab_options']['weight'] = array(
'#suffix' => '</div>', '#suffix' => '</div>',
'#title' => $this->t('Tab weight'), '#title' => $this->t('Tab weight'),