Santhosh has uploaded a new change for review.

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

Change subject: Return global user name from find API
......................................................................

Return global user name from find API

Wrong names were shown in translation conflict dialog because of this

Change-Id: I9af76a8238c878a754c83f63ca3cbec65c3866ad
---
M api/ApiQueryContentTranslation.php
M includes/GlobalUser.php
2 files changed, 7 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/84/184584/1

diff --git a/api/ApiQueryContentTranslation.php 
b/api/ApiQueryContentTranslation.php
index 3ea8167..07335e5 100644
--- a/api/ApiQueryContentTranslation.php
+++ b/api/ApiQueryContentTranslation.php
@@ -78,7 +78,9 @@
                if ( $translation !== null ) {
                        $translator = 
$translation->translation['lastUpdatedTranslator'];
                        $translation->translation['translatorName'] =
-                               User::newFromId( $translator )->getName();
+                               ContentTranslation\GlobalUser::newFromUser(
+                                       User::newFromId($translator )
+                               )->getName();
                        $result->addValue(
                                array( 'query', 'contenttranslation' ),
                                'translation', $translation->translation
diff --git a/includes/GlobalUser.php b/includes/GlobalUser.php
index 781ab50..80d74a6 100644
--- a/includes/GlobalUser.php
+++ b/includes/GlobalUser.php
@@ -24,4 +24,8 @@
        public function getId() {
                return $this->user->getId();
        }
+
+       public function getName() {
+               return $this->user->getName();
+       }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9af76a8238c878a754c83f63ca3cbec65c3866ad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to