diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 202d1cad9ea79cf3f821e4f02d3e96d219787d29..fa3dd35e78eb0cfa308e35c3b0821756216d589b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,7 +5,6 @@ Drupal 7.51, xxxx-xx-xx (development version) used as an admin theme. - Exceptions thrown in dblog_watchdog() are now caught and ignored. - Clarified the warning that appears when modules are missing or have moved. -- If the page title is "0", it is now displayed. - Log messages are now XSS filtered on display. - Draggable tables do now work on touch screen devices. - Added setting for allowing double underscores in CSS identifiers. diff --git a/includes/theme.inc b/includes/theme.inc index 8f929ac2142a6d7b7c2405be95f40949489298b3..9b606e9fb199cd395e64739c3fcbaf56e2037294 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -2597,10 +2597,9 @@ function template_preprocess_html(&$variables) { } // Construct page title. - $title = drupal_get_title(); - if (strlen(trim($title))) { + if (drupal_get_title()) { $head_title = array( - 'title' => strip_tags($title), + 'title' => strip_tags(drupal_get_title()), 'name' => check_plain(variable_get('site_name', 'Drupal')), ); } @@ -2699,8 +2698,7 @@ function template_process_page(&$variables) { $variables['breadcrumb'] = theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb())); } if (!isset($variables['title'])) { - $title = drupal_get_title(); - $variables['title'] = strlen(trim($title)) ? $title : NULL; + $variables['title'] = drupal_get_title(); } // Generate messages last in order to capture as many as possible for the diff --git a/modules/node/node.test b/modules/node/node.test index 8ec01a41f654ef7ea6ce202dbad2b6d3d171bf37..e8eb459e3bb876146c62980fa1dd91a37aa6ebca 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -1943,32 +1943,6 @@ class NodeTitleTestCase extends DrupalWebTestCase { // Test node title is clickable on teaser list (/node). $this->drupalGet('node'); $this->clickLink($node->title); - - // Test edge cases. - // When node title is set to 0, the title should be '0'. - $node = $this->drupalCreateNode(array('title' => '0')); - $this->drupalGet('node/' . $node->nid); - $this->assertTitle('0' . ' | Drupal', 'Page title is equal to 0.', 'Node'); - // Test that 0 appears in the template

. - $xpath = '//h1[@id="page-title"]'; - $this->assertEqual(trim(current($this->xpath($xpath))), - '0', - 'Node title is displayed as 0.', - 'Node'); - - // When node title is empty string, the h1 doesn't show up. - $node = $this->drupalCreateNode(array('title' => '')); - $this->drupalGet('node/' . $node->nid); - $this->assertTitle('Drupal', '', 'Node'); - $xpath = '//h1[@id="page-title"]'; - $this->assertIdentical(count($this->xpath($xpath)), 0); - - // When node title is string with only spaces, the h1 doesn't show up. - $node = $this->drupalCreateNode(array('title' => ' ')); - $this->drupalGet('node/' . $node->nid); - $this->assertTitle('Drupal', '', 'Node'); - $xpath = '//h1[@id="page-title"]'; - $this->assertIdentical(count($this->xpath($xpath)), 0); } } diff --git a/modules/system/page.tpl.php b/modules/system/page.tpl.php index a844092dab19d9ef2d88537875773ad8172dd083..bd61489e0f8beac69b14f8cc3987715764b22b48 100644 --- a/modules/system/page.tpl.php +++ b/modules/system/page.tpl.php @@ -86,7 +86,7 @@
- +
@@ -126,7 +126,7 @@
-

+

diff --git a/themes/bartik/templates/page.tpl.php b/themes/bartik/templates/page.tpl.php index a9097645bdc613cb4c207c3c5e67ea9e996ac91e..62f58d73e1fbbfcd733c81df30e1c4f336de6eb6 100644 --- a/themes/bartik/templates/page.tpl.php +++ b/themes/bartik/templates/page.tpl.php @@ -99,7 +99,7 @@
> - +
> @@ -187,7 +187,7 @@
- +

diff --git a/themes/garland/page.tpl.php b/themes/garland/page.tpl.php index ae5b0c3552816a9a7e609256be8fbb4cefefcb05..326255cd4ef894a9dcbf6ecf23cae5d76143e51a 100644 --- a/themes/garland/page.tpl.php +++ b/themes/garland/page.tpl.php @@ -8,7 +8,7 @@

diff --git a/themes/seven/page.tpl.php b/themes/seven/page.tpl.php index 32de3fbc725e45b1fc032a1cf118c0ec0780dd29..6ab3ae8417c9366bc348c93fb7a2aa40536cf4af 100644 --- a/themes/seven/page.tpl.php +++ b/themes/seven/page.tpl.php @@ -2,7 +2,7 @@
- +