Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/51336
Change subject: Bug 45517: Get user id from revision
......................................................................
Bug 45517: Get user id from revision
This accesses user id the same way as SpecialMobileDiff
Not tested as unable to replicate but hopefully will fix inconsistencies
between diff page and watchlist
Change-Id: I85959b1eda05fc8077cec1da77c91d6bfa783c98
---
M includes/specials/SpecialMobileWatchlist.php
1 file changed, 8 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/36/51336/1
diff --git a/includes/specials/SpecialMobileWatchlist.php
b/includes/specials/SpecialMobileWatchlist.php
index 8a85d95..f73b077 100644
--- a/includes/specials/SpecialMobileWatchlist.php
+++ b/includes/specials/SpecialMobileWatchlist.php
@@ -436,17 +436,21 @@
if ( $revId ) {
$diffTitle = Title::makeTitle( NS_SPECIAL,
'MobileDiff/' . $revId ); // @fixme this seems lame
$diffLink = $diffTitle->getLocalUrl();
+ $rev = Revision::newFromId( $revId );
+ $userId = $rev->getUser();
} else {
// hack -- use full log entry display
$diffLink = Title::makeTitle( $row->rc_namespace,
$row->rc_title )->getLocalUrl();
+ $userId = $row->rc_user;
}
- if ( $row->rc_user == 0 ) {
+ if ( $userId ) {
+ $user = User::newFromId( $userId );
+ $username = $user->getName();
+ $usernameClass = 'mw-mf-user';
+ } else {
$username = $this->msg(
'mobile-frontend-changeslist-ip' )->plain();
$usernameClass = 'mw-mf-user mw-mf-anon';
- } else {
- $username = htmlspecialchars( $row->rc_user_text );
- $usernameClass = 'mw-mf-user';
}
if ( $comment === '' ) {
--
To view, visit https://gerrit.wikimedia.org/r/51336
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I85959b1eda05fc8077cec1da77c91d6bfa783c98
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits