Issue #2150083 by BarisW: Front page misses page title in <title> tag.
parent
3bb5f796f6
commit
31c48739ae
|
@ -2128,7 +2128,7 @@ function template_preprocess_html(&$variables) {
|
||||||
|
|
||||||
$site_config = \Drupal::config('system.site');
|
$site_config = \Drupal::config('system.site');
|
||||||
// Construct page title.
|
// Construct page title.
|
||||||
if (isset($variables['page']['#title'])) {
|
if (!empty($variables['page']['#title'])) {
|
||||||
$head_title = array(
|
$head_title = array(
|
||||||
'title' => strip_tags($variables['page']['#title']),
|
'title' => strip_tags($variables['page']['#title']),
|
||||||
'name' => String::checkPlain($site_config->get('name')),
|
'name' => String::checkPlain($site_config->get('name')),
|
||||||
|
|
|
@ -19,7 +19,7 @@ class FrontPageTest extends WebTestBase {
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public static $modules = array('node', 'system_test');
|
public static $modules = array('node', 'system_test', 'views');
|
||||||
|
|
||||||
public static function getInfo() {
|
public static function getInfo() {
|
||||||
return array(
|
return array(
|
||||||
|
@ -46,8 +46,16 @@ class FrontPageTest extends WebTestBase {
|
||||||
/**
|
/**
|
||||||
* Test front page functionality.
|
* Test front page functionality.
|
||||||
*/
|
*/
|
||||||
function testDrupalIsFrontPage() {
|
public function testDrupalFrontPage() {
|
||||||
|
// Create a promoted node to test the <title> tag on the front page view.
|
||||||
|
$settings = array(
|
||||||
|
'title' => $this->randomName(8),
|
||||||
|
'promote' => 1,
|
||||||
|
);
|
||||||
|
$node = $this->drupalCreateNode($settings);
|
||||||
$this->drupalGet('');
|
$this->drupalGet('');
|
||||||
|
$this->assertTitle('Home | Drupal');
|
||||||
|
|
||||||
$this->assertText(t('On front page.'), 'Path is the front page.');
|
$this->assertText(t('On front page.'), 'Path is the front page.');
|
||||||
$this->drupalGet('node');
|
$this->drupalGet('node');
|
||||||
$this->assertText(t('On front page.'), 'Path is the front page.');
|
$this->assertText(t('On front page.'), 'Path is the front page.');
|
||||||
|
|
Loading…
Reference in New Issue