Commit b6fa1ca0 authored by catch's avatar catch
Browse files

Issue #2493091 by Wim Leers: Installing block module should invalidate the 'rendered' cache tag

parent 9ae3c9fb
......@@ -7,6 +7,7 @@
use Drupal\block\BlockInterface;
use Drupal\Component\Utility\Html;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\language\ConfigurableLanguageInterface;
......@@ -306,3 +307,13 @@ function block_configurable_language_delete(ConfigurableLanguageInterface $langu
* Implements hook_install().
function block_install() {
// Because the Block module upon installation unconditionally overrides all
// HTML output by selecting a different page display variant, we must
// invalidate all cached HTML output.
* @file
* Contains \Drupal\block\Tests\BlockInstallTest.
namespace Drupal\block\Tests;
use Drupal\simpletest\WebTestBase;
* Tests block module's installation.
* @group block
class BlockInstallTest extends WebTestBase {
public function testCacheTagInvalidationUponInstallation() {
// Warm the page cache.
$this->assertNoText('Powered by Drupal');
// Install the block module, and place the "Powered by Drupal" block.
$this->container->get('module_installer')->install(['block', 'shortcut']);
// Check the same page, block.module's hook_install() should have
// invalidated the 'rendered' cache tag to make blocks show up.
$this->assertText('Powered by Drupal');
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