Skip to content
Snippets Groups Projects
Commit 173fca3f authored by catch's avatar catch
Browse files

Issue #2313135 by Berdir: Fixed setting page_cache_without_database in...

Issue #2313135 by Berdir: Fixed setting page_cache_without_database in settings.php prevents the container from being dumped.
parent de5830d6
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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;
}
......
......@@ -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.
......
......@@ -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'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment