Skip to content
Snippets Groups Projects
Commit 08480a54 authored by catch's avatar catch
Browse files

Issue #3052971 by alexpott, l.grube: Notice: Undefined index:...

Issue #3052971 by alexpott, l.grube: Notice: Undefined index: #include_fallback in Drupal\Core\Render\Element\StatusMessages::generatePlaceholder()
parent 0d009046
No related branches found
No related tags found
No related merge requests found
......@@ -25,13 +25,23 @@ public function register(ContainerBuilder $container) {
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
$null_cache_service = new Reference('cache.null');
$definition = $container->getDefinition('asset.resolver');
$argument = new Reference('cache.null');
$definition->replaceArgument(5, $argument);
$definition->replaceArgument(5, $null_cache_service);
$definition = $container->getDefinition('library.discovery.collector');
$argument = new Reference('cache.null');
$definition->replaceArgument(0, $argument);
$definition->replaceArgument(0, $null_cache_service);
$definition = $container->getDefinition('theme.registry');
$definition->replaceArgument(1, $null_cache_service);
$definition->replaceArgument(7, $null_cache_service);
$definition = $container->getDefinition('theme.initialization');
$definition->replaceArgument(2, $null_cache_service);
$definition = $container->getDefinition('plugin.manager.element_info');
$definition->replaceArgument(1, $null_cache_service);
// Prevent the alias-based path processor, which requires a path_alias db
// table, from being registered to the path processor manager. We do this by
......
<?php
namespace Drupal\Tests\system\Functional\Update;
use Drupal\Core\Database\Database;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
/**
* Ensures that a broken or out-of-date element info cache is not used.
*
* @group Update
* @group legacy
*/
class BrokenCacheUpdateTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../tests/fixtures/update/drupal-8.6.0.bare.testing.php.gz',
];
}
/**
* Ensures that a broken or out-of-date element info cache is not used.
*/
public function testUpdate() {
$connection = Database::getConnection();
// Ensure \Drupal\Core\Update\UpdateKernel::fixSerializedExtensionObjects()
// does not clear the cache.
$connection->delete('key_value')
->condition('collection', 'state')
->condition('name', 'system.theme.data')
->execute();
// Create broken element info caches entries.
$insert = $connection->insert('cache_discovery');
$fields = [
'cid' => 'element_info',
'data' => 'BROKEN',
'expire' => -1,
'created' => '1549505157.144',
'serialized' => 1,
'tags' => '',
'checksum' => 0,
];
$insert->fields($fields);
$fields['cid'] = 'element_info_build:seven';
$fields['tags'] = 'element_info_build';
$insert->values(array_values($fields));
$fields['cid'] = 'element_info_build:stark';
$insert->values(array_values($fields));
$insert->execute();
$this->runUpdates();
// Caches should have been cleared at this point.
$count = (int) $connection->select('cache_discovery')
->condition('cid', ['element_info', 'element_info_build:seven', 'element_info_build:stark'], 'IN')
->countQuery()
->execute()
->fetchField();
$this->assertSame(0, $count);
}
}
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