Skip to content
Snippets Groups Projects
Commit 614a6b09 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1941164 by Berdir: Fixed hook_views_data() rebuilt on every page view.

parent 2733bf20
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -310,7 +310,8 @@ public function build(ContainerBuilder $container) {
$container->register('plugin.manager.condition', 'Drupal\Core\Condition\ConditionManager');
$container->register('kernel_destruct_subscriber', 'Drupal\Core\EventSubscriber\KernelDestructionSubscriber')
->addMethodCall('setContainer', array(new Reference('service_container')));
->addMethodCall('setContainer', array(new Reference('service_container')))
->addTag('event_subscriber');
// Register Ajax event subscriber.
$container->register('ajax.subscriber', 'Drupal\Core\Ajax\AjaxSubscriber')
......
......@@ -48,6 +48,11 @@ function testPathCache() {
$edit['alias'] = $this->randomName(8);
$this->drupalPost('admin/config/search/path/add', $edit, t('Save'));
// Check the path alias whitelist cache.
$whitelist = cache()->get('path_alias_whitelist');
$this->assertTrue($whitelist->data['node']);
$this->assertFalse($whitelist->data['admin']);
// Visit the system path for the node and confirm a cache entry is
// created.
cache('path')->deleteAll();
......
......@@ -34,14 +34,10 @@ public function testDestructionUsed() {
// The service has not been destructed yet.
$this->assertNull(state()->get('bundle_test.destructed'));
// Get the service destructor.
$service_destruction = $this->container->get('kernel_destruct_subscriber');
// Call the class and then invoke the kernel terminate event.
// Call the class and then terminate the kernel
$this->container->get('bundle_test_class');
$response = new Response();
$event = new PostResponseEvent($this->container->get('kernel'), $this->container->get('request'), $response);
$service_destruction->onKernelTerminate($event);
$this->container->get('kernel')->terminate($this->container->get('request'), $response);
$this->assertTrue(state()->get('bundle_test.destructed'));
}
......@@ -55,14 +51,10 @@ public function testDestructionUnused() {
// The service has not been destructed yet.
$this->assertNull(state()->get('bundle_test.destructed'));
// Get the service destructor.
$service_destruction = $this->container->get('kernel_destruct_subscriber');
// Simulate a shutdown. The test class has not been called, so it should not
// Terminate the kernel. The test class has not been called, so it should not
// be destructed.
$response = new Response();
$event = new PostResponseEvent($this->container->get('kernel'), $this->container->get('request'), $response);
$service_destruction->onKernelTerminate($event);
$this->container->get('kernel')->terminate($this->container->get('request'), $response);
$this->assertNull(state()->get('bundle_test.destructed'));
}
}
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