diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewsThemeIntegrationTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewsThemeIntegrationTest.php new file mode 100644 index 0000000..9eda7e1 --- /dev/null +++ b/core/modules/views/lib/Drupal/views/Tests/ViewsThemeIntegrationTest.php @@ -0,0 +1,88 @@ + 'Views base theme test', + 'description' => 'Tests the Views theme integration.', + 'group' => 'Views theming', + ); + } + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + } + + /** + * Tests for exceptions. + */ + public function testFrontPage() { + theme_enable(array('test_basetheme', 'test_subtheme')); + + // Make base theme default first + \Drupal::config('system.theme') + ->set('default', 'test_basetheme') + ->save(); + $this->assertEqual(\Drupal::config('system.theme')->get('default'), 'test_basetheme'); + + $account = $this->drupalCreateUser(array()); + $this->drupalLogin($account); + + // Create article for view on the frontpage. + $type_values = array( + 'type' => 'article', + 'name' => 'Basic article', + 'published' => TRUE, + 'promote' => TRUE, + ); + $this->drupalCreateContentType($type_values); + + $values['type'] = 'article'; + $values['title'] = $this->randomName(); + $values['promote'] = TRUE; + $values['status'] = TRUE; + $values['created'] = REQUEST_TIME; + + $node = $this->drupalCreateNode($values); + $this->drupalGet('node/' . $node->id()); + + // Views kicks in + $this->drupalGet('node'); + $this->assertRaw($values['title'], "Title found"); + + // Make base theme default first + \Drupal::config('system.theme') + ->set('default', 'test_subtheme') + ->save(); + $this->assertEqual(\Drupal::config('system.theme')->get('default'), 'test_subtheme'); + + // Views kicks in + $this->drupalGet('node'); + $this->assertRaw($values['title'], "Title found"); + } + +} diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php index c9b097a..0451544 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -1360,7 +1360,7 @@ class ViewExecutable { // Let the themes play too, because pre render is a very themey thing. if (isset($GLOBALS['base_theme_info']) && isset($GLOBALS['theme'])) { foreach ($GLOBALS['base_theme_info'] as $base) { - $module_handler->invoke($base, 'views_pre_render', array($this)); + $module_handler->invoke($base->name, 'views_pre_render', array($this)); } $module_handler->invoke($GLOBALS['theme'], 'views_pre_render', array($this)); @@ -1384,7 +1384,7 @@ class ViewExecutable { // Let the themes play too, because post render is a very themey thing. if (isset($GLOBALS['base_theme_info']) && isset($GLOBALS['theme'])) { foreach ($GLOBALS['base_theme_info'] as $base) { - $module_handler->invoke($base, 'views_post_render', array($this)); + $module_handler->invoke($base->name, 'views_post_render', array($this)); } $module_handler->invoke($GLOBALS['theme'], 'views_post_render', array($this));