diff --git a/core/modules/color/color.module b/core/modules/color/color.module index c992b2a..15619ff 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -119,9 +119,9 @@ function color_block_view_system_branding_block_alter(array &$build, BlockPlugin function color_block_view_pre_render(array $build) { $theme_key = \Drupal::theme()->getActiveTheme()->getName(); $config = \Drupal::config('color.theme.' . $theme_key); - $cacheable_metadata = CacheableMetadata::createFromRenderArray($build); - $cacheable_metadata->addCacheableDependency($config); - $cacheable_metadata->applyTo($build); + CacheableMetadata::createFromRenderArray($build) + ->addCacheableDependency($config) + ->applyTo($build); // Override logo. $logo = $config->get('logo'); diff --git a/core/modules/color/src/Tests/ColorTest.php b/core/modules/color/src/Tests/ColorTest.php index 750b2e8..b5ed67a 100644 --- a/core/modules/color/src/Tests/ColorTest.php +++ b/core/modules/color/src/Tests/ColorTest.php @@ -210,23 +210,23 @@ function testOverrideAndResetScheme() { $this->assertNoRaw('files/color/bartik-', 'Make sure the color logo is not being used.'); $this->assertRaw('bartik/logo.svg', 'Make sure the original bartik logo exists.'); - // Login and set the scheme to slate. + // Log in and set the color scheme to 'slate'. $this->drupalLogin($this->bigUser); $edit['scheme'] = 'slate'; $this->drupalPostForm($settings_path, $edit, t('Save configuration')); - // Visit the bartik homepage and ensure color changes. + // Visit the homepage and ensure color changes. $this->drupalLogout(); $this->drupalGet(''); $this->assertRaw('files/color/bartik-', 'Make sure the color logo is being used.'); $this->assertNoRaw('bartik/logo.svg', 'Make sure the original bartik logo does not exist.'); - // Login and set the scheme back to default (delete config). + // Log in and set the color scheme back to default (delete config). $this->drupalLogin($this->bigUser); $edit['scheme'] = 'default'; $this->drupalPostForm($settings_path, $edit, t('Save configuration')); - // Logout and ensure there is no color and we have the original logo. + // Log out and ensure there is no color and we have the original logo. $this->drupalLogout(); $this->drupalGet(''); $this->assertNoRaw('files/color/bartik-', 'Make sure the color logo is not being used.');