Anomie has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374857 )

Change subject: Use CommentStore to access core comment fields
......................................................................

Use CommentStore to access core comment fields

See core change Ic3a434c0.

Bug: T166732
Change-Id: I00f2dcd3532f0094554ad0918282d14a33cf478d
---
M includes/CentralAuthUser.php
1 file changed, 11 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/57/374857/1

diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index cb340ef..19eb724 100644
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -2488,19 +2488,25 @@
                        UserGroupMembership::getMembershipsForUser( 
$data['id'], $db );
 
                // And while we're in here, look for user blocks :D
-               $result = $db->select( 'ipblocks',
+               $commentStore = CommentStore::newKey( 'ipb_reason' );
+               $commentQuery = $commentStore->getJoin();
+               $result = $db->select(
+                       [ 'ipblocks' ] + $commentQuery['tables'],
                        [
-                               'ipb_expiry', 'ipb_reason', 'ipb_block_email',
+                               'ipb_expiry', 'ipb_block_email',
                                'ipb_anon_only', 'ipb_create_account',
                                'ipb_enable_autoblock', 'ipb_allow_usertalk',
-                       ],
+                       ] + $commentQuery['fields'],
                        [ 'ipb_user' => $data['id'] ],
-                       __METHOD__ );
+                       __METHOD__,
+                       [],
+                       $commentQuery['joins']
+               );
                global $wgLang;
                foreach ( $result as $row ) {
                        if ( $wgLang->formatExpiry( $row->ipb_expiry, TS_MW ) > 
wfTimestampNow() ) {
                                $data['block-expiry'] = $row->ipb_expiry;
-                               $data['block-reason'] = $row->ipb_reason;
+                               $data['block-reason'] = 
$commentStore->getComment( $row )->text;
                                $data['block-anononly'] = 
(bool)$row->ipb_anon_only;
                                $data['block-nocreate'] = 
(bool)$row->ipb_create_account;
                                $data['block-noautoblock'] = !( 
(bool)$row->ipb_enable_autoblock );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I00f2dcd3532f0094554ad0918282d14a33cf478d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

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

Reply via email to