summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2013-12-18 04:48:02 (GMT)
committerwebchick2013-12-18 04:48:02 (GMT)
commite58427adf682bd4851af3fb815bf669719784a40 (patch)
treef8e4c57c6d41f5491c68d4558473e3bbdc45dcb0
parent77addbef6ec235a238cf976c82cf4d6db87c5d2b (diff)
Issue #2102487 by vijaycs85, ACF: Add back in tab removed in [#1972990] and remove drupal_set_title() in tracker module controllers.
-rw-r--r--core/modules/tracker/lib/Drupal/tracker/Controller/TrackerUserTab.php2
-rw-r--r--core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php3
-rw-r--r--core/modules/tracker/tracker.local_tasks.yml5
-rw-r--r--core/modules/tracker/tracker.pages.inc9
4 files changed, 10 insertions, 9 deletions
diff --git a/core/modules/tracker/lib/Drupal/tracker/Controller/TrackerUserTab.php b/core/modules/tracker/lib/Drupal/tracker/Controller/TrackerUserTab.php
index cb595f7..49a7574 100644
--- a/core/modules/tracker/lib/Drupal/tracker/Controller/TrackerUserTab.php
+++ b/core/modules/tracker/lib/Drupal/tracker/Controller/TrackerUserTab.php
@@ -28,6 +28,6 @@ class TrackerUserTab extends ControllerBase {
* Title callback for the tracker.user_tab route.
*/
public function getTitle(UserInterface $user) {
- return String::checkPlain(user_format_name($user));
+ return String::checkPlain($user->getUsername());
}
}
diff --git a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php
index 0abd95e..e1895f4 100644
--- a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php
+++ b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php
@@ -118,6 +118,9 @@ class TrackerTest extends WebTestBase {
$this->assertText($my_published->label(), "Published nodes show up in the user's tracker listing.");
$this->assertNoText($other_published_no_comment->label(), "Other user's nodes do not show up in the user's tracker listing.");
$this->assertText($other_published_my_comment->label(), "Nodes that the user has commented on appear in the user's tracker listing.");
+ // Verify that title and tab title have been set correctly.
+ $this->assertText('Track', 'The user tracker tab has the name "Track".');
+ $this->assertTitle(t('@name | @site', array('@name' => $this->user->getUsername(), '@site' => \Drupal::config('system.site')->get('name'))), 'The user tracker page has the correct page title.');
// Verify that unpublished comments are removed from the tracker.
$admin_user = $this->drupalCreateUser(array('post comments', 'administer comments', 'access user profiles'));
diff --git a/core/modules/tracker/tracker.local_tasks.yml b/core/modules/tracker/tracker.local_tasks.yml
index 7600bd0..8a0ab77 100644
--- a/core/modules/tracker/tracker.local_tasks.yml
+++ b/core/modules/tracker/tracker.local_tasks.yml
@@ -8,3 +8,8 @@ tracker.users_recent_tab:
title: 'My recent content'
tab_root_id: tracker.page_tab
class: '\Drupal\tracker\Plugin\Menu\UserTrackerTab'
+
+tracker.user_tab:
+ route_name: tracker.user_tab
+ tab_root_id: user.view
+ title: 'Track'
diff --git a/core/modules/tracker/tracker.pages.inc b/core/modules/tracker/tracker.pages.inc
index eeef432..332d9ac 100644
--- a/core/modules/tracker/tracker.pages.inc
+++ b/core/modules/tracker/tracker.pages.inc
@@ -17,19 +17,12 @@
*
* @see tracker_menu()
*/
-function tracker_page($account = NULL, $set_title = FALSE) {
+function tracker_page($account = NULL) {
if ($account) {
$query = db_select('tracker_user', 't')
->extend('Drupal\Core\Database\Query\PagerSelectExtender')
->addMetaData('base_table', 'tracker_user')
->condition('t.uid', $account->id());
-
- if ($set_title) {
- // When viewed from user/%user/track, display the name of the user
- // as page title -- the tab title remains Track so this needs to be done
- // here and not in the menu definition.
- drupal_set_title(user_format_name($account));
- }
}
else {
$query = db_select('tracker_node', 't', array('target' => 'slave'))