From 9a2b5880af586d571b5972ba1b0ccea2fc9a0920 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole Date: Mon, 29 Feb 2016 14:18:08 +0900 Subject: [PATCH] Issue #2646410 by claudiu.cristea, dawehner: Container cannot be saved to cache --- core/lib/Drupal/Core/DrupalKernel.php | 2 +- .../src/Tests/Update/UpdatePathTestBaseTest.php | 11 +++++++++++ update.php | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index d54f07cae75..676546c31f1 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -861,7 +861,7 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface { // If needs dumping flag was set, dump the container. if ($this->containerNeedsDumping && !$this->cacheDrupalContainer($container_definition)) { - $this->container->get('logger.factory')->get('DrupalKernel')->notice('Container cannot be saved to cache.'); + $this->container->get('logger.factory')->get('DrupalKernel')->error('Container cannot be saved to cache.'); } return $this->container; diff --git a/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php b/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php index e62dc87da1f..60d1054cdca 100644 --- a/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php +++ b/core/modules/system/src/Tests/Update/UpdatePathTestBaseTest.php @@ -82,6 +82,17 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase { // Increment the schema version. \Drupal::state()->set('update_test_schema_version', 8001); $this->runUpdates(); + + $select = \Drupal::database()->select('watchdog'); + $select->orderBy('wid', 'DESC'); + $select->range(0, 5); + $select->fields('watchdog', ['message']); + + $container_cannot_be_saved_messages = array_filter(iterator_to_array($select->execute()), function($row) { + return strpos($row->message, 'Container cannot be saved to cache.') !== FALSE; + }); + $this->assertEqual([], $container_cannot_be_saved_messages); + // Ensure schema has changed. $this->assertEqual(drupal_get_installed_schema_version('update_test_schema', TRUE), 8001); // Ensure the index was added for column a. diff --git a/update.php b/update.php index 5222b967acb..42adef25d67 100644 --- a/update.php +++ b/update.php @@ -13,7 +13,7 @@ use Symfony\Component\HttpFoundation\Request; $autoloader = require_once 'autoload.php'; -$kernel = new UpdateKernel('prod', $autoloader); +$kernel = new UpdateKernel('prod', $autoloader, FALSE); $request = Request::createFromGlobals(); $response = $kernel->handle($request);