Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/174993

Change subject: Fix SkinTemplateNavigationUniversal hook to work on talk pages
......................................................................

Fix SkinTemplateNavigationUniversal hook to work on talk pages

Change-Id: I98c648208242c4c730ad37266c3ff2c8504f5a98
---
M GlobalUserPage.hooks.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalUserPage 
refs/changes/93/174993/1

diff --git a/GlobalUserPage.hooks.php b/GlobalUserPage.hooks.php
index 61b755f..44cc917 100644
--- a/GlobalUserPage.hooks.php
+++ b/GlobalUserPage.hooks.php
@@ -87,13 +87,15 @@
         * @return bool
         */
        public static function onSkinTemplateNavigationUniversal( &$sktemplate, 
&$links ) {
-               $title = $sktemplate->getTitle();
+               $title = $sktemplate->getTitle()->getSubjectPage(); // We want 
the user page
 
                if ( !$title->exists() && GlobalUserPage::displayGlobalPage( 
$title ) ) {
                        // Removes ?action=edit&redlink=1
                        $links['namespaces']['user']['href'] = 
$title->getFullURL();
+                       // Remove the "new" class:
                        // "selected new" --> "selected"
-                       $links['namespaces']['user']['class'] = 'selected';
+                       // "new" --> ""
+                       $links['namespaces']['user']['class'] = trim( 
str_replace( 'new', '', $links['namespaces']['user']['class'] ) );
                }
 
                return true;

-- 
To view, visit https://gerrit.wikimedia.org/r/174993
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I98c648208242c4c730ad37266c3ff2c8504f5a98
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalUserPage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to