Commit 4f15f2da authored by catch's avatar catch
Browse files

Issue #3037823 by alexpott, Berdir, amateescu: The system.theme.data key...

Issue #3037823 by alexpott, Berdir, amateescu: The system.theme.data key remains corrupted in state causing performance issues and is not used in >= 8.7
parent 0e83520c
......@@ -236,6 +236,8 @@ public static function fixSerializedExtensionObjects(ContainerInterface $contain
foreach ($container->getParameter('cache_bins') as $service_id => $bin) {
$container->get($service_id)->deleteAll();
}
// The system.theme.data key is no longer used in Drupal 8.7.x.
$container->get('state')->delete('system.theme.data');
// Also rebuild themes because it uses state as cache.
$container->get('theme_handler')->refreshInfo();
}
......
......@@ -2239,3 +2239,11 @@ function system_update_8601() {
return t('The %install_profile install profile has been added to the installed module list.', ['%install_profile' => $install_profile]);
}
/**
* Remove the unused 'system.theme.data' from state.
*/
function system_update_8701() {
// The system.theme.data key is no longer used in Drupal 8.7.x.
\Drupal::state()->delete('system.theme.data');
}
......@@ -25,19 +25,30 @@ protected function setDatabaseDumpFiles() {
}
/**
* Tests that the content and configuration were properly updated.
* Tests \Drupal\Core\Update\UpdateKernel::fixSerializedExtensionObjects().
*/
public function testUpdatedSite() {
// The state API cannot be used because the value is corrupted.
$row_count = Database::getConnection()->select('key_value')
->condition('collection', 'state')
->condition('name', 'system.theme.data')
->countQuery()
->execute()
->fetchField();
$this->assertSame('1', $row_count, 'The system.theme.data key exists in state.');
$this->runUpdates();
$this->drupalGet('');
$this->resetAll();
// Ensure that drupal-8.test-config-init.php has run correctly.
$this->assertSame('test_mail_collector', $this->config('system.mail')->get('interface.default'));
$this->assertSame('verbose', $this->config('system.logging')->get('error_level'));
$this->assertSame(FALSE, $this->config('system.performance')->get('css.preprocess'));
$this->assertSame(FALSE, $this->config('system.performance')->get('js.preprocess'));
$this->assertSame('Australia/Sydney', $this->config('system.date')->get('timezone.default'));
// Ensure \Drupal\Core\Update\UpdateKernel::fixSerializedExtensionObjects()
// has removed the corrupted state key.
$this->assertNull(\Drupal::state()->get('system.theme.data'), 'The system.theme.data key does not exist in state.');
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment