[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Remove duplicate pages from WITHIN filter results in drilldown

2017-09-01 Thread Fz-29 (Code Review)
Fz-29 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375490 )

Change subject: Remove duplicate pages from WITHIN filter results in drilldown
..

Remove duplicate pages from WITHIN filter results in drilldown

Change-Id: Ia135feb7797039710aa2e809290ba62e7d07b3e7
---
M drilldown/CargoAppliedFilter.php
M drilldown/CargoFilter.php
2 files changed, 15 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/90/375490/1

diff --git a/drilldown/CargoAppliedFilter.php b/drilldown/CargoAppliedFilter.php
index 1849506..29525f5 100644
--- a/drilldown/CargoAppliedFilter.php
+++ b/drilldown/CargoAppliedFilter.php
@@ -112,11 +112,22 @@
$matches = array();
if ( preg_match( "/^~within (.+)/", $fv->text, 
$matches ) ) {
$value = $matches[1];
-   $hierarchyTableName = 
$this->filter->tableName . '__' . $this->filter->name . '__hierarchy';
+   $fieldName = $this->filter->name;
+   $fieldTableName = 
$this->filter->tableName . '__' . $fieldName;
+   $hierarchyTableName = $fieldTableName . 
'__hierarchy';
+   $fieldTableName = $cdb->tableName( 
$fieldTableName );
$hierarchyTableName = $cdb->tableName( 
$hierarchyTableName );
+
$leftCond = " $hierarchyTableName._left 
>= ( SELECT _left FROM " . $hierarchyTableName . " WHERE _value = 
'{$cdb->strencode( $value )}' ) ";
$rightCond = " 
$hierarchyTableName._right <= ( SELECT _right FROM " . $hierarchyTableName . " 
WHERE _value = '{$cdb->strencode( $value )}' ) ";
-   $sql .= "( (" . $leftCond . ") AND (" . 
$rightCond . ") )";
+   if ( 
$this->filter->fieldDescription->mIsList ) {
+   $sql .= $cdb->tableName( 
$this->filter->tableName ) .  "._ID IN
+   (SELECT 
$fieldTableName._rowID FROM $fieldTableName WHERE $fieldTableName._value IN
+   (SELECT 
$hierarchyTableName._value FROM $hierarchyTableName WHERE ($leftCond) AND 
($rightCond)))";
+   } else {
+   $sql .= $cdb->tableName( 
$this->filter->tableName ) . ".$fieldName IN
+   (SELECT 
$hierarchyTableName._value FROM $hierarchyTableName WHERE ($leftCond) AND 
($rightCond))";
+   }
}
} elseif ( $fv->is_none ) {
$checkNullOrEmptySql = ( $cdb->getType() == 
'postgres' ? '' : "$value_field = '' OR ") .
@@ -157,23 +168,13 @@
$tableNames = array();
$conds = array();
$joinConds = array();
-   $fieldTableName = $mainTableName;
-   $fieldName = $this->filter->name;
 
$conds[] = $this->checkSQL();
 
-   if ( $this->filter->fieldDescription->mIsList ) {
+   if ( $this->filter->fieldDescription->mIsList && 
!$this->filter->fieldDescription->mIsHierarchy ) {
$fieldTableName = $mainTableName . '__' . 
$this->filter->name;
-   $fieldName = '_value';
$tableNames[] = $fieldTableName;
$joinConds[$fieldTableName] = 
CargoUtils::joinOfMainAndFieldTable( $cdb, $mainTableName, $fieldTableName );
-   }
-
-   if ( $this->filter->fieldDescription->mIsHierarchy ) {
-   $hierarchyTableName = $this->filter->tableName . '__' . 
$this->filter->name . '__hierarchy';
-   $tableNames[] = $hierarchyTableName;
-   $joinConds[$hierarchyTableName] = 
CargoUtils::joinOfSingleFieldAndHierarchyTable( $cdb,
-   $fieldTableName, $fieldName, 
$hierarchyTableName );
}
 
return array( $tableNames, $conds, $joinConds );
diff --git a/drilldown/CargoFilter.php b/drilldown/CargoFilter.php
index 760dc89..2bb1124 100644
--- a/drilldown/CargoFilter.php
+++ b/drilldown/CargoFilter.php
@@ -113,19 +113,10 @@
 
foreach ( $appliedFilters as $af ) {
$conds[] = $af->checkSQL();
-   $fieldTableName = $this->tableName;
-   $columnName = $af->filter->name;
-   if ( $af->filter->fieldDescription->mIsList ) {
+   if 

[MediaWiki-commits] [Gerrit] wikidata...gui-deploy[production]: Merging from 321b9030c5656ea8c48974e0156b8c79f1a72d49:

2017-09-01 Thread Smalyshev (Code Review)
Smalyshev has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375488 )

Change subject: Merging from 321b9030c5656ea8c48974e0156b8c79f1a72d49:
..


Merging from 321b9030c5656ea8c48974e0156b8c79f1a72d49:

Merge "expose sample url vars for overriding"

Change-Id: I641eda346ea7eb956fc3b1a3676e7f44027f55bb
---
M embed.html
M i18n/br.json
M i18n/en.json
M i18n/qqq.json
M index.html
R js/embed.wdqs.min.0126097c54f58815ba44.js
D js/wdqs.min.6999b60ebc8506c74556.js
A js/wdqs.min.b01268f900854aee6584.js
A logo-embed.svg
9 files changed, 17 insertions(+), 11 deletions(-)

Approvals:
  Smalyshev: Verified; Looks good to me, approved




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I641eda346ea7eb956fc3b1a3676e7f44027f55bb
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui-deploy
Gerrit-Branch: production
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Smalyshev 

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


[MediaWiki-commits] [Gerrit] wikidata...gui-deploy[production]: Merging from 321b9030c5656ea8c48974e0156b8c79f1a72d49:

2017-09-01 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375488 )

Change subject: Merging from 321b9030c5656ea8c48974e0156b8c79f1a72d49:
..

Merging from 321b9030c5656ea8c48974e0156b8c79f1a72d49:

Merge "expose sample url vars for overriding"

Change-Id: I641eda346ea7eb956fc3b1a3676e7f44027f55bb
---
M embed.html
M i18n/br.json
M i18n/en.json
M i18n/qqq.json
M index.html
R js/embed.wdqs.min.0126097c54f58815ba44.js
D js/wdqs.min.6999b60ebc8506c74556.js
A js/wdqs.min.b01268f900854aee6584.js
A logo-embed.svg
9 files changed, 17 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui-deploy 
refs/changes/88/375488/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I641eda346ea7eb956fc3b1a3676e7f44027f55bb
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui-deploy
Gerrit-Branch: production
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] wikidata...gui[master]: expose sample url vars for overriding

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/374111 )

Change subject: expose sample url vars for overriding
..


expose sample url vars for overriding

The hardcoded Wikidata sample URLs need to be
overridable in order to be used on other sites.

This is just a first step - eventually we should
make them globally configurable, but I think we
would greatly benefit from ES6 refactoring first.

Change-Id: I8041dbfb0b9599287edda04ff9a21cf91693c0b0
---
M wikibase/queryService/api/QuerySamples.js
1 file changed, 7 insertions(+), 8 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  Jonas Kress (WMDE): Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/wikibase/queryService/api/QuerySamples.js 
b/wikibase/queryService/api/QuerySamples.js
index 1485e58..c5c97fa 100644
--- a/wikibase/queryService/api/QuerySamples.js
+++ b/wikibase/queryService/api/QuerySamples.js
@@ -5,11 +5,6 @@
 wikibase.queryService.api.QuerySamples = ( function ( $ ) {
'use strict';
 
-   var API_SERVER = 'https://www.wikidata.org/',
-   API_ENDPOINT = API_SERVER + 'api/rest_v1/page/html/',
-   PAGE_TITLE = 'Wikidata:SPARQL_query_service/queries/examples',
-   PAGE_URL = API_SERVER + 'wiki/' + PAGE_TITLE;
-
/**
 * QuerySamples API for the Wikibase query service
 *
@@ -22,6 +17,10 @@
 */
function SELF( language ) {
this._language = language;
+   this._apiServer = 'https://www.wikidata.org/';
+   this._apiEndpoint = this._apiServer + 'api/rest_v1/page/html/';
+   this._pageTitle = 
'Wikidata:SPARQL_query_service/queries/examples';
+   this._pageUrl = this._apiServer + 'wiki/' + this._pageTitle;
}
 
/**
@@ -37,12 +36,12 @@
var self = this;
 
return $.ajax( {
-   url: API_ENDPOINT + encodeURIComponent( PAGE_TITLE + 
'/' + self._language ) + '?redirect=false',
+   url: self._apiEndpoint + encodeURIComponent( 
self._pageTitle + '/' + self._language ) + '?redirect=false',
dataType: 'html'
} ).catch( function() {
// retry without language
return $.ajax( {
-   url: API_ENDPOINT + encodeURIComponent( 
PAGE_TITLE ) + '?redirect=false',
+   url: self._apiEndpoint + encodeURIComponent( 
self._pageTitle ) + '?redirect=false',
dataType: 'html'
} );
} ).then( function ( data ) {
@@ -136,7 +135,7 @@
return {
title:title,
query:query,
-   href: PAGE_URL + '#' + encodeURIComponent( 
title.replace( / /g, '_' ) ).replace( /%/g, '.' ),
+   href: self._pageUrl + '#' + 
encodeURIComponent( title.replace( / /g, '_' ) ).replace( /%/g, '.' ),
tags: self._extractTagsFromSPARQL( query ),
category: self._findPrevHeader( titleEl 
).text().trim()
};

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8041dbfb0b9599287edda04ff9a21cf91693c0b0
Gerrit-PatchSet: 4
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Yurik 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: Lucas Werkmeister (WMDE) 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: Yurik 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix duplicate page entries in case of WITHIN filter for hier...

2017-09-01 Thread Fz-29 (Code Review)
Fz-29 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375487 )

Change subject: Fix duplicate page entries in case of WITHIN filter for 
hierarchy fields holding a list of values
..

Fix duplicate page entries in case of WITHIN filter for hierarchy fields 
holding a list of values

Change-Id: I36408fdb4f97becba9ef630668ffe29375adfe6d
---
M drilldown/CargoSpecialDrilldown.php
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/87/375487/1

diff --git a/drilldown/CargoSpecialDrilldown.php 
b/drilldown/CargoSpecialDrilldown.php
index 1887990..2304aaf 100644
--- a/drilldown/CargoSpecialDrilldown.php
+++ b/drilldown/CargoSpecialDrilldown.php
@@ -1283,6 +1283,7 @@
$tableNames = array( $this->tableName );
$conds = array();
$joinConds = array();
+   $queryOptions = array();
 
if ( $this->fullTextSearchTerm != null ) {
list( $curTableNames, $curConds, $curJoinConds ) =
@@ -1297,6 +1298,11 @@
$tableNames = array_merge( $tableNames, $curTableNames 
);
$conds = array_merge( $conds, $curConds );
$joinConds = array_merge( $joinConds, $curJoinConds );
+   if ( $af->filter->fieldDescription->mIsHierarchy && 
$af->filter->fieldDescription->mIsList ) {
+   $hierarchyFieldTable = $this->tableName . "__" 
. $af->filter->name;
+   $queryOptions = array_merge( $queryOptions, 
array( "GROUP BY" =>
+   CargoUtils::escapedFieldName( $cdb, 
$hierarchyFieldTable, '_rowID' ) ) );
+   }
}
 
$aliasedFieldNames = array(
@@ -1333,7 +1339,7 @@
'fields' => $aliasedFieldNames,
'conds' => $conds,
'join_conds' => $joinConds,
-   'options' => array()
+   'options' => $queryOptions
);
 
return $queryInfo;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I36408fdb4f97becba9ef630668ffe29375adfe6d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Fz-29 

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


[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375485 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: Ia475468fb2f9ccd94afd90322962458207464ad5
---
M Collection.body.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Collection.body.php b/Collection.body.php
index 9de5df1..7b4a0d7 100644
--- a/Collection.body.php
+++ b/Collection.body.php
@@ -688,7 +688,7 @@
self::limitExceeded();
return false;
}
-   $db = wfGetDB( DB_SLAVE );
+   $db = wfGetDB( DB_REPLICA );
$tables = [ 'page', 'categorylinks' ];
$fields = [ 'page_namespace', 'page_title' ];
$options = [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia475468fb2f9ccd94afd90322962458207464ad5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Collection
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: C. Scott Ananian 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CheckUser[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375480 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I1adc18895d6e6e3ec3937eb7443fa0d8f553802d
---
M CheckUser.hooks.php
M specials/SpecialCheckUser.php
M specials/SpecialCheckUserLog.php
3 files changed, 10 insertions(+), 10 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/CheckUser.hooks.php b/CheckUser.hooks.php
index 3124b88..f00d161 100644
--- a/CheckUser.hooks.php
+++ b/CheckUser.hooks.php
@@ -163,7 +163,7 @@
// Get agent
$agent = $wgRequest->getHeader( 'User-Agent' );
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$rcRow = [
'cuc_namespace'  => NS_USER,
'cuc_title'  => '',
@@ -457,7 +457,7 @@
 * @return bool
 */
public static function doRetroactiveAutoblock( Block $block, array 
&$blockIds ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$user = User::newFromName( (string)$block->getTarget(), false );
if ( !$user->getId() ) {
diff --git a/specials/SpecialCheckUser.php b/specials/SpecialCheckUser.php
index cfc006d..b8b4c88 100644
--- a/specials/SpecialCheckUser.php
+++ b/specials/SpecialCheckUser.php
@@ -406,7 +406,7 @@
 */
protected function noMatchesMessage( $userName, $checkLast = true ) {
if ( $checkLast ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$user_id = User::idFromName( $userName );
if ( $user_id ) {
$revEdit = $dbr->selectField( 'revision',
@@ -476,7 +476,7 @@
// Record check...
self::addLogEntry( 'userips', 'user', $user, $reason, $user_id 
);
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$time_conds = $this->getTimeConds( $period );
// Ordering by the latest timestamp makes a small filesort on 
the IP list
 
@@ -623,7 +623,7 @@
 */
protected function doIPEditsRequest( $ip, $xfor = false, $reason = '', 
$period = 0 ) {
$out = $this->getOutput();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
// Invalid IPs are passed in as a blank string
$ip_conds = self::getIpConds( $dbr, $ip, $xfor );
@@ -817,7 +817,7 @@
// Record check...
self::addLogEntry( 'useredits', 'user', $user, $reason, 
$user_id );
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$user_cond = "cuc_user = '$user_id'";
$time_conds = $this->getTimeConds( $period );
// Ordered in descent by timestamp. Causes large filesorts if 
there are many edits.
@@ -924,7 +924,7 @@
) {
global $wgMemc;
$out = $this->getOutput();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
// Invalid IPs are passed in as a blank string
$ip_conds = self::getIpConds( $dbr, $ip, $xfor );
@@ -1488,7 +1488,7 @@
 
protected static function userWasBlocked( $name ) {
$userpage = Title::makeTitle( NS_USER, $name );
-   return (bool)wfGetDB( DB_SLAVE )->selectField( 'logging', '1',
+   return (bool)wfGetDB( DB_REPLICA )->selectField( 'logging', '1',
[
'log_type' => [ 'block', 'suppress' ],
'log_action' => 'block',
@@ -1561,7 +1561,7 @@
if ( !$period ) {
return '1 = 1';
}
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$cutoff_unixtime = time() - ( $period * 24 * 3600 );
$cutoff_unixtime = $cutoff_unixtime - ( $cutoff_unixtime % 
86400 );
$cutoff = $dbr->addQuotes( $dbr->timestamp( $cutoff_unixtime ) 
);
diff --git a/specials/SpecialCheckUserLog.php b/specials/SpecialCheckUserLog.php
index 33bb29f..32d096d 100644
--- a/specials/SpecialCheckUserLog.php
+++ b/specials/SpecialCheckUserLog.php
@@ -128,7 +128,7 @@
$conds = null;
 
if ( $start !== false ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
if ( $start === $end ) {
// Single IP address
$conds = [

-- 
To view, visit 

[MediaWiki-commits] [Gerrit] mediawiki...Comments[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375486 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I6dec35bb6094725118d02112ec66e5a36964a478
---
M includes/Comment.class.php
M includes/CommentFunctions.class.php
M includes/CommentsOfTheDay.class.php
M includes/CommentsPage.class.php
M includes/NumberOfComments.class.php
M includes/api/CommentBlock.api.php
M includes/specials/SpecialCommentIgnoreList.php
7 files changed, 14 insertions(+), 14 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/includes/Comment.class.php b/includes/Comment.class.php
index a6490a3..9057024 100644
--- a/includes/Comment.class.php
+++ b/includes/Comment.class.php
@@ -130,7 +130,7 @@
if ( isset( $data['current_vote'] ) ) {
$vote = $data['current_vote'];
} else {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
'Comments_Vote',
array( 'Comment_Vote_Score' ),
@@ -155,7 +155,7 @@
 
public static function newFromID( $id ) {
$context = RequestContext::getMain();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
if ( !is_numeric( $id ) || $id == 0 ) {
return null;
@@ -306,7 +306,7 @@
// Add a log entry.
self::log( 'add', $user, $page->id, $commentId, $text );
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
if (
class_exists( 'UserProfile' ) &&
$dbr->tableExists( 'user_stats' )
@@ -356,7 +356,7 @@
 * @return string
 */
function getScore() {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
'Comments_Vote',
array( 'SUM(Comment_Vote_Score) AS CommentScore' ),
diff --git a/includes/CommentFunctions.class.php 
b/includes/CommentFunctions.class.php
index afaccd0..d576e58 100644
--- a/includes/CommentFunctions.class.php
+++ b/includes/CommentFunctions.class.php
@@ -173,7 +173,7 @@
 */
static function getBlockList( $userId ) {
$blockList = array();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'Comments_block',
'cb_user_name_blocked',
@@ -187,7 +187,7 @@
}
 
static function isUserCommentBlocked( $userId, $userIdBlocked ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$s = $dbr->selectRow(
'Comments_block',
array( 'cb_id' ),
diff --git a/includes/CommentsOfTheDay.class.php 
b/includes/CommentsOfTheDay.class.php
index eeb86b1..bbadef7 100644
--- a/includes/CommentsOfTheDay.class.php
+++ b/includes/CommentsOfTheDay.class.php
@@ -62,7 +62,7 @@
if ( $data ) { // success, got it from memcached!
$comments = $data;
} elseif ( !$data || $skipCache ) { // just query the DB
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
if ( empty( $whereConds ) ) {
$whereConds = array(
diff --git a/includes/CommentsPage.class.php b/includes/CommentsPage.class.php
index 3887cb1..0dfc090 100644
--- a/includes/CommentsPage.class.php
+++ b/includes/CommentsPage.class.php
@@ -98,7 +98,7 @@
 * @return int
 */
function countTotal() {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$count = 0;
$s = $dbr->selectRow(
'Comments',
@@ -119,7 +119,7 @@
 */
function getLatestCommentID() {
$latestCommentID = 0;
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$s = $dbr->selectRow(
'Comments',
array( 'CommentID' ),
@@ -162,7 +162,7 @@
 *  a comment, including score, timestamp 
and more
 */
public function getComments() {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
// Defaults (for non-social wikis)
$tables = array(
diff --git a/includes/NumberOfComments.class.php 
b/includes/NumberOfComments.class.php
index 919c7a1..d48e950 100644
--- 

[MediaWiki-commits] [Gerrit] mediawiki...CloseWikis[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375484 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I3c0806be5480b10008f139734c10e724ba9c1b9d
---
M CloseWikis.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/CloseWikis.php b/CloseWikis.php
index ed27f52..661a989 100644
--- a/CloseWikis.php
+++ b/CloseWikis.php
@@ -88,7 +88,7 @@
 
static function getSlaveDB() {
global $wgCloseWikisDatabase;
-   return wfGetDB( DB_SLAVE, 'closewikis', $wgCloseWikisDatabase );
+   return wfGetDB( DB_REPLICA, 'closewikis', $wgCloseWikisDatabase 
);
}
 
static function getMasterDB() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c0806be5480b10008f139734c10e724ba9c1b9d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CloseWikis
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CleanChanges[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375483 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I336ec93093d3f0776569af486b9e08e2718bafba
---
M Filters.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/Filters.php b/Filters.php
index 81739ac..ba71aae 100644
--- a/Filters.php
+++ b/Filters.php
@@ -35,7 +35,7 @@
}
}
if ( count( $idfilters ) ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$conds[] = 'rc_user IN (' . $dbr->makeList( $idfilters 
) . ')';
$opts->setValue( 'users', $users );
}
@@ -87,7 +87,7 @@
return;
}
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$conds[] = 'rc_title ' . $dbr->buildLike( $dbr->anyString(), 
$trailer );
$opts->setValue( 'trailer', $trailer );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I336ec93093d3f0776569af486b9e08e2718bafba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CleanChanges
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Challenge[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375479 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I242416cecc2161b2d31c15a5a820777defa478b9
---
M includes/Challenge.class.php
M includes/specials/SpecialChallengeStandings.php
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/includes/Challenge.class.php b/includes/Challenge.class.php
index 0452c64..f89a8b8 100644
--- a/includes/Challenge.class.php
+++ b/includes/Challenge.class.php
@@ -260,7 +260,7 @@
$user = User::newFromId( $id );
$username = $user->getName();
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$dbw = wfGetDB( DB_MASTER );
$wins = 0;
$losses = 0;
@@ -377,7 +377,7 @@
 * @return int Challenge count for the given user (ID)
 */
static function getChallengeCount( $userId = 0 ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$challengeCount = 0;
 
$userSQL = array();
diff --git a/includes/specials/SpecialChallengeStandings.php 
b/includes/specials/SpecialChallengeStandings.php
index 25e19ed..fc5d637 100644
--- a/includes/specials/SpecialChallengeStandings.php
+++ b/includes/specials/SpecialChallengeStandings.php
@@ -34,7 +34,7 @@

';
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$sql = "SELECT challenge_record_username, 
challenge_record_user_id, challenge_wins, challenge_losses, challenge_ties, 
(challenge_wins / (challenge_wins + challenge_losses + challenge_ties) ) AS 
winning_percentage FROM {$dbr->tableName( 'challenge_user_record' )} ORDER BY 
(challenge_wins / (challenge_wins + challenge_losses + challenge_ties) ) DESC, 
challenge_wins DESC LIMIT 0,25";
$res = $dbr->query( $sql, __METHOD__ );
$x = 1;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I242416cecc2161b2d31c15a5a820777defa478b9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Challenge
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Buggy[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375474 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I64cda2ece43b1bb2a53fe36e1d62dc7a90f4339d
---
M Buggy.hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/Buggy.hooks.php b/Buggy.hooks.php
index 7df55b8..ddd04f8 100644
--- a/Buggy.hooks.php
+++ b/Buggy.hooks.php
@@ -41,7 +41,7 @@
$_ = $doesNotExist;
break;
case 'sql':
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$dbr->query( 'THIS IS AN 
ERROR', __METHOD__ );
}
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I64cda2ece43b1bb2a53fe36e1d62dc7a90f4339d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Buggy
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...BlogPage[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375470 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: Ic1179e5aee3ad7487bd7a85708877a9a130ea1a9
---
M includes/BlogPage.class.php
M includes/BlogPage.hooks.php
M includes/specials/SpecialArticleLists.php
M includes/specials/SpecialArticlesHome.php
4 files changed, 18 insertions(+), 18 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/includes/BlogPage.class.php b/includes/BlogPage.class.php
index c1cd48d..e0d9c92 100644
--- a/includes/BlogPage.class.php
+++ b/includes/BlogPage.class.php
@@ -202,7 +202,7 @@
 
if ( !$data ) {
wfDebugLog( 'BlogPage', "Loading create_date for page 
{$pageId} from database" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$createDate = $dbr->selectField(
'revision',
'rev_timestamp',// 
'UNIX_TIMESTAMP(rev_timestamp) AS create_date',
@@ -407,7 +407,7 @@
$articles = $data;
} else {
wfDebugLog( 'BlogPage', "Got blog author articles for 
user {$user_name} from DB" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$categoryTitle = Title::newFromText(
 wfMessage( 'blog-by-user-category', $user_name 
)->text()
);
@@ -511,7 +511,7 @@
 
if ( !$data ) {
wfDebugLog( 'BlogPage', "Loading recent editors for 
page {$pageTitleId} from DB" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$where = array(
'rev_page' => $pageTitleId,
@@ -604,7 +604,7 @@
$voters = array();
if ( !$data ) {
wfDebugLog( 'BlogPage', "Loading recent voters for page 
{$pageTitleId} from DB" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$where = array(
'vote_page_id' => $pageTitleId,
@@ -726,7 +726,7 @@
$popularBlogPosts = $data;
} else {
wfDebugLog( 'BlogPage', 'Got popular articles from DB' 
);
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
// Code sporked from Rob Church's NewestPages extension
// @todo FIXME: adding categorylinks table and that one 
where
// clause causes an error about "unknown column 
'page_id' on ON
@@ -817,7 +817,7 @@
// We could do complicated LIKE stuff with the 
categorylinks table,
// but I think we can safely assume that stuff in the 
NS_BLOG NS
// is blog-related :)
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
// Code sporked from Rob Church's NewestPages extension
$res = $dbr->select(
'page',
@@ -960,7 +960,7 @@
$commentCount = $data;
} else {
wfDebugLog( 'BlogPage', "Got comments count for the 
page with ID {$id} from DB" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$commentCount = (int)$dbr->selectField(
'Comments',
'COUNT(*) AS count',
@@ -993,7 +993,7 @@
$voteCount = $data;
} else {
wfDebugLog( 'BlogPage', "Got vote count for the page 
with ID {$id} from DB" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$voteCount = (int)$dbr->selectField(
'Vote',
'COUNT(*) AS count',
@@ -1109,7 +1109,7 @@
$data = $wgMemc->get( $key );
 
if ( !$data ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$il_to = $dbr->selectField(
'imagelinks',
array( 'il_to' ),
diff --git a/includes/BlogPage.hooks.php b/includes/BlogPage.hooks.php
index 5568fbf..94e9fa4 100644
--- a/includes/BlogPage.hooks.php
+++ b/includes/BlogPage.hooks.php
@@ -88,7 +88,7 @@
 

[MediaWiki-commits] [Gerrit] mediawiki...CategoryTests[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375476 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I1d7139855f39b9f5f844207f6246226fac8217f7
---
M CategoryTests.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/CategoryTests.php b/CategoryTests.php
index 225a07f..398b49b 100644
--- a/CategoryTests.php
+++ b/CategoryTests.php
@@ -58,7 +58,7 @@
return $else;
}
$catkey = $cattitle->getDBkey();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
array( 'page', 'categorylinks' ),
'cl_from',
@@ -90,7 +90,7 @@
$page = $title->getDBkey();
$ns = $title->getNamespace();
}
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
array( 'page', 'categorylinks' ),
'cl_from',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1d7139855f39b9f5f844207f6246226fac8217f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CategoryTests
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375475 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I2d6444711f1192001a54f8f00d9c0bcf78ea5cb6
---
M CargoPageData.php
M maintenance/setCargoFileData.php
M maintenance/setCargoPageData.php
M specials/CargoDeleteTable.php
4 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/CargoPageData.php b/CargoPageData.php
index 8f5efdd..81256c2 100644
--- a/CargoPageData.php
+++ b/CargoPageData.php
@@ -104,7 +104,7 @@
if ( in_array( 'categories', $wgCargoPageDataColumns ) ) {
$pageCategories = array();
if ( !$setToBlank ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'categorylinks',
'cl_to',
@@ -120,7 +120,7 @@
$pageDataValues['_categories'] = $pageCategoriesString;
}
if ( in_array( 'numRevisions', $wgCargoPageDataColumns ) ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'revision',
'COUNT(*) as total',
diff --git a/maintenance/setCargoFileData.php b/maintenance/setCargoFileData.php
index 5823923..dba6374 100644
--- a/maintenance/setCargoFileData.php
+++ b/maintenance/setCargoFileData.php
@@ -50,7 +50,7 @@
public function execute() {
global $wgCargoFileDataColumns;
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'cargo_tables', array( 'field_tables', 
'field_helper_tables' ),
array( 'main_table' => '_fileData' ) );
 
diff --git a/maintenance/setCargoPageData.php b/maintenance/setCargoPageData.php
index f7e59da..82150b9 100644
--- a/maintenance/setCargoPageData.php
+++ b/maintenance/setCargoPageData.php
@@ -50,7 +50,7 @@
public function execute() {
global $wgCargoPageDataColumns;
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'cargo_tables', array( 'field_tables', 
'field_helper_tables' ),
array( 'main_table' => '_pageData' ) );
 
diff --git a/specials/CargoDeleteTable.php b/specials/CargoDeleteTable.php
index 22965e3..b1945f9 100644
--- a/specials/CargoDeleteTable.php
+++ b/specials/CargoDeleteTable.php
@@ -65,7 +65,7 @@
}
 
// Make sure that this table exists.
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'cargo_tables', array( 'main_table', 
'field_tables', 'field_helper_tables' ),
array( 'main_table' => $subpage ) );
if ( $res->numRows() == 0 ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2d6444711f1192001a54f8f00d9c0bcf78ea5cb6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cite[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375481 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I3e949fcf15b44ee199830df19f6db039a704b450
---
M includes/Cite.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Cite.php b/includes/Cite.php
index d4e79cb..69a0f99 100644
--- a/includes/Cite.php
+++ b/includes/Cite.php
@@ -1383,7 +1383,7 @@
$key,
self::CACHE_DURATION_ONFETCH,
function ( $oldValue, &$ttl, array &$setOpts ) use ( 
$title ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr 
);
return self::recursiveFetchRefsFromDB( $title, 
$dbr );
},

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3e949fcf15b44ee199830df19f6db039a704b450
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cite
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375472 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I40b5cbda12f3443cb57180ed00929d9a2cb74421
---
M BLUESPICE-RELEASE-NOTES
M includes/Config.class.php
M includes/Core.class.php
M includes/api/BSApiCategoryStore.php
M includes/api/BSApiFileBackendStore.php
M includes/cache/LCStore_BSDB.php
M includes/utility/ArticleHelper.class.php
M includes/utility/CategoryHelper.class.php
M includes/utility/GroupHelper.class.php
M includes/utility/UserHelper.class.php
M maintenance/BSExportUsers.php
M maintenance/BSMassEditBase.php
M maintenance/ConfirmUserEMail.php
M maintenance/ListUserEMails.php
M maintenance/ModifyUserProperties.php
M maintenance/NamespaceRecovery.php
M maintenance/NotifyUserMails.php
17 files changed, 24 insertions(+), 24 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/BLUESPICE-RELEASE-NOTES b/BLUESPICE-RELEASE-NOTES
index bdee977..dfdf07e 100644
--- a/BLUESPICE-RELEASE-NOTES
+++ b/BLUESPICE-RELEASE-NOTES
@@ -425,7 +425,7 @@
 * Compatibility: Removed deprecated editusercssjs right
 * Compatibility: Removed MediaWiki settings
 * Compatibility: Replaced the use of &$this
-* Compatibility: Replaced long deprecated DB_READ constant by DB_SLAVE
+* Compatibility: Replaced long deprecated DB_READ constant by DB_REPLICA
 * Components: Added possibility to add external links in UserSidebar
 * Components: Added BSTemplateHelper
 * Components: BS.store:LocalNamespaces - Fixed 'all' and 'main'
@@ -545,7 +545,7 @@
 * NamespaceManager: Fixed issue with delete options
 * PageAssignments: Added hook listener for user delete and group delete/rename.
 * PageAssignments: Move hooks to correct place in extension.json
-* PageAssignments: Replaced long deprecated DB_READ constant by DB_SLAVE
+* PageAssignments: Replaced long deprecated DB_READ constant by DB_REPLICA
 * PageTemplates: Added API unit test
 * PageTemplates: Refactoring PageTemplates
 * PageTemplates: Removed unneeded apihelp messages
diff --git a/includes/Config.class.php b/includes/Config.class.php
index 0e19893..0b45894 100644
--- a/includes/Config.class.php
+++ b/includes/Config.class.php
@@ -276,7 +276,7 @@
$aRows = $aData;
} else {
wfDebugLog( 'BsMemcached' , __CLASS__.': Fetching 
settings from DB' );
-   $dbr = wfGetDB ( DB_SLAVE );
+   $dbr = wfGetDB ( DB_REPLICA );
# query the settings from bs_settings
$res = $dbr->select ( 'bs_settings', array ( 
$dbr->addIdentifierQuotes('key'), $dbr->addIdentifierQuotes('value') ) );
$aRows = array();
@@ -378,7 +378,7 @@
public static function getUsersForVar( $sKey, $vValue, 
$sSingleValFromMultiple = false, $bSerialized = true ) {
 
global $wgDBtype;
-   $oDb = wfGetDB ( DB_SLAVE );
+   $oDb = wfGetDB ( DB_REPLICA );
$aUsers = array ();
 
if ( $wgDBtype == 'oracle' ) {
diff --git a/includes/Core.class.php b/includes/Core.class.php
index de26310..3775882 100644
--- a/includes/Core.class.php
+++ b/includes/Core.class.php
@@ -234,7 +234,7 @@
}
if ( $options & BsPARAMTYPE::SQL_STRING ) {
if ( is_string( $handover ) ) {
-   $oDb = wfGetDB( DB_SLAVE );
+   $oDb = wfGetDB( DB_REPLICA );
// Use database specific escape methods
$handover = $oDb->strencode( $handover );
 
diff --git a/includes/api/BSApiCategoryStore.php 
b/includes/api/BSApiCategoryStore.php
index c0392ef..6d0d8a8 100644
--- a/includes/api/BSApiCategoryStore.php
+++ b/includes/api/BSApiCategoryStore.php
@@ -32,7 +32,7 @@
$oResult = new stdClass();
 
$aCategories = array();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
// category table also tracks all deleted categories. So we 
need to double
// check with categorylinks and page table. Use case for this 
is a category
// name that had a spelling mistake.
diff --git a/includes/api/BSApiFileBackendStore.php 
b/includes/api/BSApiFileBackendStore.php
index a42035b..0802b65 100644
--- a/includes/api/BSApiFileBackendStore.php
+++ b/includes/api/BSApiFileBackendStore.php
@@ -220,7 +220,7 @@
//Second query: Get all categories of each file page
$aPageIds = array_keys( $aReturn );
if( !empty( $aPageIds ) ) {
-   $oDbr = wfGetDB( DB_SLAVE );
+   $oDbr = wfGetDB( DB_REPLICA );
$oCatRes = $oDbr->select(
   

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375471 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: Id6d3a3ae392801f5d79500547f982f53ba95
---
M ArticleInfo/ArticleInfo.class.php
M Authors/Authors.class.php
M Avatars/maintenance/CreateAvatarHTML.php
M Blog/Blog.class.php
M Checklist/includes/api/BSApiChecklistAvailableOptionsStore.php
M Checklist/includes/api/BSApiChecklistTemplateStore.php
M CountThings/CountThings.class.php
M Dashboards/includes/specials/SpecialAdminDashboard.php
M Dashboards/includes/specials/SpecialUserDashboard.php
M Dashboards/maintenance/clearConfigs.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMainControl.class.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMwArticles.class.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMwLinked.class.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMwRepository.class.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMwSingleFile.class.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMwSpecialLinked.class.php
M ExtendedSearch/includes/ExtendedSearchBase.class.php
M ExtendedSearch/includes/Handler/TagCloudSearchStatsHandler.class.php
M ExtendedSearch/includes/SearchService.class.php
M InterWikiLinks/InterWikiLinks.class.php
M InterWikiLinks/tests/phpunit/BSApiTasksInterWikiLinksManagerTest.php
M PageAccess/PageAccess.class.php
M PageAccess/includes/api/BSApiPageAccessStore.php
M PageAssignments/PageAssignments.class.php
M PageAssignments/includes/BSAssignableBase.php
M PageAssignments/includes/BSAssignableEveryone.php
M PageAssignments/includes/BSAssignableGroup.php
M PageAssignments/includes/BSAssignableUser.php
M PageAssignments/includes/PageAssignmentsUsersAdditionalPermissionsHooks.php
M PageAssignments/includes/PageAssignmentsWikiExplorerHooks.php
M PageAssignments/maintenance/BSPageAssignmentsMigrateRespEditors.php
M PageTemplates/includes/BSPageTemplateList.php
M PageTemplates/includes/api/BSApiPageTemplatesStore.php
M PageTemplates/tests/phpunit/BSApiPageTemplatesTasksTest.php
M PagesVisited/PagesVisited.class.php
M PermissionManager/includes/PermissionTemplates.class.php
M RSSStandards/RSSStandards.class.php
M Readers/Readers.class.php
M Readers/includes/api/BSApiReadersDataStore.php
M Readers/includes/api/BSApiReadersUsersStore.php
M SaferEdit/SaferEdit.class.php
M ShoutBox/ShoutBox.class.php
M ShoutBox/includes/api/BSApiTasksShoutBox.php
M SmartList/SmartList.class.php
M Statistics/includes/FilterCategory.class.php
M Statistics/includes/FilterUsers.class.php
M UniversalExport/includes/specials/SpecialUniversalExport.class.php
M UsageTracker/UsageTracker.class.php
M UsageTracker/src/collectors/Database.php
M UsageTracker/src/collectors/Property.php
M UsageTracker/src/collectors/Tag.php
M UserManager/tests/phpunit/BSApiTasksUserManagerTest.php
M WatchList/WatchList.class.php
M WhoIsOnline/WhoIsOnline.class.php
54 files changed, 78 insertions(+), 78 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/ArticleInfo/ArticleInfo.class.php 
b/ArticleInfo/ArticleInfo.class.php
index e251a64..5f3f671 100644
--- a/ArticleInfo/ArticleInfo.class.php
+++ b/ArticleInfo/ArticleInfo.class.php
@@ -383,7 +383,7 @@
ksort( $aCurrentPagesCategories );
}
 
-   $oDbr = wfGetDB( DB_SLAVE );
+   $oDbr = wfGetDB( DB_REPLICA );
$res = $oDbr->select(
array( 'page_props' ),
array( 'pp_page' ),
diff --git a/Authors/Authors.class.php b/Authors/Authors.class.php
index 80f9e9e..22bc111 100644
--- a/Authors/Authors.class.php
+++ b/Authors/Authors.class.php
@@ -154,7 +154,7 @@
//HINT: Maybe we want to use MW interface 
Article::getContributors() to have better caching
//HINT2: Check if available in MW 1.17+
// SW: There is still no caching in 
WikiPage::getContributors()! 17.07.2014
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
array( 'revision' ), array( 
'rev_user_text', 'MAX(rev_timestamp) AS ts' ), array( 'rev_page' => $iArticleId 
), __METHOD__, array(
'GROUP BY' => 'rev_user_text',
diff --git a/Avatars/maintenance/CreateAvatarHTML.php 
b/Avatars/maintenance/CreateAvatarHTML.php
index 5f379d9..f3cc05f 100644
--- a/Avatars/maintenance/CreateAvatarHTML.php
+++ b/Avatars/maintenance/CreateAvatarHTML.php
@@ -21,7 +21,7 @@
$this->output( "\n" );
 
// We list user by user_id from one of the slave 
database
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 

[MediaWiki-commits] [Gerrit] mediawiki...BibManager[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375469 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: Ibfff4f80a6f5f43501ea507aed2ace162b4b7c85
---
M includes/BibManagerLocalMWDatabaseRepo.php
M maintenance/BibManagerExportRepo.php
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/includes/BibManagerLocalMWDatabaseRepo.php 
b/includes/BibManagerLocalMWDatabaseRepo.php
index 31e5bd3..9a4b08e 100644
--- a/includes/BibManagerLocalMWDatabaseRepo.php
+++ b/includes/BibManagerLocalMWDatabaseRepo.php
@@ -3,7 +3,7 @@
 class BibManagerLocalMWDatabaseRepo extends BibManagerRepository {
 
public function getCitationsLike ( $sCitation ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'bibmanager',
'bm_bibtexCitation',
@@ -33,7 +33,7 @@
 * @return mixed
 */
public function getBibEntries ( $mOptions ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'bibmanager', '*', $mOptions
);
@@ -48,7 +48,7 @@
}
 
public function getBibEntryByCitation ( $sCitation ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->selectRow(
'bibmanager',
'*',
diff --git a/maintenance/BibManagerExportRepo.php 
b/maintenance/BibManagerExportRepo.php
index d431694..6abd7e4 100644
--- a/maintenance/BibManagerExportRepo.php
+++ b/maintenance/BibManagerExportRepo.php
@@ -13,7 +13,7 @@
 
public function execute() {
$sFilename = $this->getOption( 'filename', 'new_export' );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'bibmanager', 'bm_bibtexCitation'
);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibfff4f80a6f5f43501ea507aed2ace162b4b7c85
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BibManager
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...BayesianFilter[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375468 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: Ida04d66c2a0e5147ca656896c86c1ba0930548f3
---
M BayesianFilter.DBHandler.php
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/BayesianFilter.DBHandler.php b/BayesianFilter.DBHandler.php
index d0178d7..7a211d7 100644
--- a/BayesianFilter.DBHandler.php
+++ b/BayesianFilter.DBHandler.php
@@ -30,7 +30,7 @@
public function getFrequency( $words, $chunkSize ) {
$wordsFrequency = $this->itemFrequency( $words );
$words = array_keys( $wordsFrequency );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$wordsFrequency = array();
 
@@ -89,7 +89,7 @@
$wordsFrequency = $this->itemFrequency( $words );
$words = array_keys( $wordsFrequency );
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'word_frequency',
array( 'wf_word', 'wf_spam', 'wf_ham' ),
@@ -137,7 +137,7 @@
 * @return string Revision text
 */
public function getRevertedText( $undidRevision ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->selectRow(
array( 'rev' => 'revision', 'txt' => 'text' ),
array( 'text' => 'old_text' ),
@@ -171,7 +171,7 @@
 */
public function getSpamHamCount() {
$result = array( 'spam' => 0, 'ham' => 0 );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'spam_ham_texts',
array( 'sht_id', 'sht_spam' ),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ida04d66c2a0e5147ca656896c86c1ba0930548f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BayesianFilter
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AzharAuth[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375467 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I5ded1756824519b7ef2174c6633ed24e52658f57
---
M AzharAuth.class.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/AzharAuth.class.php b/AzharAuth.class.php
index 8b45a5c..8717ed8 100644
--- a/AzharAuth.class.php
+++ b/AzharAuth.class.php
@@ -245,7 +245,7 @@
 */
public static function getUserFromProvisioningDocument ( $document ) {
global $wgAzharMatchAccountBy;
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
// Gets user by azhar.remoteUserId property
$row = $dbr->selectRow(
@@ -301,7 +301,7 @@
 * @return User|null The user if found; otherwise, null.
 */
private static function searchUser ( $property, $value ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
'user',
User::selectFields(),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5ded1756824519b7ef2174c6633ed24e52658f57
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AzharAuth
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AutomaticBoardWelcome[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375466 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I8cf363158f6e28112daf28dd12b25def81cd6fd3
---
M AutomaticBoardWelcome.class.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/AutomaticBoardWelcome.class.php b/AutomaticBoardWelcome.class.php
index 9c8a703..374c238 100644
--- a/AutomaticBoardWelcome.class.php
+++ b/AutomaticBoardWelcome.class.php
@@ -46,7 +46,7 @@
}
 
// All good? Alright, let's move on to the actual business!
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
// Get all users who are in the 'sysop' group and aren't 
blocked from
// the database
$res = $dbr->select(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8cf363158f6e28112daf28dd12b25def81cd6fd3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AutomaticBoardWelcome
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AuthorProtect[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375465 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I10358d02bcacf9541537bf4c3700e2d59248efba
---
M AuthorProtect.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/AuthorProtect.php b/AuthorProtect.php
index 9458761..7a66263 100644
--- a/AuthorProtect.php
+++ b/AuthorProtect.php
@@ -225,7 +225,7 @@
}
 
$id = $title->getArticleID();
-   $dbr = wfGetDB( DB_SLAVE ); // grab the slave for reading
+   $dbr = wfGetDB( DB_REPLICA ); // grab the slave for reading
$aid = $dbr->selectField( 'revision', 'rev_user',  array( 
'rev_page' => $id ), __METHOD__ );
return $wgUser->getID() == $aid;
}
@@ -248,7 +248,7 @@
// forked from ProtectionForm::getExpiry and modified to rewrite '' to 
infinity
private static function AuthorProtectExpiry( $value ) {
if ( $value == 'infinite' || $value == 'indefinite' || $value 
== 'infinity' || $value == '' ) {
-   $time = wfGetDB( DB_SLAVE )->getInfinity();
+   $time = wfGetDB( DB_REPLICA )->getInfinity();
} else {
$unix = strtotime( $value );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I10358d02bcacf9541537bf4c3700e2d59248efba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AuthorProtect
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AutoCreateCategoryPages[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375464 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: Ic58d0302fcb09f97c1f9b270bb5a957a1aecc087
---
M AutoCreateCategoryPages.body.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/AutoCreateCategoryPages.body.php b/AutoCreateCategoryPages.body.php
index a2d0e97..4e947a9 100644
--- a/AutoCreateCategoryPages.body.php
+++ b/AutoCreateCategoryPages.body.php
@@ -10,7 +10,7 @@
if ( empty( $page_cats ) ) {
return [];
}
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'page', 'page_title',
array( 'page_namespace' => NS_CATEGORY, 'page_title' => 
$page_cats )
);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic58d0302fcb09f97c1f9b270bb5a957a1aecc087
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AutoCreateCategoryPages
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Comments[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375486 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I6dec35bb6094725118d02112ec66e5a36964a478
---
M includes/Comment.class.php
M includes/CommentFunctions.class.php
M includes/CommentsOfTheDay.class.php
M includes/CommentsPage.class.php
M includes/NumberOfComments.class.php
M includes/api/CommentBlock.api.php
M includes/specials/SpecialCommentIgnoreList.php
7 files changed, 14 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Comments 
refs/changes/86/375486/1

diff --git a/includes/Comment.class.php b/includes/Comment.class.php
index a6490a3..9057024 100644
--- a/includes/Comment.class.php
+++ b/includes/Comment.class.php
@@ -130,7 +130,7 @@
if ( isset( $data['current_vote'] ) ) {
$vote = $data['current_vote'];
} else {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
'Comments_Vote',
array( 'Comment_Vote_Score' ),
@@ -155,7 +155,7 @@
 
public static function newFromID( $id ) {
$context = RequestContext::getMain();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
if ( !is_numeric( $id ) || $id == 0 ) {
return null;
@@ -306,7 +306,7 @@
// Add a log entry.
self::log( 'add', $user, $page->id, $commentId, $text );
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
if (
class_exists( 'UserProfile' ) &&
$dbr->tableExists( 'user_stats' )
@@ -356,7 +356,7 @@
 * @return string
 */
function getScore() {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
'Comments_Vote',
array( 'SUM(Comment_Vote_Score) AS CommentScore' ),
diff --git a/includes/CommentFunctions.class.php 
b/includes/CommentFunctions.class.php
index afaccd0..d576e58 100644
--- a/includes/CommentFunctions.class.php
+++ b/includes/CommentFunctions.class.php
@@ -173,7 +173,7 @@
 */
static function getBlockList( $userId ) {
$blockList = array();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'Comments_block',
'cb_user_name_blocked',
@@ -187,7 +187,7 @@
}
 
static function isUserCommentBlocked( $userId, $userIdBlocked ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$s = $dbr->selectRow(
'Comments_block',
array( 'cb_id' ),
diff --git a/includes/CommentsOfTheDay.class.php 
b/includes/CommentsOfTheDay.class.php
index eeb86b1..bbadef7 100644
--- a/includes/CommentsOfTheDay.class.php
+++ b/includes/CommentsOfTheDay.class.php
@@ -62,7 +62,7 @@
if ( $data ) { // success, got it from memcached!
$comments = $data;
} elseif ( !$data || $skipCache ) { // just query the DB
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
if ( empty( $whereConds ) ) {
$whereConds = array(
diff --git a/includes/CommentsPage.class.php b/includes/CommentsPage.class.php
index 3887cb1..0dfc090 100644
--- a/includes/CommentsPage.class.php
+++ b/includes/CommentsPage.class.php
@@ -98,7 +98,7 @@
 * @return int
 */
function countTotal() {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$count = 0;
$s = $dbr->selectRow(
'Comments',
@@ -119,7 +119,7 @@
 */
function getLatestCommentID() {
$latestCommentID = 0;
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$s = $dbr->selectRow(
'Comments',
array( 'CommentID' ),
@@ -162,7 +162,7 @@
 *  a comment, including score, timestamp 
and more
 */
public function getComments() {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
// Defaults (for non-social wikis)
$tables = array(
diff --git a/includes/NumberOfComments.class.php 
b/includes/NumberOfComments.class.php
index 919c7a1..d48e950 100644

[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375485 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: Ia475468fb2f9ccd94afd90322962458207464ad5
---
M Collection.body.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection 
refs/changes/85/375485/1

diff --git a/Collection.body.php b/Collection.body.php
index 9de5df1..7b4a0d7 100644
--- a/Collection.body.php
+++ b/Collection.body.php
@@ -688,7 +688,7 @@
self::limitExceeded();
return false;
}
-   $db = wfGetDB( DB_SLAVE );
+   $db = wfGetDB( DB_REPLICA );
$tables = [ 'page', 'categorylinks' ];
$fields = [ 'page_namespace', 'page_title' ];
$options = [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia475468fb2f9ccd94afd90322962458207464ad5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Collection
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...ApprovedRevs[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375462 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: Ic3c7b17d1879f350775df8fb64e217d254b3b921
---
M ApprovedRevs_body.php
M maintenance/approveAllPages.php
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/ApprovedRevs_body.php b/ApprovedRevs_body.php
index 9d46c68..5e72d41 100644
--- a/ApprovedRevs_body.php
+++ b/ApprovedRevs_body.php
@@ -29,7 +29,7 @@
return null;
}
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$revID = $dbr->selectField( 'approved_revs', 'rev_id', array( 
'page_id' => $pageID ) );
self::$mApprovedRevIDForPage[$pageID] = $revID;
return $revID;
@@ -128,7 +128,7 @@
// property - for some reason, calling the standard
// getProperty() function doesn't work, so we just do a DB
// query on the page_props table.
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'page_props', 'COUNT(*)',
array(
'pp_page' => $title->getArticleID(),
@@ -187,7 +187,7 @@
// if they created the page.
// We get that information via a SQL
// query - is there an easier way?
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
array( 'r' => 'revision', 'p' 
=> 'page' ),
'r.rev_user_text',
diff --git a/maintenance/approveAllPages.php b/maintenance/approveAllPages.php
index d9e1502..1e1efbc 100644
--- a/maintenance/approveAllPages.php
+++ b/maintenance/approveAllPages.php
@@ -54,7 +54,7 @@
// Don't send out any notifications about people's watch lists.
$wgEnotifWatchlist = false;
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$pages = $dbr->select(
'page',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic3c7b17d1879f350775df8fb64e217d254b3b921
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ApprovedRevs
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ArticleFeedbackv5[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375463 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I292082f393a7681483980c88428f9aea64023076
---
M ArticleFeedbackv5.activity.php
M ArticleFeedbackv5.backend.LBFactory.php
M ArticleFeedbackv5.hooks.php
M ArticleFeedbackv5.model.php
M ArticleFeedbackv5.permissions.php
M ArticleFeedbackv5.utils.php
M api/ApiSetStatusArticleFeedbackv5.php
M data/DataModelBackend.LBFactory.php
M maintenance/legacyToShard.php
M maintenance/loggingUpdate.php
M maintenance/rebuildCheckUser.php
11 files changed, 27 insertions(+), 27 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/ArticleFeedbackv5.activity.php b/ArticleFeedbackv5.activity.php
index 39cc937..a7dbbd8 100644
--- a/ArticleFeedbackv5.activity.php
+++ b/ArticleFeedbackv5.activity.php
@@ -225,7 +225,7 @@
$where['log_namespace'] = NS_SPECIAL;
$where = self::applyContinue( $continue, $where );
 
-   $activity = ArticleFeedbackv5Utils::getDB( DB_SLAVE )->select(
+   $activity = ArticleFeedbackv5Utils::getDB( DB_REPLICA )->select(
array( 'logging' ),
array(
'log_id',
@@ -358,7 +358,7 @@
$where['log_title'] = $title;
$where['log_namespace'] = NS_SPECIAL;
 
-   return (int) ArticleFeedbackv5Utils::getDB( DB_SLAVE 
)->selectField(
+   return (int) ArticleFeedbackv5Utils::getDB( DB_REPLICA 
)->selectField(
'logging',
'COUNT(log_id)',
$where,
@@ -376,7 +376,7 @@
 */
public static function getLastEditorActivity( array $entries ) {
global $wgMemc;
-   $dbr = ArticleFeedbackv5Utils::getDB( DB_SLAVE );
+   $dbr = ArticleFeedbackv5Utils::getDB( DB_REPLICA );
 
$activity = array();
$where = array();
@@ -451,7 +451,7 @@
 * a subquery (the below $ids query), which will then 
be folded into the
 * main query that will get all of those last actions' 
details.
 */
-   $ids = ArticleFeedbackv5Utils::getDB( DB_SLAVE 
)->selectSQLText(
+   $ids = ArticleFeedbackv5Utils::getDB( DB_REPLICA 
)->selectSQLText(
array( 'logging' ),
array( 'last_id' => 'MAX(log_id)' ),
$where,
@@ -459,7 +459,7 @@
$options
);
 
-   $rows = ArticleFeedbackv5Utils::getDB( DB_SLAVE 
)->select(
+   $rows = ArticleFeedbackv5Utils::getDB( DB_REPLICA 
)->select(
array(
'logging',
'ids' => "($ids)" // the subquery that 
will provide the most recent log_id's
@@ -514,7 +514,7 @@
throw new MWException( 'Invalid continue param. You 
should pass the original value returned by the previous query', 'badcontinue' );
}
 
-   $db = ArticleFeedbackv5Utils::getDB( DB_SLAVE );
+   $db = ArticleFeedbackv5Utils::getDB( DB_REPLICA );
$ts = $db->addQuotes( $db->timestamp( $values[0] ) );
$id = intval( $values[1] );
$where[] = '(log_id = ' . $id . ' AND log_timestamp <= ' . $ts 
. ') OR log_timestamp < ' . $ts;
@@ -554,7 +554,7 @@
protected static function buildWhereActions( $permissions = array(), 
$actions = array() ) {
global $wgLogActionsHandlers;
 
-   $dbr = ArticleFeedbackv5Utils::getDB( DB_SLAVE );
+   $dbr = ArticleFeedbackv5Utils::getDB( DB_REPLICA );
 
$where = array();
foreach ( self::$actions as $action => $options ) {
diff --git a/ArticleFeedbackv5.backend.LBFactory.php 
b/ArticleFeedbackv5.backend.LBFactory.php
index 118c716..50b1d45 100644
--- a/ArticleFeedbackv5.backend.LBFactory.php
+++ b/ArticleFeedbackv5.backend.LBFactory.php
@@ -141,7 +141,7 @@
$where['aft_hide'] = 0;
$where['aft_oversight'] = 0;
 
-   return (int) $this->getDB( DB_SLAVE )->selectField(
+   return (int) $this->getDB( DB_REPLICA )->selectField(
$this->table,
array( 'COUNT(*)' ),
$where,
@@ -189,7 +189,7 @@
$options['ORDER BY'] = array( $pager->getIndexField() . " 
$order" );
$options['LIMIT'] = $limit;
 
-   return $this->getDB( DB_SLAVE )->select( $tables, $fields, 
$conds, __METHOD__, $options, 

[MediaWiki-commits] [Gerrit] mediawiki...Annotator[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375460 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: Id29baa051ce6d97d0b9e5e8a44acc01641eb65c2
---
M AnnotationRepository.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/AnnotationRepository.php b/AnnotationRepository.php
index 95117df..64f0809 100644
--- a/AnnotationRepository.php
+++ b/AnnotationRepository.php
@@ -2,7 +2,7 @@
 class AnnotationRepository {
public function get( $annotation_id ) {
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
//select the annotation object from the database
$res = $dbr->select(
array('annotator'),
@@ -28,7 +28,7 @@
 
public function getAllByRevid( $revid ) {
//selects annotations of a particular revision ID
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
array('annotator'),
array(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id29baa051ce6d97d0b9e5e8a44acc01641eb65c2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Annotator
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Mattflaschen 
Gerrit-Reviewer: Rjain 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AJAXPoll[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375459 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I7eeb1910cc98149aaab94f1d9f0a9562d13bf25b
---
M includes/AJAXPoll.class.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/includes/AJAXPoll.class.php b/includes/AJAXPoll.class.php
index 1fd59a9..a3af893 100644
--- a/includes/AJAXPoll.class.php
+++ b/includes/AJAXPoll.class.php
@@ -135,7 +135,7 @@
}
 
private static function buildStats( $id, $userName ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$dbr->begin( __METHOD__ );
 
$res = $dbr->select(
@@ -276,7 +276,7 @@
private static function buildHTML( $id, $userName, $lines = '', 
$extra_from_ajax = '' ) {
global $wgTitle, $wgUser, $wgLang, $wgUseAjax;
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$q = $dbr->select(
'ajaxpoll_info',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7eeb1910cc98149aaab94f1d9f0a9562d13bf25b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AJAXPoll
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AdManager[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375458 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I4d9299551f6f7656df64437389f633b3c2d48ecf
---
M AdManager.class.php
M AdManagerZones.class.php
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/AdManager.class.php b/AdManager.class.php
index b90682e..47b65b4 100644
--- a/AdManager.class.php
+++ b/AdManager.class.php
@@ -347,7 +347,7 @@
 * @return DatabaseBase Read-only db connection
 */
public static function getReadDbConnection() {
-   return wfGetDB( DB_SLAVE );
+   return wfGetDB( DB_REPLICA );
}
 
/**
diff --git a/AdManagerZones.class.php b/AdManagerZones.class.php
index b5d4331..3a90f46 100644
--- a/AdManagerZones.class.php
+++ b/AdManagerZones.class.php
@@ -206,7 +206,7 @@
 * @return DatabaseBase Read-only db connection
 */
public static function getReadDbConnection() {
-   return wfGetDB( DB_SLAVE );
+   return wfGetDB( DB_REPLICA );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4d9299551f6f7656df64437389f633b3c2d48ecf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdManager
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AccountInfo[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375456 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I5b3b3f769d21e196eb09afad7caf140915aaffa2
---
M SpecialAccountInfo.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/SpecialAccountInfo.php b/SpecialAccountInfo.php
index 8e2853f..a75e66d 100644
--- a/SpecialAccountInfo.php
+++ b/SpecialAccountInfo.php
@@ -49,7 +49,7 @@
->parseAsBlock()
);
// Check the table...
-   $rows = wfGetDB( DB_SLAVE )->select(
+   $rows = wfGetDB( DB_REPLICA )->select(
'recentchanges',
'DISTINCT(rc_ip) AS ip',
[ 'rc_user' => $user->getId() ],
@@ -75,7 +75,7 @@
->rawParams( $this->formatTime( $wgCUDMaxAge ) )
->parseAsBlock()
);
-   $rows = wfGetDB( DB_SLAVE )->select(
+   $rows = wfGetDB( DB_REPLICA )->select(
'cu_changes',
[ 'cuc_timestamp', 'cuc_ip', 'cuc_agent', 
'cuc_xff' ],
[ 'cuc_user' => $user->getId() ],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b3b3f769d21e196eb09afad7caf140915aaffa2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AccountInfo
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ActiveAbstract[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375457 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I92fe46b3bc2f45c4c4008597ba8c64f981fae452
---
M AbstractFilter.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/AbstractFilter.php b/AbstractFilter.php
index 3782569..e2403a0 100644
--- a/AbstractFilter.php
+++ b/AbstractFilter.php
@@ -240,7 +240,7 @@
 */
protected function categoryLinks( $rev ) {
$id = $rev->page_id;
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$result = $dbr->select( 'categorylinks',
[ 'cl_to' ],
[ 'cl_from' => $id ],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I92fe46b3bc2f45c4c4008597ba8c64f981fae452
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ActiveAbstract
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CloseWikis[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375484 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I3c0806be5480b10008f139734c10e724ba9c1b9d
---
M CloseWikis.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/CloseWikis.php b/CloseWikis.php
index ed27f52..661a989 100644
--- a/CloseWikis.php
+++ b/CloseWikis.php
@@ -88,7 +88,7 @@
 
static function getSlaveDB() {
global $wgCloseWikisDatabase;
-   return wfGetDB( DB_SLAVE, 'closewikis', $wgCloseWikisDatabase );
+   return wfGetDB( DB_REPLICA, 'closewikis', $wgCloseWikisDatabase 
);
}
 
static function getMasterDB() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c0806be5480b10008f139734c10e724ba9c1b9d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CloseWikis
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...CleanChanges[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375483 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I336ec93093d3f0776569af486b9e08e2718bafba
---
M Filters.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CleanChanges 
refs/changes/83/375483/1

diff --git a/Filters.php b/Filters.php
index 81739ac..ba71aae 100644
--- a/Filters.php
+++ b/Filters.php
@@ -35,7 +35,7 @@
}
}
if ( count( $idfilters ) ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$conds[] = 'rc_user IN (' . $dbr->makeList( $idfilters 
) . ')';
$opts->setValue( 'users', $users );
}
@@ -87,7 +87,7 @@
return;
}
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$conds[] = 'rc_title ' . $dbr->buildLike( $dbr->anyString(), 
$trailer );
$opts->setValue( 'trailer', $trailer );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I336ec93093d3f0776569af486b9e08e2718bafba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CleanChanges
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Consistently use the message when updating count

2017-09-01 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375482 )

Change subject: Consistently use the message when updating count
..

Consistently use the message when updating count

The current initial message in the button label is "Alerts (x)" or
"Notices (x)" but when the badge loaded, we changed that to only show
the rendered number. This is inconsistent; the badge should always
update the label properly, even if it's not visible in most cases.

Bug: T173970
Change-Id: I6a5e13fc36ddb1bf467c712fcf49af3b18e582d0
---
M modules/ext.echo.init.js
M modules/ui/mw.echo.ui.BadgeLinkWidget.js
M modules/ui/mw.echo.ui.NotificationBadgeWidget.js
3 files changed, 16 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/82/375482/1

diff --git a/modules/ext.echo.init.js b/modules/ext.echo.init.js
index b4b82f9..b5e0962 100644
--- a/modules/ext.echo.init.js
+++ b/modules/ext.echo.init.js
@@ -76,7 +76,7 @@
numItems: Number( 
numMessages ),
hasUnseen: 
hasUnseenMessages,
badgeIcon: 'tray',
-   badgeLabel: 
badgeLabelMessages,
+   convertedNumber: 
badgeLabelMessages,
links: links,
href: 
$existingMessageLink.attr( 'href' )
}
@@ -93,7 +93,7 @@
alertModelManager,
{
numItems: Number( numAlerts ),
-   badgeLabel: badgeLabelAlerts,
+   convertedNumber: 
badgeLabelAlerts,
hasUnseen: hasUnseenAlerts,
badgeIcon: 'bell',
links: links,
diff --git a/modules/ui/mw.echo.ui.BadgeLinkWidget.js 
b/modules/ui/mw.echo.ui.BadgeLinkWidget.js
index dc59e09..3b4f812 100644
--- a/modules/ui/mw.echo.ui.BadgeLinkWidget.js
+++ b/modules/ui/mw.echo.ui.BadgeLinkWidget.js
@@ -10,6 +10,7 @@
 * @cfg {string} [type] The notification types this button represents;
 *  'message', 'alert' or 'all'
 * @cfg {string} [href] URL the badge links to
+* @cfg {string} [convertedNumber] A converted version of the initial 
count
 */
mw.echo.ui.BadgeLinkWidget = function MwEchoUiBadgeLinkWidget( config ) 
{
config = config || {};
@@ -28,7 +29,7 @@
 
this.count = 0;
this.type = config.type || 'alert';
-   this.setCount( config.numItems, config.label );
+   this.setCount( config.numItems, config.convertedNumber );
 
if ( config.href !== undefined && OO.ui.isSafeUrl( config.href 
) ) {
this.$element.attr( 'href', config.href );
@@ -47,16 +48,22 @@
 * Set the count labels for this button.
 *
 * @param {number} numItems Number of items
-* @param {string} [label] Label of the button. Defaults to the item 
number.
+* @param {string} [convertedNumber] Label of the button. Defaults to 
the default message
+*  showing the item number.
 */
-   mw.echo.ui.BadgeLinkWidget.prototype.setCount = function ( numItems, 
label ) {
-   label = label || numItems;
+   mw.echo.ui.BadgeLinkWidget.prototype.setCount = function ( numItems, 
convertedNumber ) {
+   convertedNumber = convertedNumber !== undefined ? 
convertedNumber : numItems;
 
this.$element
.toggleClass( 'mw-echo-notifications-badge-all-read', 
!numItems )
-   .toggleClass( 'mw-echo-notifications-badge-long-label', 
label.length > 2 )
+   .toggleClass( 'mw-echo-notifications-badge-long-label', 
convertedNumber.length > 2 )
.attr( 'data-counter-num', numItems )
-   .attr( 'data-counter-text', label );
+   .attr( 'data-counter-text', convertedNumber );
+
+   this.setLabel( mw.msg(
+   'echo-notification-' + ( this.type === 'alert' ? 
'alert' : 'notice' ),
+   convertedNumber
+   ) );
 
if ( this.count !== numItems ) {
this.count = numItems;
diff --git a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js 
b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
index 25170f4..1bf9981 100644
--- 

[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375478 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I0417a049e648acaf9cdec93dc55129f059d71ede
---
M maintenance/populateLocalAndGlobalIds.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/populateLocalAndGlobalIds.php 
b/maintenance/populateLocalAndGlobalIds.php
index 7a014e2..a430d3a 100644
--- a/maintenance/populateLocalAndGlobalIds.php
+++ b/maintenance/populateLocalAndGlobalIds.php
@@ -34,7 +34,7 @@
}
 
$lb = wfGetLB( $wiki );
-   $ldbr = $lb->getConnection( DB_SLAVE, [], $wiki );
+   $ldbr = $lb->getConnection( DB_REPLICA, [], $wiki );
 
$this->output( "Populating fields for wiki $wiki... \n" 
);
do {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0417a049e648acaf9cdec93dc55129f059d71ede
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CategoryTree[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375477 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: Ica4ae7ad70b9b12d5337512fbc05b12abd5dd252
---
M ApiCategoryTree.php
M CategoryTreeFunctions.php
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ApiCategoryTree.php b/ApiCategoryTree.php
index d1243d3..153b4f2 100644
--- a/ApiCategoryTree.php
+++ b/ApiCategoryTree.php
@@ -50,7 +50,7 @@
if ( $condition === 'last-modified' ) {
$params = $this->extractRequestParams();
$title = CategoryTree::makeTitle( $params['category'] );
-   return wfGetDB( DB_SLAVE )->selectField( 'page', 
'page_touched',
+   return wfGetDB( DB_REPLICA )->selectField( 'page', 
'page_touched',
[
'page_namespace' => NS_CATEGORY,
'page_title' => $title->getDBkey(),
diff --git a/CategoryTreeFunctions.php b/CategoryTreeFunctions.php
index 6985b65..1fb3482 100644
--- a/CategoryTreeFunctions.php
+++ b/CategoryTreeFunctions.php
@@ -384,7 +384,7 @@
return '';
}
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$inverse = $this->isInverse();
$mode = $this->getOption( 'mode' );
@@ -478,7 +478,7 @@
function renderParents( $title ) {
global $wgCategoryTreeMaxChildren;
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$res = $dbr->select(
'categorylinks',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ica4ae7ad70b9b12d5337512fbc05b12abd5dd252
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CategoryTree
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AntiSpoof[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375461 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: I8411fa4e1e322a032b0963f0acb3946bab4f493b
---
M SpoofUser.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SpoofUser.php b/SpoofUser.php
index f1e8222..c375658 100644
--- a/SpoofUser.php
+++ b/SpoofUser.php
@@ -180,7 +180,7 @@
 * @return IDatabase
 */
protected function getDBSlave() {
-   return wfGetDB( DB_SLAVE );
+   return wfGetDB( DB_REPLICA );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8411fa4e1e322a032b0963f0acb3946bab4f493b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AntiSpoof
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...BounceHandler[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375473 )

Change subject: DB_SLAVE -> DB_REPLICA
..


DB_SLAVE -> DB_REPLICA

Change-Id: If1457a203547552f60f46e06396f201a221f600c
---
M includes/BounceHandlerActions.php
M includes/ProcessBounceEmails.php
M includes/PruneOldBounceRecords.php
M tests/PruneOldBounceRecordsTest.php
4 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/BounceHandlerActions.php 
b/includes/BounceHandlerActions.php
index 664a019..e4d60ea 100644
--- a/includes/BounceHandlerActions.php
+++ b/includes/BounceHandlerActions.php
@@ -72,7 +72,7 @@
$originalEmail = $failedUser['rawEmail'];
$bounceValidPeriod = time() - 
$this->bounceRecordPeriod; // Unix
 
-   $dbr = ProcessBounceEmails::getBounceRecordDB( 
DB_SLAVE, $this->wikiId );
+   $dbr = ProcessBounceEmails::getBounceRecordDB( 
DB_REPLICA, $this->wikiId );
 
$totalBounces = $dbr->selectRowCount( 'bounce_records',
[ '*' ],
diff --git a/includes/ProcessBounceEmails.php b/includes/ProcessBounceEmails.php
index ce06b55..0e93153 100644
--- a/includes/ProcessBounceEmails.php
+++ b/includes/ProcessBounceEmails.php
@@ -166,7 +166,7 @@
$wikiId = $failedUser['wikiId'];
$rawUserId = $failedUser['rawUserId'];
$lb = wfGetLB( $wikiId );
-   $dbr = $lb->getConnection( DB_SLAVE, [], $wikiId );
+   $dbr = $lb->getConnection( DB_REPLICA, [], $wikiId );
 
$res = $dbr->selectRow(
'user',
@@ -228,7 +228,7 @@
/**
 * Get a lazy connection to the bounce table
 *
-* @param int $index DB_MASTER/DB_SLAVE
+* @param int $index DB_MASTER/DB_REPLICA
 * @param string $wiki The DB that the bounced email was sent from
 * @return IDatabase
 */
diff --git a/includes/PruneOldBounceRecords.php 
b/includes/PruneOldBounceRecords.php
index 5c7d345..63f7f1e 100644
--- a/includes/PruneOldBounceRecords.php
+++ b/includes/PruneOldBounceRecords.php
@@ -54,7 +54,7 @@
private function getOldRecords( $wikiId ) {
$idArray = [];
$maximumRecordAge = time() - $this->bounceRecordMaxAge;
-   $dbr = ProcessBounceEmails::getBounceRecordDB( DB_SLAVE, 
$wikiId );
+   $dbr = ProcessBounceEmails::getBounceRecordDB( DB_REPLICA, 
$wikiId );
$res = $dbr->select(
'bounce_records',
[ 'br_id' ],
diff --git a/tests/PruneOldBounceRecordsTest.php 
b/tests/PruneOldBounceRecordsTest.php
index aa297a7..3b8c18f 100644
--- a/tests/PruneOldBounceRecordsTest.php
+++ b/tests/PruneOldBounceRecordsTest.php
@@ -61,7 +61,7 @@
 
public function testPruneDeleteOldSingleRow() {
$dbw = wfGetDB( DB_MASTER );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
// Delete old rows
$bounceRecordMaxAge = -1; // To get all the bounces in the 
Database
$pruneOldRecordsTester = new PruneOldBounceRecords( 
$bounceRecordMaxAge );
@@ -85,7 +85,7 @@
 
public function testMultipleOldRows() {
$dbw = wfGetDB( DB_MASTER );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$bounceRecordMaxAge = -1; // To get all the bounces in the 
Database
$pruneOldRecordsTester = new PruneOldBounceRecords( 
$bounceRecordMaxAge );
$pruneOldRecordsTester->pruneOldRecords( $this->wikiId ); // 
Delete all rows

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If1457a203547552f60f46e06396f201a221f600c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/BounceHandler
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cite[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375481 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I3e949fcf15b44ee199830df19f6db039a704b450
---
M includes/Cite.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite 
refs/changes/81/375481/1

diff --git a/includes/Cite.php b/includes/Cite.php
index d4e79cb..69a0f99 100644
--- a/includes/Cite.php
+++ b/includes/Cite.php
@@ -1383,7 +1383,7 @@
$key,
self::CACHE_DURATION_ONFETCH,
function ( $oldValue, &$ttl, array &$setOpts ) use ( 
$title ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr 
);
return self::recursiveFetchRefsFromDB( $title, 
$dbr );
},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e949fcf15b44ee199830df19f6db039a704b450
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cite
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...CheckUser[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375480 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I1adc18895d6e6e3ec3937eb7443fa0d8f553802d
---
M CheckUser.hooks.php
M specials/SpecialCheckUser.php
M specials/SpecialCheckUserLog.php
3 files changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser 
refs/changes/80/375480/1

diff --git a/CheckUser.hooks.php b/CheckUser.hooks.php
index 3124b88..f00d161 100644
--- a/CheckUser.hooks.php
+++ b/CheckUser.hooks.php
@@ -163,7 +163,7 @@
// Get agent
$agent = $wgRequest->getHeader( 'User-Agent' );
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$rcRow = [
'cuc_namespace'  => NS_USER,
'cuc_title'  => '',
@@ -457,7 +457,7 @@
 * @return bool
 */
public static function doRetroactiveAutoblock( Block $block, array 
&$blockIds ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$user = User::newFromName( (string)$block->getTarget(), false );
if ( !$user->getId() ) {
diff --git a/specials/SpecialCheckUser.php b/specials/SpecialCheckUser.php
index cfc006d..b8b4c88 100644
--- a/specials/SpecialCheckUser.php
+++ b/specials/SpecialCheckUser.php
@@ -406,7 +406,7 @@
 */
protected function noMatchesMessage( $userName, $checkLast = true ) {
if ( $checkLast ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$user_id = User::idFromName( $userName );
if ( $user_id ) {
$revEdit = $dbr->selectField( 'revision',
@@ -476,7 +476,7 @@
// Record check...
self::addLogEntry( 'userips', 'user', $user, $reason, $user_id 
);
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$time_conds = $this->getTimeConds( $period );
// Ordering by the latest timestamp makes a small filesort on 
the IP list
 
@@ -623,7 +623,7 @@
 */
protected function doIPEditsRequest( $ip, $xfor = false, $reason = '', 
$period = 0 ) {
$out = $this->getOutput();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
// Invalid IPs are passed in as a blank string
$ip_conds = self::getIpConds( $dbr, $ip, $xfor );
@@ -817,7 +817,7 @@
// Record check...
self::addLogEntry( 'useredits', 'user', $user, $reason, 
$user_id );
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$user_cond = "cuc_user = '$user_id'";
$time_conds = $this->getTimeConds( $period );
// Ordered in descent by timestamp. Causes large filesorts if 
there are many edits.
@@ -924,7 +924,7 @@
) {
global $wgMemc;
$out = $this->getOutput();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
// Invalid IPs are passed in as a blank string
$ip_conds = self::getIpConds( $dbr, $ip, $xfor );
@@ -1488,7 +1488,7 @@
 
protected static function userWasBlocked( $name ) {
$userpage = Title::makeTitle( NS_USER, $name );
-   return (bool)wfGetDB( DB_SLAVE )->selectField( 'logging', '1',
+   return (bool)wfGetDB( DB_REPLICA )->selectField( 'logging', '1',
[
'log_type' => [ 'block', 'suppress' ],
'log_action' => 'block',
@@ -1561,7 +1561,7 @@
if ( !$period ) {
return '1 = 1';
}
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$cutoff_unixtime = time() - ( $period * 24 * 3600 );
$cutoff_unixtime = $cutoff_unixtime - ( $cutoff_unixtime % 
86400 );
$cutoff = $dbr->addQuotes( $dbr->timestamp( $cutoff_unixtime ) 
);
diff --git a/specials/SpecialCheckUserLog.php b/specials/SpecialCheckUserLog.php
index 33bb29f..32d096d 100644
--- a/specials/SpecialCheckUserLog.php
+++ b/specials/SpecialCheckUserLog.php
@@ -128,7 +128,7 @@
$conds = null;
 
if ( $start !== false ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
if ( $start === $end ) {
// Single IP address
$conds = [

-- 
To view, visit 

[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375478 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I0417a049e648acaf9cdec93dc55129f059d71ede
---
M maintenance/populateLocalAndGlobalIds.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/maintenance/populateLocalAndGlobalIds.php 
b/maintenance/populateLocalAndGlobalIds.php
index 7a014e2..a430d3a 100644
--- a/maintenance/populateLocalAndGlobalIds.php
+++ b/maintenance/populateLocalAndGlobalIds.php
@@ -34,7 +34,7 @@
}
 
$lb = wfGetLB( $wiki );
-   $ldbr = $lb->getConnection( DB_SLAVE, [], $wiki );
+   $ldbr = $lb->getConnection( DB_REPLICA, [], $wiki );
 
$this->output( "Populating fields for wiki $wiki... \n" 
);
do {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0417a049e648acaf9cdec93dc55129f059d71ede
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...Challenge[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375479 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I242416cecc2161b2d31c15a5a820777defa478b9
---
M includes/Challenge.class.php
M includes/specials/SpecialChallengeStandings.php
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Challenge 
refs/changes/79/375479/1

diff --git a/includes/Challenge.class.php b/includes/Challenge.class.php
index 0452c64..f89a8b8 100644
--- a/includes/Challenge.class.php
+++ b/includes/Challenge.class.php
@@ -260,7 +260,7 @@
$user = User::newFromId( $id );
$username = $user->getName();
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$dbw = wfGetDB( DB_MASTER );
$wins = 0;
$losses = 0;
@@ -377,7 +377,7 @@
 * @return int Challenge count for the given user (ID)
 */
static function getChallengeCount( $userId = 0 ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$challengeCount = 0;
 
$userSQL = array();
diff --git a/includes/specials/SpecialChallengeStandings.php 
b/includes/specials/SpecialChallengeStandings.php
index 25e19ed..fc5d637 100644
--- a/includes/specials/SpecialChallengeStandings.php
+++ b/includes/specials/SpecialChallengeStandings.php
@@ -34,7 +34,7 @@

';
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$sql = "SELECT challenge_record_username, 
challenge_record_user_id, challenge_wins, challenge_losses, challenge_ties, 
(challenge_wins / (challenge_wins + challenge_losses + challenge_ties) ) AS 
winning_percentage FROM {$dbr->tableName( 'challenge_user_record' )} ORDER BY 
(challenge_wins / (challenge_wins + challenge_losses + challenge_ties) ) DESC, 
challenge_wins DESC LIMIT 0,25";
$res = $dbr->query( $sql, __METHOD__ );
$x = 1;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I242416cecc2161b2d31c15a5a820777defa478b9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Challenge
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...CategoryTree[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375477 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: Ica4ae7ad70b9b12d5337512fbc05b12abd5dd252
---
M ApiCategoryTree.php
M CategoryTreeFunctions.php
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CategoryTree 
refs/changes/77/375477/1

diff --git a/ApiCategoryTree.php b/ApiCategoryTree.php
index d1243d3..153b4f2 100644
--- a/ApiCategoryTree.php
+++ b/ApiCategoryTree.php
@@ -50,7 +50,7 @@
if ( $condition === 'last-modified' ) {
$params = $this->extractRequestParams();
$title = CategoryTree::makeTitle( $params['category'] );
-   return wfGetDB( DB_SLAVE )->selectField( 'page', 
'page_touched',
+   return wfGetDB( DB_REPLICA )->selectField( 'page', 
'page_touched',
[
'page_namespace' => NS_CATEGORY,
'page_title' => $title->getDBkey(),
diff --git a/CategoryTreeFunctions.php b/CategoryTreeFunctions.php
index 6985b65..1fb3482 100644
--- a/CategoryTreeFunctions.php
+++ b/CategoryTreeFunctions.php
@@ -384,7 +384,7 @@
return '';
}
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$inverse = $this->isInverse();
$mode = $this->getOption( 'mode' );
@@ -478,7 +478,7 @@
function renderParents( $title ) {
global $wgCategoryTreeMaxChildren;
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$res = $dbr->select(
'categorylinks',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica4ae7ad70b9b12d5337512fbc05b12abd5dd252
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CategoryTree
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375475 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I2d6444711f1192001a54f8f00d9c0bcf78ea5cb6
---
M CargoPageData.php
M maintenance/setCargoFileData.php
M maintenance/setCargoPageData.php
M specials/CargoDeleteTable.php
4 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/75/375475/1

diff --git a/CargoPageData.php b/CargoPageData.php
index 8f5efdd..81256c2 100644
--- a/CargoPageData.php
+++ b/CargoPageData.php
@@ -104,7 +104,7 @@
if ( in_array( 'categories', $wgCargoPageDataColumns ) ) {
$pageCategories = array();
if ( !$setToBlank ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'categorylinks',
'cl_to',
@@ -120,7 +120,7 @@
$pageDataValues['_categories'] = $pageCategoriesString;
}
if ( in_array( 'numRevisions', $wgCargoPageDataColumns ) ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'revision',
'COUNT(*) as total',
diff --git a/maintenance/setCargoFileData.php b/maintenance/setCargoFileData.php
index 5823923..dba6374 100644
--- a/maintenance/setCargoFileData.php
+++ b/maintenance/setCargoFileData.php
@@ -50,7 +50,7 @@
public function execute() {
global $wgCargoFileDataColumns;
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'cargo_tables', array( 'field_tables', 
'field_helper_tables' ),
array( 'main_table' => '_fileData' ) );
 
diff --git a/maintenance/setCargoPageData.php b/maintenance/setCargoPageData.php
index f7e59da..82150b9 100644
--- a/maintenance/setCargoPageData.php
+++ b/maintenance/setCargoPageData.php
@@ -50,7 +50,7 @@
public function execute() {
global $wgCargoPageDataColumns;
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'cargo_tables', array( 'field_tables', 
'field_helper_tables' ),
array( 'main_table' => '_pageData' ) );
 
diff --git a/specials/CargoDeleteTable.php b/specials/CargoDeleteTable.php
index 22965e3..b1945f9 100644
--- a/specials/CargoDeleteTable.php
+++ b/specials/CargoDeleteTable.php
@@ -65,7 +65,7 @@
}
 
// Make sure that this table exists.
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'cargo_tables', array( 'main_table', 
'field_tables', 'field_helper_tables' ),
array( 'main_table' => $subpage ) );
if ( $res->numRows() == 0 ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d6444711f1192001a54f8f00d9c0bcf78ea5cb6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...CategoryTests[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375476 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I1d7139855f39b9f5f844207f6246226fac8217f7
---
M CategoryTests.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CategoryTests 
refs/changes/76/375476/1

diff --git a/CategoryTests.php b/CategoryTests.php
index 225a07f..398b49b 100644
--- a/CategoryTests.php
+++ b/CategoryTests.php
@@ -58,7 +58,7 @@
return $else;
}
$catkey = $cattitle->getDBkey();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
array( 'page', 'categorylinks' ),
'cl_from',
@@ -90,7 +90,7 @@
$page = $title->getDBkey();
$ns = $title->getNamespace();
}
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
array( 'page', 'categorylinks' ),
'cl_from',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d7139855f39b9f5f844207f6246226fac8217f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CategoryTests
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...Buggy[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375474 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I64cda2ece43b1bb2a53fe36e1d62dc7a90f4339d
---
M Buggy.hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Buggy 
refs/changes/74/375474/1

diff --git a/Buggy.hooks.php b/Buggy.hooks.php
index 7df55b8..ddd04f8 100644
--- a/Buggy.hooks.php
+++ b/Buggy.hooks.php
@@ -41,7 +41,7 @@
$_ = $doesNotExist;
break;
case 'sql':
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$dbr->query( 'THIS IS AN 
ERROR', __METHOD__ );
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64cda2ece43b1bb2a53fe36e1d62dc7a90f4339d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Buggy
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...BounceHandler[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375473 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: If1457a203547552f60f46e06396f201a221f600c
---
M includes/BounceHandlerActions.php
M includes/ProcessBounceEmails.php
M includes/PruneOldBounceRecords.php
M tests/PruneOldBounceRecordsTest.php
4 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BounceHandler 
refs/changes/73/375473/1

diff --git a/includes/BounceHandlerActions.php 
b/includes/BounceHandlerActions.php
index 26b8c2b..fdf45a6 100644
--- a/includes/BounceHandlerActions.php
+++ b/includes/BounceHandlerActions.php
@@ -72,7 +72,7 @@
$originalEmail = $failedUser['rawEmail'];
$bounceValidPeriod = time() - 
$this->bounceRecordPeriod; // Unix
 
-   $dbr = ProcessBounceEmails::getBounceRecordDB( 
DB_SLAVE, $this->wikiId );
+   $dbr = ProcessBounceEmails::getBounceRecordDB( 
DB_REPLICA, $this->wikiId );
 
$totalBounces = $dbr->selectRowCount( 'bounce_records',
[ '*' ],
diff --git a/includes/ProcessBounceEmails.php b/includes/ProcessBounceEmails.php
index b9d87b7..2984d70 100644
--- a/includes/ProcessBounceEmails.php
+++ b/includes/ProcessBounceEmails.php
@@ -166,7 +166,7 @@
$wikiId = $failedUser['wikiId'];
$rawUserId = $failedUser['rawUserId'];
$lb = wfGetLB( $wikiId );
-   $dbr = $lb->getConnection( DB_SLAVE, [], $wikiId );
+   $dbr = $lb->getConnection( DB_REPLICA, [], $wikiId );
 
$res = $dbr->selectRow(
'user',
@@ -228,7 +228,7 @@
/**
 * Get a lazy connection to the bounce table
 *
-* @param integer $index DB_MASTER/DB_SLAVE
+* @param integer $index DB_MASTER/DB_REPLICA
 * @param string $wiki The DB that the bounced email was sent from
 * @return IDatabase
 */
diff --git a/includes/PruneOldBounceRecords.php 
b/includes/PruneOldBounceRecords.php
index 3361000..41d6d43 100644
--- a/includes/PruneOldBounceRecords.php
+++ b/includes/PruneOldBounceRecords.php
@@ -54,7 +54,7 @@
private function getOldRecords( $wikiId ) {
$idArray = [];
$maximumRecordAge = time() - $this->bounceRecordMaxAge;
-   $dbr = ProcessBounceEmails::getBounceRecordDB( DB_SLAVE, 
$wikiId );
+   $dbr = ProcessBounceEmails::getBounceRecordDB( DB_REPLICA, 
$wikiId );
$res = $dbr->select(
'bounce_records',
[ 'br_id' ],
diff --git a/tests/PruneOldBounceRecordsTest.php 
b/tests/PruneOldBounceRecordsTest.php
index aa297a7..3b8c18f 100644
--- a/tests/PruneOldBounceRecordsTest.php
+++ b/tests/PruneOldBounceRecordsTest.php
@@ -61,7 +61,7 @@
 
public function testPruneDeleteOldSingleRow() {
$dbw = wfGetDB( DB_MASTER );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
// Delete old rows
$bounceRecordMaxAge = -1; // To get all the bounces in the 
Database
$pruneOldRecordsTester = new PruneOldBounceRecords( 
$bounceRecordMaxAge );
@@ -85,7 +85,7 @@
 
public function testMultipleOldRows() {
$dbw = wfGetDB( DB_MASTER );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$bounceRecordMaxAge = -1; // To get all the bounces in the 
Database
$pruneOldRecordsTester = new PruneOldBounceRecords( 
$bounceRecordMaxAge );
$pruneOldRecordsTester->pruneOldRecords( $this->wikiId ); // 
Delete all rows

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If1457a203547552f60f46e06396f201a221f600c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BounceHandler
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375472 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I40b5cbda12f3443cb57180ed00929d9a2cb74421
---
M BLUESPICE-RELEASE-NOTES
M includes/Config.class.php
M includes/Core.class.php
M includes/api/BSApiCategoryStore.php
M includes/api/BSApiFileBackendStore.php
M includes/cache/LCStore_BSDB.php
M includes/utility/ArticleHelper.class.php
M includes/utility/CategoryHelper.class.php
M includes/utility/GroupHelper.class.php
M includes/utility/UserHelper.class.php
M maintenance/BSExportUsers.php
M maintenance/BSMassEditBase.php
M maintenance/ConfirmUserEMail.php
M maintenance/ListUserEMails.php
M maintenance/ModifyUserProperties.php
M maintenance/NamespaceRecovery.php
M maintenance/NotifyUserMails.php
17 files changed, 24 insertions(+), 24 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/72/375472/1

diff --git a/BLUESPICE-RELEASE-NOTES b/BLUESPICE-RELEASE-NOTES
index bdee977..dfdf07e 100644
--- a/BLUESPICE-RELEASE-NOTES
+++ b/BLUESPICE-RELEASE-NOTES
@@ -425,7 +425,7 @@
 * Compatibility: Removed deprecated editusercssjs right
 * Compatibility: Removed MediaWiki settings
 * Compatibility: Replaced the use of &$this
-* Compatibility: Replaced long deprecated DB_READ constant by DB_SLAVE
+* Compatibility: Replaced long deprecated DB_READ constant by DB_REPLICA
 * Components: Added possibility to add external links in UserSidebar
 * Components: Added BSTemplateHelper
 * Components: BS.store:LocalNamespaces - Fixed 'all' and 'main'
@@ -545,7 +545,7 @@
 * NamespaceManager: Fixed issue with delete options
 * PageAssignments: Added hook listener for user delete and group delete/rename.
 * PageAssignments: Move hooks to correct place in extension.json
-* PageAssignments: Replaced long deprecated DB_READ constant by DB_SLAVE
+* PageAssignments: Replaced long deprecated DB_READ constant by DB_REPLICA
 * PageTemplates: Added API unit test
 * PageTemplates: Refactoring PageTemplates
 * PageTemplates: Removed unneeded apihelp messages
diff --git a/includes/Config.class.php b/includes/Config.class.php
index 0e19893..0b45894 100644
--- a/includes/Config.class.php
+++ b/includes/Config.class.php
@@ -276,7 +276,7 @@
$aRows = $aData;
} else {
wfDebugLog( 'BsMemcached' , __CLASS__.': Fetching 
settings from DB' );
-   $dbr = wfGetDB ( DB_SLAVE );
+   $dbr = wfGetDB ( DB_REPLICA );
# query the settings from bs_settings
$res = $dbr->select ( 'bs_settings', array ( 
$dbr->addIdentifierQuotes('key'), $dbr->addIdentifierQuotes('value') ) );
$aRows = array();
@@ -378,7 +378,7 @@
public static function getUsersForVar( $sKey, $vValue, 
$sSingleValFromMultiple = false, $bSerialized = true ) {
 
global $wgDBtype;
-   $oDb = wfGetDB ( DB_SLAVE );
+   $oDb = wfGetDB ( DB_REPLICA );
$aUsers = array ();
 
if ( $wgDBtype == 'oracle' ) {
diff --git a/includes/Core.class.php b/includes/Core.class.php
index de26310..3775882 100644
--- a/includes/Core.class.php
+++ b/includes/Core.class.php
@@ -234,7 +234,7 @@
}
if ( $options & BsPARAMTYPE::SQL_STRING ) {
if ( is_string( $handover ) ) {
-   $oDb = wfGetDB( DB_SLAVE );
+   $oDb = wfGetDB( DB_REPLICA );
// Use database specific escape methods
$handover = $oDb->strencode( $handover );
 
diff --git a/includes/api/BSApiCategoryStore.php 
b/includes/api/BSApiCategoryStore.php
index c0392ef..6d0d8a8 100644
--- a/includes/api/BSApiCategoryStore.php
+++ b/includes/api/BSApiCategoryStore.php
@@ -32,7 +32,7 @@
$oResult = new stdClass();
 
$aCategories = array();
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
// category table also tracks all deleted categories. So we 
need to double
// check with categorylinks and page table. Use case for this 
is a category
// name that had a spelling mistake.
diff --git a/includes/api/BSApiFileBackendStore.php 
b/includes/api/BSApiFileBackendStore.php
index a42035b..0802b65 100644
--- a/includes/api/BSApiFileBackendStore.php
+++ b/includes/api/BSApiFileBackendStore.php
@@ -220,7 +220,7 @@
//Second query: Get all categories of each file page
$aPageIds = array_keys( $aReturn );
if( !empty( $aPageIds ) ) {
-   $oDbr = wfGetDB( DB_SLAVE );
+   $oDbr = wfGetDB( DB_REPLICA );
$oCatRes = 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375471 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: Id6d3a3ae392801f5d79500547f982f53ba95
---
M ArticleInfo/ArticleInfo.class.php
M Authors/Authors.class.php
M Avatars/maintenance/CreateAvatarHTML.php
M Blog/Blog.class.php
M Checklist/includes/api/BSApiChecklistAvailableOptionsStore.php
M Checklist/includes/api/BSApiChecklistTemplateStore.php
M CountThings/CountThings.class.php
M Dashboards/includes/specials/SpecialAdminDashboard.php
M Dashboards/includes/specials/SpecialUserDashboard.php
M Dashboards/maintenance/clearConfigs.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMainControl.class.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMwArticles.class.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMwLinked.class.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMwRepository.class.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMwSingleFile.class.php
M ExtendedSearch/includes/BuildIndex/BuildIndexMwSpecialLinked.class.php
M ExtendedSearch/includes/ExtendedSearchBase.class.php
M ExtendedSearch/includes/Handler/TagCloudSearchStatsHandler.class.php
M ExtendedSearch/includes/SearchService.class.php
M InterWikiLinks/InterWikiLinks.class.php
M InterWikiLinks/tests/phpunit/BSApiTasksInterWikiLinksManagerTest.php
M PageAccess/PageAccess.class.php
M PageAccess/includes/api/BSApiPageAccessStore.php
M PageAssignments/PageAssignments.class.php
M PageAssignments/includes/BSAssignableBase.php
M PageAssignments/includes/BSAssignableEveryone.php
M PageAssignments/includes/BSAssignableGroup.php
M PageAssignments/includes/BSAssignableUser.php
M PageAssignments/includes/PageAssignmentsUsersAdditionalPermissionsHooks.php
M PageAssignments/includes/PageAssignmentsWikiExplorerHooks.php
M PageAssignments/maintenance/BSPageAssignmentsMigrateRespEditors.php
M PageTemplates/includes/BSPageTemplateList.php
M PageTemplates/includes/api/BSApiPageTemplatesStore.php
M PageTemplates/tests/phpunit/BSApiPageTemplatesTasksTest.php
M PagesVisited/PagesVisited.class.php
M PermissionManager/includes/PermissionTemplates.class.php
M RSSStandards/RSSStandards.class.php
M Readers/Readers.class.php
M Readers/includes/api/BSApiReadersDataStore.php
M Readers/includes/api/BSApiReadersUsersStore.php
M SaferEdit/SaferEdit.class.php
M ShoutBox/ShoutBox.class.php
M ShoutBox/includes/api/BSApiTasksShoutBox.php
M SmartList/SmartList.class.php
M Statistics/includes/FilterCategory.class.php
M Statistics/includes/FilterUsers.class.php
M UniversalExport/includes/specials/SpecialUniversalExport.class.php
M UsageTracker/UsageTracker.class.php
M UsageTracker/src/collectors/Database.php
M UsageTracker/src/collectors/Property.php
M UsageTracker/src/collectors/Tag.php
M UserManager/tests/phpunit/BSApiTasksUserManagerTest.php
M WatchList/WatchList.class.php
M WhoIsOnline/WhoIsOnline.class.php
54 files changed, 78 insertions(+), 78 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/71/375471/1

diff --git a/ArticleInfo/ArticleInfo.class.php 
b/ArticleInfo/ArticleInfo.class.php
index e251a64..5f3f671 100644
--- a/ArticleInfo/ArticleInfo.class.php
+++ b/ArticleInfo/ArticleInfo.class.php
@@ -383,7 +383,7 @@
ksort( $aCurrentPagesCategories );
}
 
-   $oDbr = wfGetDB( DB_SLAVE );
+   $oDbr = wfGetDB( DB_REPLICA );
$res = $oDbr->select(
array( 'page_props' ),
array( 'pp_page' ),
diff --git a/Authors/Authors.class.php b/Authors/Authors.class.php
index 80f9e9e..22bc111 100644
--- a/Authors/Authors.class.php
+++ b/Authors/Authors.class.php
@@ -154,7 +154,7 @@
//HINT: Maybe we want to use MW interface 
Article::getContributors() to have better caching
//HINT2: Check if available in MW 1.17+
// SW: There is still no caching in 
WikiPage::getContributors()! 17.07.2014
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
array( 'revision' ), array( 
'rev_user_text', 'MAX(rev_timestamp) AS ts' ), array( 'rev_page' => $iArticleId 
), __METHOD__, array(
'GROUP BY' => 'rev_user_text',
diff --git a/Avatars/maintenance/CreateAvatarHTML.php 
b/Avatars/maintenance/CreateAvatarHTML.php
index 5f379d9..f3cc05f 100644
--- a/Avatars/maintenance/CreateAvatarHTML.php
+++ b/Avatars/maintenance/CreateAvatarHTML.php
@@ -21,7 +21,7 @@
$this->output( "\n" );
 
// We list user by user_id from one of the slave 
database
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( 

[MediaWiki-commits] [Gerrit] mediawiki...BlogPage[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375470 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: Ic1179e5aee3ad7487bd7a85708877a9a130ea1a9
---
M includes/BlogPage.class.php
M includes/BlogPage.hooks.php
M includes/specials/SpecialArticleLists.php
M includes/specials/SpecialArticlesHome.php
4 files changed, 18 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlogPage 
refs/changes/70/375470/1

diff --git a/includes/BlogPage.class.php b/includes/BlogPage.class.php
index c1cd48d..e0d9c92 100644
--- a/includes/BlogPage.class.php
+++ b/includes/BlogPage.class.php
@@ -202,7 +202,7 @@
 
if ( !$data ) {
wfDebugLog( 'BlogPage', "Loading create_date for page 
{$pageId} from database" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$createDate = $dbr->selectField(
'revision',
'rev_timestamp',// 
'UNIX_TIMESTAMP(rev_timestamp) AS create_date',
@@ -407,7 +407,7 @@
$articles = $data;
} else {
wfDebugLog( 'BlogPage', "Got blog author articles for 
user {$user_name} from DB" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$categoryTitle = Title::newFromText(
 wfMessage( 'blog-by-user-category', $user_name 
)->text()
);
@@ -511,7 +511,7 @@
 
if ( !$data ) {
wfDebugLog( 'BlogPage', "Loading recent editors for 
page {$pageTitleId} from DB" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$where = array(
'rev_page' => $pageTitleId,
@@ -604,7 +604,7 @@
$voters = array();
if ( !$data ) {
wfDebugLog( 'BlogPage', "Loading recent voters for page 
{$pageTitleId} from DB" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$where = array(
'vote_page_id' => $pageTitleId,
@@ -726,7 +726,7 @@
$popularBlogPosts = $data;
} else {
wfDebugLog( 'BlogPage', 'Got popular articles from DB' 
);
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
// Code sporked from Rob Church's NewestPages extension
// @todo FIXME: adding categorylinks table and that one 
where
// clause causes an error about "unknown column 
'page_id' on ON
@@ -817,7 +817,7 @@
// We could do complicated LIKE stuff with the 
categorylinks table,
// but I think we can safely assume that stuff in the 
NS_BLOG NS
// is blog-related :)
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
// Code sporked from Rob Church's NewestPages extension
$res = $dbr->select(
'page',
@@ -960,7 +960,7 @@
$commentCount = $data;
} else {
wfDebugLog( 'BlogPage', "Got comments count for the 
page with ID {$id} from DB" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$commentCount = (int)$dbr->selectField(
'Comments',
'COUNT(*) AS count',
@@ -993,7 +993,7 @@
$voteCount = $data;
} else {
wfDebugLog( 'BlogPage', "Got vote count for the page 
with ID {$id} from DB" );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$voteCount = (int)$dbr->selectField(
'Vote',
'COUNT(*) AS count',
@@ -1109,7 +1109,7 @@
$data = $wgMemc->get( $key );
 
if ( !$data ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$il_to = $dbr->selectField(
'imagelinks',
array( 'il_to' ),
diff --git a/includes/BlogPage.hooks.php b/includes/BlogPage.hooks.php
index 5568fbf..94e9fa4 100644
--- a/includes/BlogPage.hooks.php
+++ b/includes/BlogPage.hooks.php
@@ -88,7 

[MediaWiki-commits] [Gerrit] mediawiki...BibManager[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375469 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: Ibfff4f80a6f5f43501ea507aed2ace162b4b7c85
---
M includes/BibManagerLocalMWDatabaseRepo.php
M maintenance/BibManagerExportRepo.php
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BibManager 
refs/changes/69/375469/1

diff --git a/includes/BibManagerLocalMWDatabaseRepo.php 
b/includes/BibManagerLocalMWDatabaseRepo.php
index 31e5bd3..9a4b08e 100644
--- a/includes/BibManagerLocalMWDatabaseRepo.php
+++ b/includes/BibManagerLocalMWDatabaseRepo.php
@@ -3,7 +3,7 @@
 class BibManagerLocalMWDatabaseRepo extends BibManagerRepository {
 
public function getCitationsLike ( $sCitation ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'bibmanager',
'bm_bibtexCitation',
@@ -33,7 +33,7 @@
 * @return mixed
 */
public function getBibEntries ( $mOptions ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'bibmanager', '*', $mOptions
);
@@ -48,7 +48,7 @@
}
 
public function getBibEntryByCitation ( $sCitation ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->selectRow(
'bibmanager',
'*',
diff --git a/maintenance/BibManagerExportRepo.php 
b/maintenance/BibManagerExportRepo.php
index d431694..6abd7e4 100644
--- a/maintenance/BibManagerExportRepo.php
+++ b/maintenance/BibManagerExportRepo.php
@@ -13,7 +13,7 @@
 
public function execute() {
$sFilename = $this->getOption( 'filename', 'new_export' );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'bibmanager', 'bm_bibtexCitation'
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibfff4f80a6f5f43501ea507aed2ace162b4b7c85
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BibManager
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...BayesianFilter[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375468 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: Ida04d66c2a0e5147ca656896c86c1ba0930548f3
---
M BayesianFilter.DBHandler.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BayesianFilter 
refs/changes/68/375468/1

diff --git a/BayesianFilter.DBHandler.php b/BayesianFilter.DBHandler.php
index d0178d7..7a211d7 100644
--- a/BayesianFilter.DBHandler.php
+++ b/BayesianFilter.DBHandler.php
@@ -30,7 +30,7 @@
public function getFrequency( $words, $chunkSize ) {
$wordsFrequency = $this->itemFrequency( $words );
$words = array_keys( $wordsFrequency );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$wordsFrequency = array();
 
@@ -89,7 +89,7 @@
$wordsFrequency = $this->itemFrequency( $words );
$words = array_keys( $wordsFrequency );
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'word_frequency',
array( 'wf_word', 'wf_spam', 'wf_ham' ),
@@ -137,7 +137,7 @@
 * @return string Revision text
 */
public function getRevertedText( $undidRevision ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->selectRow(
array( 'rev' => 'revision', 'txt' => 'text' ),
array( 'text' => 'old_text' ),
@@ -171,7 +171,7 @@
 */
public function getSpamHamCount() {
$result = array( 'spam' => 0, 'ham' => 0 );
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'spam_ham_texts',
array( 'sht_id', 'sht_spam' ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida04d66c2a0e5147ca656896c86c1ba0930548f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BayesianFilter
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...AzharAuth[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375467 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I5ded1756824519b7ef2174c6633ed24e52658f57
---
M AzharAuth.class.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AzharAuth 
refs/changes/67/375467/1

diff --git a/AzharAuth.class.php b/AzharAuth.class.php
index 8b45a5c..8717ed8 100644
--- a/AzharAuth.class.php
+++ b/AzharAuth.class.php
@@ -245,7 +245,7 @@
 */
public static function getUserFromProvisioningDocument ( $document ) {
global $wgAzharMatchAccountBy;
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
// Gets user by azhar.remoteUserId property
$row = $dbr->selectRow(
@@ -301,7 +301,7 @@
 * @return User|null The user if found; otherwise, null.
 */
private static function searchUser ( $property, $value ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
'user',
User::selectFields(),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5ded1756824519b7ef2174c6633ed24e52658f57
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AzharAuth
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...AutomaticBoardWelcome[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375466 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I8cf363158f6e28112daf28dd12b25def81cd6fd3
---
M AutomaticBoardWelcome.class.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AutomaticBoardWelcome 
refs/changes/66/375466/1

diff --git a/AutomaticBoardWelcome.class.php b/AutomaticBoardWelcome.class.php
index 9c8a703..374c238 100644
--- a/AutomaticBoardWelcome.class.php
+++ b/AutomaticBoardWelcome.class.php
@@ -46,7 +46,7 @@
}
 
// All good? Alright, let's move on to the actual business!
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
// Get all users who are in the 'sysop' group and aren't 
blocked from
// the database
$res = $dbr->select(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8cf363158f6e28112daf28dd12b25def81cd6fd3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AutomaticBoardWelcome
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...AuthorProtect[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375465 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I10358d02bcacf9541537bf4c3700e2d59248efba
---
M AuthorProtect.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AuthorProtect 
refs/changes/65/375465/1

diff --git a/AuthorProtect.php b/AuthorProtect.php
index 9458761..7a66263 100644
--- a/AuthorProtect.php
+++ b/AuthorProtect.php
@@ -225,7 +225,7 @@
}
 
$id = $title->getArticleID();
-   $dbr = wfGetDB( DB_SLAVE ); // grab the slave for reading
+   $dbr = wfGetDB( DB_REPLICA ); // grab the slave for reading
$aid = $dbr->selectField( 'revision', 'rev_user',  array( 
'rev_page' => $id ), __METHOD__ );
return $wgUser->getID() == $aid;
}
@@ -248,7 +248,7 @@
// forked from ProtectionForm::getExpiry and modified to rewrite '' to 
infinity
private static function AuthorProtectExpiry( $value ) {
if ( $value == 'infinite' || $value == 'indefinite' || $value 
== 'infinity' || $value == '' ) {
-   $time = wfGetDB( DB_SLAVE )->getInfinity();
+   $time = wfGetDB( DB_REPLICA )->getInfinity();
} else {
$unix = strtotime( $value );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I10358d02bcacf9541537bf4c3700e2d59248efba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AuthorProtect
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...AutoCreateCategoryPages[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375464 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: Ic58d0302fcb09f97c1f9b270bb5a957a1aecc087
---
M AutoCreateCategoryPages.body.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AutoCreateCategoryPages 
refs/changes/64/375464/1

diff --git a/AutoCreateCategoryPages.body.php b/AutoCreateCategoryPages.body.php
index a2d0e97..4e947a9 100644
--- a/AutoCreateCategoryPages.body.php
+++ b/AutoCreateCategoryPages.body.php
@@ -10,7 +10,7 @@
if ( empty( $page_cats ) ) {
return [];
}
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'page', 'page_title',
array( 'page_namespace' => NS_CATEGORY, 'page_title' => 
$page_cats )
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic58d0302fcb09f97c1f9b270bb5a957a1aecc087
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AutoCreateCategoryPages
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...ArticleFeedbackv5[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375463 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I292082f393a7681483980c88428f9aea64023076
---
M ArticleFeedbackv5.activity.php
M ArticleFeedbackv5.backend.LBFactory.php
M ArticleFeedbackv5.hooks.php
M ArticleFeedbackv5.model.php
M ArticleFeedbackv5.permissions.php
M ArticleFeedbackv5.utils.php
M api/ApiSetStatusArticleFeedbackv5.php
M data/DataModelBackend.LBFactory.php
M maintenance/legacyToShard.php
M maintenance/loggingUpdate.php
M maintenance/rebuildCheckUser.php
11 files changed, 27 insertions(+), 27 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticleFeedbackv5 
refs/changes/63/375463/1

diff --git a/ArticleFeedbackv5.activity.php b/ArticleFeedbackv5.activity.php
index 39cc937..a7dbbd8 100644
--- a/ArticleFeedbackv5.activity.php
+++ b/ArticleFeedbackv5.activity.php
@@ -225,7 +225,7 @@
$where['log_namespace'] = NS_SPECIAL;
$where = self::applyContinue( $continue, $where );
 
-   $activity = ArticleFeedbackv5Utils::getDB( DB_SLAVE )->select(
+   $activity = ArticleFeedbackv5Utils::getDB( DB_REPLICA )->select(
array( 'logging' ),
array(
'log_id',
@@ -358,7 +358,7 @@
$where['log_title'] = $title;
$where['log_namespace'] = NS_SPECIAL;
 
-   return (int) ArticleFeedbackv5Utils::getDB( DB_SLAVE 
)->selectField(
+   return (int) ArticleFeedbackv5Utils::getDB( DB_REPLICA 
)->selectField(
'logging',
'COUNT(log_id)',
$where,
@@ -376,7 +376,7 @@
 */
public static function getLastEditorActivity( array $entries ) {
global $wgMemc;
-   $dbr = ArticleFeedbackv5Utils::getDB( DB_SLAVE );
+   $dbr = ArticleFeedbackv5Utils::getDB( DB_REPLICA );
 
$activity = array();
$where = array();
@@ -451,7 +451,7 @@
 * a subquery (the below $ids query), which will then 
be folded into the
 * main query that will get all of those last actions' 
details.
 */
-   $ids = ArticleFeedbackv5Utils::getDB( DB_SLAVE 
)->selectSQLText(
+   $ids = ArticleFeedbackv5Utils::getDB( DB_REPLICA 
)->selectSQLText(
array( 'logging' ),
array( 'last_id' => 'MAX(log_id)' ),
$where,
@@ -459,7 +459,7 @@
$options
);
 
-   $rows = ArticleFeedbackv5Utils::getDB( DB_SLAVE 
)->select(
+   $rows = ArticleFeedbackv5Utils::getDB( DB_REPLICA 
)->select(
array(
'logging',
'ids' => "($ids)" // the subquery that 
will provide the most recent log_id's
@@ -514,7 +514,7 @@
throw new MWException( 'Invalid continue param. You 
should pass the original value returned by the previous query', 'badcontinue' );
}
 
-   $db = ArticleFeedbackv5Utils::getDB( DB_SLAVE );
+   $db = ArticleFeedbackv5Utils::getDB( DB_REPLICA );
$ts = $db->addQuotes( $db->timestamp( $values[0] ) );
$id = intval( $values[1] );
$where[] = '(log_id = ' . $id . ' AND log_timestamp <= ' . $ts 
. ') OR log_timestamp < ' . $ts;
@@ -554,7 +554,7 @@
protected static function buildWhereActions( $permissions = array(), 
$actions = array() ) {
global $wgLogActionsHandlers;
 
-   $dbr = ArticleFeedbackv5Utils::getDB( DB_SLAVE );
+   $dbr = ArticleFeedbackv5Utils::getDB( DB_REPLICA );
 
$where = array();
foreach ( self::$actions as $action => $options ) {
diff --git a/ArticleFeedbackv5.backend.LBFactory.php 
b/ArticleFeedbackv5.backend.LBFactory.php
index 118c716..50b1d45 100644
--- a/ArticleFeedbackv5.backend.LBFactory.php
+++ b/ArticleFeedbackv5.backend.LBFactory.php
@@ -141,7 +141,7 @@
$where['aft_hide'] = 0;
$where['aft_oversight'] = 0;
 
-   return (int) $this->getDB( DB_SLAVE )->selectField(
+   return (int) $this->getDB( DB_REPLICA )->selectField(
$this->table,
array( 'COUNT(*)' ),
$where,
@@ -189,7 +189,7 @@
$options['ORDER BY'] = array( $pager->getIndexField() . " 
$order" );
$options['LIMIT'] = $limit;
 
-   return $this->getDB( DB_SLAVE )->select( $tables, $fields, 
$conds, 

[MediaWiki-commits] [Gerrit] mediawiki...ApprovedRevs[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375462 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: Ic3c7b17d1879f350775df8fb64e217d254b3b921
---
M ApprovedRevs_body.php
M maintenance/approveAllPages.php
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ApprovedRevs 
refs/changes/62/375462/1

diff --git a/ApprovedRevs_body.php b/ApprovedRevs_body.php
index 9d46c68..5e72d41 100644
--- a/ApprovedRevs_body.php
+++ b/ApprovedRevs_body.php
@@ -29,7 +29,7 @@
return null;
}
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$revID = $dbr->selectField( 'approved_revs', 'rev_id', array( 
'page_id' => $pageID ) );
self::$mApprovedRevIDForPage[$pageID] = $revID;
return $revID;
@@ -128,7 +128,7 @@
// property - for some reason, calling the standard
// getProperty() function doesn't work, so we just do a DB
// query on the page_props table.
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'page_props', 'COUNT(*)',
array(
'pp_page' => $title->getArticleID(),
@@ -187,7 +187,7 @@
// if they created the page.
// We get that information via a SQL
// query - is there an easier way?
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
array( 'r' => 'revision', 'p' 
=> 'page' ),
'r.rev_user_text',
diff --git a/maintenance/approveAllPages.php b/maintenance/approveAllPages.php
index d9e1502..1e1efbc 100644
--- a/maintenance/approveAllPages.php
+++ b/maintenance/approveAllPages.php
@@ -54,7 +54,7 @@
// Don't send out any notifications about people's watch lists.
$wgEnotifWatchlist = false;
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$pages = $dbr->select(
'page',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3c7b17d1879f350775df8fb64e217d254b3b921
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ApprovedRevs
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...AntiSpoof[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375461 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I8411fa4e1e322a032b0963f0acb3946bab4f493b
---
M SpoofUser.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AntiSpoof 
refs/changes/61/375461/1

diff --git a/SpoofUser.php b/SpoofUser.php
index f1e8222..c375658 100644
--- a/SpoofUser.php
+++ b/SpoofUser.php
@@ -180,7 +180,7 @@
 * @return IDatabase
 */
protected function getDBSlave() {
-   return wfGetDB( DB_SLAVE );
+   return wfGetDB( DB_REPLICA );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8411fa4e1e322a032b0963f0acb3946bab4f493b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AntiSpoof
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...Annotator[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375460 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: Id29baa051ce6d97d0b9e5e8a44acc01641eb65c2
---
M AnnotationRepository.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Annotator 
refs/changes/60/375460/1

diff --git a/AnnotationRepository.php b/AnnotationRepository.php
index 95117df..64f0809 100644
--- a/AnnotationRepository.php
+++ b/AnnotationRepository.php
@@ -2,7 +2,7 @@
 class AnnotationRepository {
public function get( $annotation_id ) {
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
//select the annotation object from the database
$res = $dbr->select(
array('annotator'),
@@ -28,7 +28,7 @@
 
public function getAllByRevid( $revid ) {
//selects annotations of a particular revision ID
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
array('annotator'),
array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id29baa051ce6d97d0b9e5e8a44acc01641eb65c2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Annotator
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...AJAXPoll[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375459 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I7eeb1910cc98149aaab94f1d9f0a9562d13bf25b
---
M includes/AJAXPoll.class.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AJAXPoll 
refs/changes/59/375459/1

diff --git a/includes/AJAXPoll.class.php b/includes/AJAXPoll.class.php
index 1fd59a9..a3af893 100644
--- a/includes/AJAXPoll.class.php
+++ b/includes/AJAXPoll.class.php
@@ -135,7 +135,7 @@
}
 
private static function buildStats( $id, $userName ) {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$dbr->begin( __METHOD__ );
 
$res = $dbr->select(
@@ -276,7 +276,7 @@
private static function buildHTML( $id, $userName, $lines = '', 
$extra_from_ajax = '' ) {
global $wgTitle, $wgUser, $wgLang, $wgUseAjax;
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
 
$q = $dbr->select(
'ajaxpoll_info',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7eeb1910cc98149aaab94f1d9f0a9562d13bf25b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AJAXPoll
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdManager[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375458 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I4d9299551f6f7656df64437389f633b3c2d48ecf
---
M AdManager.class.php
M AdManagerZones.class.php
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AdManager 
refs/changes/58/375458/1

diff --git a/AdManager.class.php b/AdManager.class.php
index b90682e..47b65b4 100644
--- a/AdManager.class.php
+++ b/AdManager.class.php
@@ -347,7 +347,7 @@
 * @return DatabaseBase Read-only db connection
 */
public static function getReadDbConnection() {
-   return wfGetDB( DB_SLAVE );
+   return wfGetDB( DB_REPLICA );
}
 
/**
diff --git a/AdManagerZones.class.php b/AdManagerZones.class.php
index b5d4331..3a90f46 100644
--- a/AdManagerZones.class.php
+++ b/AdManagerZones.class.php
@@ -206,7 +206,7 @@
 * @return DatabaseBase Read-only db connection
 */
public static function getReadDbConnection() {
-   return wfGetDB( DB_SLAVE );
+   return wfGetDB( DB_REPLICA );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d9299551f6f7656df64437389f633b3c2d48ecf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdManager
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...ActiveAbstract[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375457 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I92fe46b3bc2f45c4c4008597ba8c64f981fae452
---
M AbstractFilter.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/AbstractFilter.php b/AbstractFilter.php
index 3782569..e2403a0 100644
--- a/AbstractFilter.php
+++ b/AbstractFilter.php
@@ -240,7 +240,7 @@
 */
protected function categoryLinks( $rev ) {
$id = $rev->page_id;
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$result = $dbr->select( 'categorylinks',
[ 'cl_to' ],
[ 'cl_from' => $id ],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92fe46b3bc2f45c4c4008597ba8c64f981fae452
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ActiveAbstract
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...AccountInfo[master]: DB_SLAVE -> DB_REPLICA

2017-09-01 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375456 )

Change subject: DB_SLAVE -> DB_REPLICA
..

DB_SLAVE -> DB_REPLICA

Change-Id: I5b3b3f769d21e196eb09afad7caf140915aaffa2
---
M SpecialAccountInfo.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AccountInfo 
refs/changes/56/375456/1

diff --git a/SpecialAccountInfo.php b/SpecialAccountInfo.php
index 8e2853f..a75e66d 100644
--- a/SpecialAccountInfo.php
+++ b/SpecialAccountInfo.php
@@ -49,7 +49,7 @@
->parseAsBlock()
);
// Check the table...
-   $rows = wfGetDB( DB_SLAVE )->select(
+   $rows = wfGetDB( DB_REPLICA )->select(
'recentchanges',
'DISTINCT(rc_ip) AS ip',
[ 'rc_user' => $user->getId() ],
@@ -75,7 +75,7 @@
->rawParams( $this->formatTime( $wgCUDMaxAge ) )
->parseAsBlock()
);
-   $rows = wfGetDB( DB_SLAVE )->select(
+   $rows = wfGetDB( DB_REPLICA )->select(
'cu_changes',
[ 'cuc_timestamp', 'cuc_ip', 'cuc_agent', 
'cuc_xff' ],
[ 'cuc_user' => $user->getId() ],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b3b3f769d21e196eb09afad7caf140915aaffa2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AccountInfo
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: PayPal audit: check for existing recurring donations

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370520 )

Change subject: PayPal audit: check for existing recurring donations
..


PayPal audit: check for existing recurring donations

Also tell tox to pass through the thing we're using to detect that
we're running under Jenkins. New tox version on CI doesn't pass it
all through by default.

Bug: T172723
Change-Id: I1009e554581a972251675701a3896d256f6d33f3
---
M audit/paypal/TrrFile.py
M audit/paypal/tests/test_trr_file.py
M tox.ini
3 files changed, 24 insertions(+), 3 deletions(-)

Approvals:
  XenoRyet: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/audit/paypal/TrrFile.py b/audit/paypal/TrrFile.py
index 2b1e851..54b64e9 100644
--- a/audit/paypal/TrrFile.py
+++ b/audit/paypal/TrrFile.py
@@ -187,9 +187,10 @@
 log.info("-Unknown\t{id}\t{date}\t(Type 
{type})".format(id=out['gateway_txn_id'], date=out['date'], type=event_type))
 return
 
-if queue == 'donations' and 
self.crm.transaction_exists(gateway_txn_id=out['gateway_txn_id'], 
gateway=out['gateway']):
-
log.info("-Duplicate\t{id}\t{date}\t{type}".format(id=out['gateway_txn_id'], 
date=row['Transaction Initiation Date'], type=queue))
-return
+if queue == 'donations' or queue == 'recurring':
+if 
self.crm.transaction_exists(gateway_txn_id=out['gateway_txn_id'], 
gateway=out['gateway']):
+
log.info("-Duplicate\t{id}\t{date}\t{type}".format(id=out['gateway_txn_id'], 
date=row['Transaction Initiation Date'], type=queue))
+return
 
 if queue == 'refund' and 
self.crm.transaction_refunded(gateway_txn_id=out['gateway_parent_id'], 
gateway=out['gateway']):
 
log.info("-Duplicate\t{id}\t{date}\t{type}".format(id=out['gateway_txn_id'], 
date=row['Transaction Initiation Date'], type=queue))
diff --git a/audit/paypal/tests/test_trr_file.py 
b/audit/paypal/tests/test_trr_file.py
index 9b15ca8..d11aa2c 100644
--- a/audit/paypal/tests/test_trr_file.py
+++ b/audit/paypal/tests/test_trr_file.py
@@ -281,3 +281,22 @@
 expected = {'last_name': 'Man', 'txn_type': 'subscr_payment', 
'thankyou_date': 0, 'city': '', 'payment_method': '', 'gateway_status': 'S', 
'currency': 'USD', 'postal_code': '', 'date': 1474743301, 'subscr_id': 
'3GJH3GJ3334214812', 'gateway': 'paypal', 'state_province': '', 'gross': 0.1, 
'first_name': 'Banana', 'fee': 0.55, 'gateway_txn_id': 'AS7D98AS7D9A8S7D9AS', 
'country': '', 'payment_submethod': '', 'note': '', 'supplemental_address_1': 
'', 'settled_date': 1474743301, 'email': 'pranks...@anonymous.net', 
'street_address': '', 'contribution_tracking_id': '1234567', 'order_id': 
'1234567'}
 actual = args[0][1]
 nose.tools.assert_equals(expected, actual)
+
+
+@patch("queue.redis_wrap.Redis")
+@patch("civicrm.civicrm.Civicrm")
+@patch("process.globals")
+def test_duplicate_recurring(MockGlobals, MockCivicrm, MockRedis):
+'''
+Test that we don't send duplicate recurring messages
+'''
+MockCivicrm().transaction_exists.return_value = True
+
+row = get_recurring_row()
+parser = audit.paypal.TrrFile.TrrFile("dummy_path")
+
+parser.parse_line(row)
+
+# Did we send it?
+args = MockRedis().send.call_args
+nose.tools.assert_equals(None, args)
diff --git a/tox.ini b/tox.ini
index ee62387..87333b8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,6 +3,7 @@
 envlist = discover,flake8
 
 [testenv:discover]
+passenv = EXECUTOR_NUMBER
 commands = nosetests {posargs} {toxinidir}
 deps =
-rrequirements.txt

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1009e554581a972251675701a3896d256f6d33f3
Gerrit-PatchSet: 4
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Katie Horn 
Gerrit-Reviewer: Mepps 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Thank you mailer: use process elapsed time to limit

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375032 )

Change subject: Thank you mailer: use process elapsed time to limit
..


Thank you mailer: use process elapsed time to limit

If the process start time is available, use that instead of the
time we get into the batch_process function to determine when to
stop.

Bug: T174690
Change-Id: Ib56b9e6e9cf5a1633d44bf744623b4faa532d292
---
M sites/all/modules/thank_you/thank_you.module
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  XenoRyet: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/thank_you/thank_you.module 
b/sites/all/modules/thank_you/thank_you.module
index 796cea9..3f5d2a7 100644
--- a/sites/all/modules/thank_you/thank_you.module
+++ b/sites/all/modules/thank_you/thank_you.module
@@ -698,8 +698,14 @@
 
 function thank_you_batch_process(){
civicrm_initialize();
+   // If available, use the time the drush script started as the start time
+   // This way we're less likely to run past the start of the next run.
+   if ( isset( $_SERVER['REQUEST_TIME'] ) ) {
+   $startTime = $_SERVER['REQUEST_TIME'];
+   } else {
+   $startTime = time();
+   }
// the following variables should be set in the module settings, not 
here
-   $startTime = time();
$timeLimit = variable_get('thank_you_batch_time', 90); 
$days = variable_get( 'thank_you_days', false );
$batch = variable_get( 'thank_you_batch', false );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib56b9e6e9cf5a1633d44bf744623b4faa532d292
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: Katie Horn 
Gerrit-Reviewer: Mepps 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Donation consumer: account for drush startup time

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375030 )

Change subject: Donation consumer: account for drush startup time
..


Donation consumer: account for drush startup time

If a detectable amount of time has elapsed between launching drush
and starting the queue consumer, deduct that from the dequeue loop
time limit.

Bug: T174690
Change-Id: Ie1c89c59dd3c61bdead09dc26f6907ccba29c49a
---
M sites/all/modules/queue2civicrm/queue2civicrm.module
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  XenoRyet: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/queue2civicrm/queue2civicrm.module 
b/sites/all/modules/queue2civicrm/queue2civicrm.module
index f7467bf..f0da868 100644
--- a/sites/all/modules/queue2civicrm/queue2civicrm.module
+++ b/sites/all/modules/queue2civicrm/queue2civicrm.module
@@ -134,9 +134,19 @@
 return;
   }
 
+  $batch_time = variable_get( 'queue2civicrm_batch_time', 0 );
+
+  // If we're running on a time limit, try to account for drush's startup time.
+  if ( $batch_time > 0 && isset( $_SERVER['REQUEST_TIME'] ) ) {
+$already_elapsed = time() - $_SERVER['REQUEST_TIME'];
+if ( $already_elapsed < $batch_time ) {
+  $batch_time = $batch_time - $already_elapsed;
+}
+  }
+
   $consumer = new DonationQueueConsumer(
 'donations',
-variable_get( 'queue2civicrm_batch_time', 0 ),
+$batch_time,
 variable_get( 'queue2civicrm_batch', 0 )
   );
   $processed = $consumer->dequeueMessages();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie1c89c59dd3c61bdead09dc26f6907ccba29c49a
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: Katie Horn 
Gerrit-Reviewer: Mepps 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move OrderedStreamingForkController class from CirrusSearch ...

2017-09-01 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375455 )

Change subject: Move OrderedStreamingForkController class from CirrusSearch to 
core.
..

Move OrderedStreamingForkController class from CirrusSearch to core.

This class may be useful for scripts outside CirrusSearch.

Change-Id: I1ed993a3b0b64d828ae5caba6c4b540b77b2f6f5
---
A includes/OrderedStreamingForkController.php
1 file changed, 211 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/375455/1

diff --git a/includes/OrderedStreamingForkController.php 
b/includes/OrderedStreamingForkController.php
new file mode 100644
index 000..ab10374
--- /dev/null
+++ b/includes/OrderedStreamingForkController.php
@@ -0,0 +1,211 @@
+http://www.gnu.org/copyleft/gpl.html
+ */
+class OrderedStreamingForkController extends ForkController {
+   /** @var callable */
+   protected $workCallback;
+   /** @var resource */
+   protected $input;
+   /** @var resource */
+   protected $output;
+   /** @var int */
+   protected $nextOutputId;
+   /** @var string[] Int key indicates order, value is data */
+   protected $delayedOutputData = [];
+
+   /**
+* @param int $numProcs The number of worker processes to fork
+* @param callable $workCallback A callback to call in the child process
+*  once for each line of work to process.
+* @param resource $input A socket to read work lines from
+* @param resource $output A socket to write the result of work to.
+*/
+   public function __construct( $numProcs, $workCallback, $input, $output 
) {
+   parent::__construct( $numProcs );
+   $this->workCallback = $workCallback;
+   $this->input = $input;
+   $this->output = $output;
+   }
+
+   /**
+* {@inheritDoc}
+*/
+   public function start() {
+   if ( $this->procsToStart > 0 ) {
+   $status = parent::start();
+   if ( $status === 'child' ) {
+   $this->consume();
+   }
+   } else {
+   $status = 'parent';
+   $this->consumeNoFork();
+   }
+   return $status;
+   }
+
+   /**
+* @param int $numProcs
+* @return string
+*/
+   protected function forkWorkers( $numProcs ) {
+   $this->prepareEnvironment();
+
+   $childSockets = [];
+   // Create the child processes
+   for ( $i = 0; $i < $numProcs; $i++ ) {
+   $sockets = stream_socket_pair( STREAM_PF_UNIX, 
STREAM_SOCK_STREAM, STREAM_IPPROTO_IP );
+   // Do the fork
+   $pid = pcntl_fork();
+   if ( $pid === -1 || $pid === false ) {
+   echo "Error creating child processes\n";
+   exit( 1 );
+   }
+
+   if ( !$pid ) {
+   $this->initChild();
+   $this->childNumber = $i;
+   $this->input = $sockets[0];
+   $this->output = $sockets[0];
+   fclose( $sockets[1] );
+   return 'child';
+   } else {
+   // This is the parent process
+   $this->children[$pid] = true;
+   fclose( $sockets[0] );
+   $childSockets[] = $sockets[1];
+   }
+   }
+   $this->feedChildren( $childSockets );
+   foreach ( $childSockets as $socket ) {
+   // if a child has already shutdown the sockets will be 
closed,
+   // closing a second time would raise a warning.
+   if ( is_resource( $socket ) ) {
+   fclose( $socket );
+   }
+   }
+   return 'parent';
+   }
+
+   /**
+* Child worker process. Reads work from $this->input and writes the
+* result of that work to $this->output when completed.
+*/
+   protected function consume() {
+   while ( !feof( $this->input ) ) {
+   $line = trim( fgets( $this->input ) );
+   if ( $line ) {
+   list( $id, $data ) = json_decode( $line );
+   $result = call_user_func( $this->workCallback, 
$data );
+   fwrite( $this->output, json_encode( [ $id, 
$result ] ) . "\n" );
+   }
+   }
+   }
+
+

[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: WIP upgrade to new Minfraud Composer package

2017-09-01 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375454 )

Change subject: WIP upgrade to new Minfraud Composer package
..

WIP upgrade to new Minfraud Composer package

Necessary to use new email field, but will require a bit of a rewrite.

Bug: T128902
Change-Id: Idb81e9ae1e7057cf2b8ba44178036bf76fe41301
---
M composer.json
M composer.lock
2 files changed, 346 insertions(+), 17 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/54/375454/1

diff --git a/composer.json b/composer.json
index a1b664a..6928316 100644
--- a/composer.json
+++ b/composer.json
@@ -23,7 +23,7 @@
},
"require": {
"coderkungfu/php-queue": "dev-master",
-   "minfraud/http": "^1.70",
+   "maxmind/minfraud": "^1.4",
"monolog/monolog": "~1.18.2",
"neitanod/forceutf8": "^2.0",
"php": ">=5.4",
diff --git a/composer.lock b/composer.lock
index f4230a3..80ba140 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file;,
 "This file is @generated automatically"
 ],
-"content-hash": "05fcadc833e6b0e4c9da1a7fc7aba690",
+"content-hash": "93e0d4957065a0cd32287a3c484288ec",
 "packages": [
 {
 "name": "addshore/psr-6-mediawiki-bagostuff-adapter",
@@ -201,6 +201,65 @@
 "time": "2017-04-17T14:11:55+00:00"
 },
 {
+"name": "composer/ca-bundle",
+"version": "1.0.7",
+"source": {
+"type": "git",
+"url": "https://github.com/composer/ca-bundle.git;,
+"reference": "b17e6153cb7f33c7e44eb59578dc12eee5dc8e12"
+},
+"dist": {
+"type": "zip",
+"url": 
"https://api.github.com/repos/composer/ca-bundle/zipball/b17e6153cb7f33c7e44eb59578dc12eee5dc8e12;,
+"reference": "b17e6153cb7f33c7e44eb59578dc12eee5dc8e12",
+"shasum": ""
+},
+"require": {
+"ext-openssl": "*",
+"ext-pcre": "*",
+"php": "^5.3.2 || ^7.0"
+},
+"require-dev": {
+"phpunit/phpunit": "^4.5",
+"psr/log": "^1.0",
+"symfony/process": "^2.5 || ^3.0"
+},
+"suggest": {
+"symfony/process": "This is necessary to reliably check 
whether openssl_x509_parse is vulnerable on older php versions, but can be 
ignored on PHP 5.5.6+"
+},
+"type": "library",
+"extra": {
+"branch-alias": {
+"dev-master": "1.x-dev"
+}
+},
+"autoload": {
+"psr-4": {
+"Composer\\CaBundle\\": "src"
+}
+},
+"notification-url": "https://packagist.org/downloads/;,
+"license": [
+"MIT"
+],
+"authors": [
+{
+"name": "Jordi Boggiano",
+"email": "j.boggi...@seld.be",
+"homepage": "http://seld.be;
+}
+],
+"description": "Lets you find a path to the system CA bundle, and 
includes a fallback to the Mozilla CA bundle.",
+"keywords": [
+"cabundle",
+"cacert",
+"certificate",
+"ssl",
+"tls"
+],
+"time": "2017-03-06T11:59:08+00:00"
+},
+{
 "name": "corneltek/getoptionkit",
 "version": "2.5.4",
 "source": {
@@ -246,6 +305,59 @@
 "time": "2017-04-30T09:31:04+00:00"
 },
 {
+"name": "geoip2/geoip2",
+"version": "v2.6.0",
+"source": {
+"type": "git",
+"url": "https://github.com/maxmind/GeoIP2-php.git;,
+"reference": "9f6f1edf9901fed5cd692dd260333bf52091acd3"
+},
+"dist": {
+"type": "zip",
+"url": 
"https://api.github.com/repos/maxmind/GeoIP2-php/zipball/9f6f1edf9901fed5cd692dd260333bf52091acd3;,
+"reference": "9f6f1edf9901fed5cd692dd260333bf52091acd3",
+"shasum": ""
+},
+"require": {
+"maxmind-db/reader": "~1.0",
+"maxmind/web-service-common": "~0.4",
+"php": ">=5.4"
+},
+"require-dev": {
+"apigen/apigen": "*",
+"friendsofphp/php-cs-fixer": "2.*",
+"phpunit/phpunit": "4.*",
+"squizlabs/php_codesniffer": 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: Clear DefaultLocale lint warnings

2017-09-01 Thread Mholloway (Code Review)
Mholloway has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375453 )

Change subject: Hygiene: Clear DefaultLocale lint warnings
..

Hygiene: Clear DefaultLocale lint warnings

Change-Id: Ib38f7dd389181523d1bd08051d68d6992ea57f05
---
M app/src/androidTest/java/org/wikipedia/test/view/FontScale.java
M app/src/androidTest/java/org/wikipedia/test/view/LayoutDirection.java
M app/src/androidTest/java/org/wikipedia/test/view/PrimaryTestImg.java
M app/src/androidTest/java/org/wikipedia/test/view/PrimaryTestStr.java
M app/src/androidTest/java/org/wikipedia/test/view/SecondaryTestImg.java
M app/src/androidTest/java/org/wikipedia/test/view/SecondaryTestStr.java
M app/src/androidTest/java/org/wikipedia/test/view/TertiaryTestStr.java
M app/src/androidTest/java/org/wikipedia/test/view/ViewTest.java
M app/src/main/java/org/wikipedia/gallery/ImageLicense.java
M app/src/main/java/org/wikipedia/html/PixelDensityDescriptorParser.java
M app/src/main/java/org/wikipedia/language/LangLinksActivity.java
M app/src/main/java/org/wikipedia/offline/RemoteCompilationsFragment.java
M app/src/main/java/org/wikipedia/page/Namespace.java
M app/src/main/java/org/wikipedia/page/snippet/ShareHandler.java
M app/src/main/java/org/wikipedia/readinglist/ReadingListFragment.java
M app/src/main/java/org/wikipedia/search/SearchFragment.java
M app/src/main/java/org/wikipedia/settings/LanguagePreferenceDialog.java
17 files changed, 56 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/53/375453/1

diff --git a/app/src/androidTest/java/org/wikipedia/test/view/FontScale.java 
b/app/src/androidTest/java/org/wikipedia/test/view/FontScale.java
index d58369d..bcb2fbe 100644
--- a/app/src/androidTest/java/org/wikipedia/test/view/FontScale.java
+++ b/app/src/androidTest/java/org/wikipedia/test/view/FontScale.java
@@ -1,5 +1,7 @@
 package org.wikipedia.test.view;
 
+import java.util.Locale;
+
 public enum FontScale {
 DEFAULT(1), LARGE(1.5f);
 
@@ -8,7 +10,7 @@
 }
 
 @Override public String toString() {
-return super.toString().toLowerCase();
+return super.toString().toLowerCase(Locale.getDefault());
 }
 
 private final float multiplier;
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/view/LayoutDirection.java 
b/app/src/androidTest/java/org/wikipedia/test/view/LayoutDirection.java
index f033861..df7f2eb 100644
--- a/app/src/androidTest/java/org/wikipedia/test/view/LayoutDirection.java
+++ b/app/src/androidTest/java/org/wikipedia/test/view/LayoutDirection.java
@@ -1,5 +1,7 @@
 package org.wikipedia.test.view;
 
+import java.util.Locale;
+
 public enum LayoutDirection {
 LOCALE, RTL;
 
@@ -8,6 +10,6 @@
 }
 
 @Override public String toString() {
-return super.toString().toLowerCase();
+return super.toString().toLowerCase(Locale.getDefault());
 }
 }
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/view/PrimaryTestImg.java 
b/app/src/androidTest/java/org/wikipedia/test/view/PrimaryTestImg.java
index 6f1be4d..7202f2a 100644
--- a/app/src/androidTest/java/org/wikipedia/test/view/PrimaryTestImg.java
+++ b/app/src/androidTest/java/org/wikipedia/test/view/PrimaryTestImg.java
@@ -4,6 +4,8 @@
 
 import org.wikipedia.R;
 
+import java.util.Locale;
+
 public enum PrimaryTestImg implements TestImg {
 NULL(0), NONNULL(R.drawable.ic_wmf_logo);
 
@@ -16,7 +18,7 @@
 }
 
 @Override public String toString() {
-return super.toString().toLowerCase();
+return super.toString().toLowerCase(Locale.getDefault());
 }
 
 @DrawableRes private final int id;
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/view/PrimaryTestStr.java 
b/app/src/androidTest/java/org/wikipedia/test/view/PrimaryTestStr.java
index 2ca50a9..17c2be8 100644
--- a/app/src/androidTest/java/org/wikipedia/test/view/PrimaryTestStr.java
+++ b/app/src/androidTest/java/org/wikipedia/test/view/PrimaryTestStr.java
@@ -4,6 +4,8 @@
 
 import org.wikipedia.R;
 
+import java.util.Locale;
+
 public enum PrimaryTestStr implements TestStr {
 NULL(0), SHORT(R.string.reading_list_name_sample),
 LONG(R.string.gallery_save_image_write_permission_rationale);
@@ -17,7 +19,7 @@
 }
 
 @Override public String toString() {
-return super.toString().toLowerCase();
+return super.toString().toLowerCase(Locale.getDefault());
 }
 
 @StringRes private final int id;
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/view/SecondaryTestImg.java 
b/app/src/androidTest/java/org/wikipedia/test/view/SecondaryTestImg.java
index e508eb6..ffdd28a 100644
--- a/app/src/androidTest/java/org/wikipedia/test/view/SecondaryTestImg.java
+++ b/app/src/androidTest/java/org/wikipedia/test/view/SecondaryTestImg.java
@@ -4,6 +4,8 @@
 
 import org.wikipedia.R;
 
+import java.util.Locale;
+
 public enum SecondaryTestImg implements TestImg {
 

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Resolve ty batch start timestamp in PHP

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375027 )

Change subject: Resolve ty batch start timestamp in PHP
..


Resolve ty batch start timestamp in PHP

Bug: T149745
Change-Id: I81cde571e7dbb9459aa036200ee924694a1ad7a3
---
M sites/all/modules/thank_you/thank_you.module
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  XenoRyet: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/thank_you/thank_you.module 
b/sites/all/modules/thank_you/thank_you.module
index 796cea9..e6fbb6c 100644
--- a/sites/all/modules/thank_you/thank_you.module
+++ b/sites/all/modules/thank_you/thank_you.module
@@ -1,5 +1,6 @@
 push( 'civicrm' );
 
+   $earliest = UtcDate::getUtcDatabaseString( "-$days days" );
$ty_query = << DATE_SUB( NOW(), INTERVAL :interval DAY 
) AND
+   receive_date > :earliest AND
thankyou_date IS NULL AND
no_thank_you IS NULL
ORDER BY receive_date ASC LIMIT {$batch};
 EOT;
 
-   $result = db_query( $ty_query, array( ':interval' => $days ) );
+   $result = db_query( $ty_query, array( ':earliest' => $earliest ) );
 
$count = 0;
$consecutiveFailures = 0;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I81cde571e7dbb9459aa036200ee924694a1ad7a3
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: Katie Horn 
Gerrit-Reviewer: Mepps 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Restrict removal of back links in references to legacy version

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369428 )

Change subject: Restrict removal of back links in references to legacy version
..


Restrict removal of back links in references to legacy version

We need the back links for the new references endpoint but we don't want
them for the old endpoints.

So, the "formatted" endpoints get the back links, too.

Change-Id: I4cc3b19fb4572a1c687ce2fc9246086d8fe59926
---
M lib/transforms.js
M 
test/diff/results/page_formatted-enwiki-User%3ABSitzmann_(WMF)_MCS_Test_Frankenstein.json
M 
test/diff/results/page_formatted-enwiki-User%3ABSitzmann_(WMF)_MCS_Test_Frankenstein/section25-text.html
M 
test/diff/results/page_formatted-enwiki-User%3ABSitzmann_(WMF)_MCS_Test_TitleLinkEncoding.json
M 
test/diff/results/page_formatted-enwiki-User%3ABSitzmann_(WMF)_MCS_Test_TitleLinkEncoding/section3-text.html
5 files changed, 16 insertions(+), 13 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified
  Mholloway: Looks good to me, but someone else must approve



diff --git a/lib/transforms.js b/lib/transforms.js
index 96f04ea..c10dbb1 100644
--- a/lib/transforms.js
+++ b/lib/transforms.js
@@ -249,7 +249,7 @@
 /**
  * Nukes stuff from the DOM we don't want.
  */
-function _runAllSectionsTransforms(doc) {
+function _runAllSectionsTransforms(doc, legacy) {
 const rmSelectors = [
 'span.Z3988',  // Remove 
 'span:empty',  // Remove empty 
@@ -265,9 +265,11 @@
 
 _removeUnwantedElements(doc, rmSelectors);
 
-// Remove reference link backs since we don't want them to appear in the 
reference dialog;
-// they are not needed.
-_removeRefLinkbacks(doc);
+if (legacy) {
+// Remove reference link backs since we don't want them to appear in 
the reference dialog;
+// they are not needed.
+_removeRefLinkbacks(doc);
+}
 }
 
 /**
@@ -302,7 +304,7 @@
  * Nukes stuff from the DOM we don't want for pages from Parsoid.
  */
 transforms.stripUnneededMarkup = function(doc, legacy) {
-_runAllSectionsTransforms(doc);
+_runAllSectionsTransforms(doc, legacy);
 // runLeadSectionTransforms(doc);
 _applyOptionalParsoidSpecificTransformations(doc);
 
diff --git 
"a/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
 
"b/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
index 90f4cf4..3bea40b 100644
--- 
"a/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
+++ 
"b/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
@@ -190,7 +190,7 @@
   },
   {
 "id": 25,
-"text": "\n\n This 
sequence has been in place since at least http://en.wikipedia.org/w/index.php?title=Wikipedia:Layoutoldid=2166480\;>2003
 (when \"See also\" was called \"Related topics\"). See, for example, Wikipedia:Perennial proposals#Changes 
to standard appendices. The original rationale for this ordering is that, 
with the exception of Works, sections which contain material outside 
Wikipedia (including Further reading and External links) should 
come after sections that contain Wikipedia material (including See also) 
to help keep the distinction clear. The sections containing notes and 
references often contain both kinds of material and, consequently, appear after 
the See also section (if any) and before the Further reading 
section (if any). Whatever the validity of the original rationale, there is now 
the additional factor that readers have come to expect the appendices to appear 
in this order. While 
categories are entered on the editing page ahead of stub templates, they appear 
on the visual page in a separate box after the stub templates. One of the 
reasons this happens is that every stub template generates a stub category, and 
those stub categories appear after the \"main\" categories. Another is that 
certain bots and scripts are set up to expect the categories, stubs and interlanguage links to appear in that order, and will reposition 
them if they don't. Therefore, any manual attempt to change the order is futile 
unless the bots and scripts are also altered. For example, skipping heading levels, such as 
jumping from ==Heading2== to 
Heading4 without 
===Heading3=== in the middle, violates Wikipedia:Accessibility as it reduces usability for 
readers on screen readers who use heading levels to navigate 
pages. Syntax:\n\n==See also==\n* [[Wikipedia:How to edit a 
page]]\n* [[Wikipedia:Manual of 
Style]]\n\n\nWhich produces:\n\nSee also\n Wikipedia:How to edit a page\n Wikipedia:Manual of Style\n The rationale for not printing navigation boxes is 
that these templates contain wikilinks that are of no use to print readers.[1] There are two problems 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: labmon: prometheus classes to monitor the keystone api endpoint

2017-09-01 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375452 )

Change subject: labmon: prometheus classes to monitor the keystone api endpoint
..

labmon: prometheus classes to monitor the keystone api endpoint

This doesn't work, or at least I can't connect to the dashboard
to see it working.

Change-Id: Ia8831bd328bb4239e34f4740b61b9a6e135c5736
---
A modules/role/manifests/labs/prometheus.pp
1 file changed, 54 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/52/375452/1

diff --git a/modules/role/manifests/labs/prometheus.pp 
b/modules/role/manifests/labs/prometheus.pp
new file mode 100644
index 000..8858dfa
--- /dev/null
+++ b/modules/role/manifests/labs/prometheus.pp
@@ -0,0 +1,54 @@
+# Prometheus services to monitor OpenStack service uptime
+class role::labs::prometheus {
+$targets_path = '/srv/prometheus/labs/targets'
+$storage_retention = hiera('prometheus::server::storage_retention', 
'2190h0m0s')
+$max_chunks_to_persist = 
hiera('prometheus::server::max_chunks_to_persist', '524288')
+$memory_chunks = hiera('prometheus::server::memory_chunks', '1048576')
+
+include ::prometheus::blackbox_exporter
+$blackbox_jobs = [
+{
+'job_name'=> 'blackbox_http',
+'metrics_path'=> '/probe',
+'params'  => {
+'module' => [ 'http_connect' ],
+},
+'file_sd_configs' => [
+{ 'files' => [ "${targets_path}/blackbox_http_*.yaml" ] }
+],
+'relabel_configs' => [
+{ 'source_labels' => ['__address__'],
+'target_label'  => '__param_target',
+},
+{ 'source_labels' => ['__param_target'],
+'target_label'  => 'instance',
+},
+{ 'target_label' => '__address__',
+'replacement'  => '127.0.0.1:9115',
+},
+  ],
+},
+]
+
+file { "${targets_path}/blackbox_http_keystone.yaml":
+  content => ordered_yaml([{
+'targets' => ['labcontrol1001.wikimedia.org:5000', ]
+}]),
+}
+
+prometheus::server { 'labs':
+storage_encoding  => '2',
+listen_address=> '127.0.0.1:9900',
+storage_retention => $storage_retention,
+max_chunks_to_persist => $max_chunks_to_persist,
+memory_chunks => $memory_chunks,
+scrape_configs_extra  => array_concat(
+$blackbox_jobs
+),
+global_config_extra   => $config_extra,
+}
+
+prometheus::web { 'labs':
+proxy_pass => 'http://localhost:9900/labs',
+}
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8831bd328bb4239e34f4740b61b9a6e135c5736
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikispeech[master]: build: Replace jshint and jscs with eslint; bump everything ...

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/374401 )

Change subject: build: Replace jshint and jscs with eslint; bump everything else
..


build: Replace jshint and jscs with eslint; bump everything else

 grunt-banana-checker   0.4.0  →   0.6.0
 grunt-jsonlint 1.0.4  →   1.1.0
 grunt-stylelint   ^0.7.0  →   0.8.0

Change-Id: I331b05e963d8b61296f3633b409b914ee2399d38
---
A .eslintrc.json
D .jscsrc
D .jshintignore
D .jshintrc
M Gruntfile.js
M modules/ext.wikispeech.js
M package.json
A tests/qunit/.eslintrc.json
M tests/qunit/ext.wikispeech.highlighter.test.js
M tests/qunit/ext.wikispeech.test.js
10 files changed, 86 insertions(+), 115 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 000..3931182
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,11 @@
+{
+   "extends": "wikimedia",
+   "env": {
+   "browser": true,
+   "jquery": true
+   },
+   "globals": {
+   "mediaWiki": false
+   },
+   "rules": {}
+}
diff --git a/.jscsrc b/.jscsrc
deleted file mode 100644
index a031ea4..000
--- a/.jscsrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-   "preset": "wikimedia"
-}
\ No newline at end of file
diff --git a/.jshintignore b/.jshintignore
deleted file mode 100644
index b512c09..000
--- a/.jshintignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
\ No newline at end of file
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index 95facb2..000
--- a/.jshintrc
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-   "predef": [
-   "mediaWiki",
-   "jQuery",
-   "QUnit",
-   "sinon",
-   "JSON"
-   ],
-
-   // Enforcing
-   "bitwise": true,
-   "eqeqeq": true,
-   "es3": true,
-   "latedef": true,
-   "noarg": true,
-   "nonew": true,
-   "undef": true,
-   "unused": true,
-   "strict": false,
-
-   // Environment
-   "browser": true,
-
-   "globals": {
-   "mw": false,
-   "$": false
-   }
-}
diff --git a/Gruntfile.js b/Gruntfile.js
index f2d6f3b..1ded3a3 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,27 +1,19 @@
-/*jshint node:true */
+/* eslint-env node, es6 */
 module.exports = function ( grunt ) {
var conf = grunt.file.readJSON( 'extension.json' );
-   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+   grunt.loadNpmTasks( 'grunt-eslint' );
+   grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
-   grunt.loadNpmTasks( 'grunt-jscs' );
-   grunt.loadNpmTasks( 'grunt-stylelint' );
 
grunt.initConfig( {
-   jshint: {
-   options: {
-   jshintrc: true
-   },
+   eslint: {
all: [
'*.js',
'modules/**/*.js',
'tests/**/*.js'
]
},
-   jscs: {
-   src: '<%= jshint.all %>'
-   },
-   banana: conf.MessagesDirs,
jsonlint: {
all: [
'*.json',
@@ -30,6 +22,7 @@
'!vendor/**'
]
},
+   banana: conf.MessagesDirs,
stylelint: {
options: {
formatter: 'string',
@@ -46,8 +39,7 @@
grunt.registerTask(
'test',
[
-   'jshint',
-   'jscs',
+   'eslint',
'jsonlint',
'banana',
'stylelint'
diff --git a/modules/ext.wikispeech.js b/modules/ext.wikispeech.js
index edbc8e6..d7d9e86 100644
--- a/modules/ext.wikispeech.js
+++ b/modules/ext.wikispeech.js
@@ -270,7 +270,7 @@
$audio = $( currentUtterance.audio );
utterance.audio.play();
mw.wikispeech.highlighter.highlightUtterance( utterance 
);
-   if (  self.audioIsReady( $audio ) ) {
+   if ( self.audioIsReady( $audio ) ) {
$( '#ext-wikispeech-loader' ).css( 
'visibility', 'hidden' );
} else {
self.addCanPlayListener( $audio );
@@ -786,11 +786,10 @@
url: serverUrl,
method: 'POST',
data: {
-   // jscs:disable 

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.16]: WLFilters: reword watchlist-details slightly

2017-09-01 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375451 )

Change subject: WLFilters: reword watchlist-details slightly
..

WLFilters: reword watchlist-details slightly

It won't show up like this on en.wp due to
site customization but other wikis will see it.

Bug: T172030
Change-Id: I2dbaad3c5f8200d95431fda6f246decdb1633c62
(cherry picked from commit 94497cbd3404d7c72e21c7006aa8b06122049941)
---
M languages/i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/375451/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index dae2c40..e848d52 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -2219,7 +2219,7 @@
"unwatchthispage": "Stop watching",
"notanarticle": "Not a content page",
"notvisiblerev": "The last revision by a different user has been 
deleted",
-   "watchlist-details": "{{PLURAL:$1|$1 page|$1 pages}} on your watchlist, 
not separately counting talk pages.",
+   "watchlist-details": "{{PLURAL:$1|$1 page is|$1 pages are}} on your 
Watchlist (plus talk pages).",
"wlheader-enotif": "Email notification is enabled.",
"wlheader-showupdated": "Pages that have been changed since you last 
visited them are shown in bold.",
"wlnote": "Below {{PLURAL:$1|is the last change|are the last 
$1 changes}} in the last {{PLURAL:$2|hour|$2 
hours}}, as of $3, $4.",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2dbaad3c5f8200d95431fda6f246decdb1633c62
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.30.0-wmf.16
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Sbisson 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Actually cache fallback language templates

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/374583 )

Change subject: Actually cache fallback language templates
..


Actually cache fallback language templates

In the previous code, if there was an en-br attempt followed by an
en-za attempt, the 'en' template would not be cached under en-za.
Cache after the en-br mail:
[ 'en' => 'en template', 'en-br' => 'en template' ]
Then on the en-za attempt, it attempts to load en-za and fails, falls
back to en, and immediately returns the cached en template without
caching it under en-za.

Bug: T170435
Change-Id: I68996e2ba849e31a71df59c5782fac22f69d95b4
---
M sites/all/modules/wmf_communication/Templating.php
1 file changed, 12 insertions(+), 1 deletion(-)

Approvals:
  XenoRyet: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/wmf_communication/Templating.php 
b/sites/all/modules/wmf_communication/Templating.php
index b61052e..459c7e3 100644
--- a/sites/all/modules/wmf_communication/Templating.php
+++ b/sites/all/modules/wmf_communication/Templating.php
@@ -123,11 +123,22 @@
 do {
 $cacheKey = $this->getFilePath( $language );
 if ( array_key_exists( $cacheKey, self::$template_cache ) ) {
-return self::$template_cache[$cacheKey];
+$template = self::$template_cache[$cacheKey];
+// If the language we originally asked for wasn't cached, but
+// the fallback language was, let's cache the template under
+// our original language too so we don't fall back next time.
+if ( $language !== $this->language ) {
+self::$template_cache[$originalLookupCacheKey] = $template;
+}
+return $template;
 }
 $template = $this->loadTemplateFile( $language );
 if ( $template ) {
+// We have successfully loaded a thing that's not cached yet.
+// Cache the template under its actual language.
 self::$template_cache[$cacheKey] = $template;
+// And if we originally asked for a different language, cache
+// it under that one so we don't have to fall back next time.
 if ( $language !== $this->language ) {
 self::$template_cache[$originalLookupCacheKey] = $template;
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I68996e2ba849e31a71df59c5782fac22f69d95b4
Gerrit-PatchSet: 3
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Katie Horn 
Gerrit-Reviewer: Mepps 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: WLFilters: reword watchlist-details slightly

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375429 )

Change subject: WLFilters: reword watchlist-details slightly
..


WLFilters: reword watchlist-details slightly

It won't show up like this on en.wp due to
site customization but other wikis will see it.

Bug: T172030
Change-Id: I2dbaad3c5f8200d95431fda6f246decdb1633c62
---
M languages/i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 2d614f1..f884e94 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -2220,7 +2220,7 @@
"unwatchthispage": "Stop watching",
"notanarticle": "Not a content page",
"notvisiblerev": "The last revision by a different user has been 
deleted",
-   "watchlist-details": "{{PLURAL:$1|$1 page|$1 pages}} on your watchlist, 
not separately counting talk pages.",
+   "watchlist-details": "{{PLURAL:$1|$1 page is|$1 pages are}} on your 
Watchlist (plus talk pages).",
"wlheader-enotif": "Email notification is enabled.",
"wlheader-showupdated": "Pages that have been changed since you last 
visited them are shown in bold.",
"wlnote": "Below {{PLURAL:$1|is the last change|are the last 
$1 changes}} in the last {{PLURAL:$2|hour|$2 
hours}}, as of $3, $4.",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2dbaad3c5f8200d95431fda6f246decdb1633c62
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Sbisson 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mediawiki.special.changeslist.legend.js: Remove wait for doc...

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375446 )

Change subject: mediawiki.special.changeslist.legend.js: Remove wait for 
document ready
..


mediawiki.special.changeslist.legend.js: Remove wait for document ready

mw.hook( 'wikipage.content' ) gets fired after document ready.

Change-Id: Ia1536e734f8ae08cc7cc07c3b1854bdaafb54866
---
M resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
1 file changed, 3 insertions(+), 5 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js 
b/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
index a991d36..0792762 100644
--- a/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
+++ b/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
@@ -3,7 +3,7 @@
  */
 
 /* Remember the collapse state of the legend on recent changes and watchlist 
pages. */
-( function ( mw, $ ) {
+( function ( mw ) {
var
cookieName = 'changeslist-state',
// Expanded by default
@@ -20,7 +20,5 @@
} );
};
 
-   $( function () {
-   mw.hook( 'wikipage.content' ).add( doCollapsibleLegend );
-   } );
-}( mediaWiki, jQuery ) );
+   mw.hook( 'wikipage.content' ).add( doCollapsibleLegend );
+}( mediaWiki ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia1536e734f8ae08cc7cc07c3b1854bdaafb54866
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Fomafix 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: [Facepalm] Update AddToReadingListDialog to remove hardcoded...

2017-09-01 Thread Mholloway (Code Review)
Mholloway has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375450 )

Change subject: [Facepalm] Update AddToReadingListDialog to remove hardcoded 
strings
..

[Facepalm] Update AddToReadingListDialog to remove hardcoded strings

Somehow these made it onto master...

Also, remove a class of test that one of the new string resources breaks
from master.  The tests are nonsensical because they assume that ordinals
in format string parameters mean the parameters are all for the same data
type; it doesn't.

Change-Id: I1529b25df25c68b52526b45d2331b9a7a0bc96bd
---
M app/src/main/java/org/wikipedia/readinglist/AddToReadingListDialog.java
M app/src/main/res/values-qq/strings.xml
M app/src/main/res/values/strings.xml
M app/src/test/java/org/wikipedia/language/TranslationTests.java
4 files changed, 13 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/50/375450/1

diff --git 
a/app/src/main/java/org/wikipedia/readinglist/AddToReadingListDialog.java 
b/app/src/main/java/org/wikipedia/readinglist/AddToReadingListDialog.java
index a0147b3..fbe3cf7 100644
--- a/app/src/main/java/org/wikipedia/readinglist/AddToReadingListDialog.java
+++ b/app/src/main/java/org/wikipedia/readinglist/AddToReadingListDialog.java
@@ -248,11 +248,11 @@
 if (isAdded()) {
 String message;
 if (result.size() == 0) {
-message = "The chosen list already contains all of the 
selected pages."; // todo: string res
+message = 
getString(R.string.reading_list_already_contains_selection);
 } else {
 message = TextUtils.isEmpty(readingList.getTitle())
-? String.format("Added %d articles to reading 
list.", result.size()) // todo: string res
-: String.format("Added %1$d articles to %2$s", 
result.size(), readingList.getTitle()); // todo: string res
+? 
String.format(getString(R.string.reading_list_added_articles_list_untitled), 
result.size())
+: 
String.format(getString(R.string.reading_list_added_articles_list_titled), 
result.size(), readingList.getTitle());
 new ReadingListsFunnel().logAddToList(readingList, 
readingLists.size(), invokeSource);
 ReadingList.DAO.makeListMostRecent(readingList);
 }
diff --git a/app/src/main/res/values-qq/strings.xml 
b/app/src/main/res/values-qq/strings.xml
index 0d137ac..67e216b 100644
--- a/app/src/main/res/values-qq/strings.xml
+++ b/app/src/main/res/values-qq/strings.xml
@@ -335,6 +335,9 @@
   Affirmative answer to 
confirm that remotely stored reading list data used for syncing across devices 
should be deleted.\n{{Identical|Yes}}
   Negative answer to 
confirm that remotely stored reading list data used for syncing across devices 
should be deleted.\n{{Identical|No}}
   Message shown when the 
article is in the process of being downloaded, and is not yet available for 
offline access.
+  Message shown to the 
user when the user tries to add pages to a reading list but the list already 
contains all of the chosen pages.
+  Message shown when 
the user adds articles to an unnamed reading list.  The %d symbol is replaced 
with the number of articles added.
+  Message shown when 
the user adds articles to a named reading list.  The %1$d symbol is replaced 
with the number of articles added, and the %2$s symbol is replaced with the 
list name.
   
 Message shown when a single reading list article is 
made available for offline use.
 Message shown when more than one reading list 
article is made available for offline use.
diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index 3a3194e..9b8112e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -360,6 +360,9 @@
 Yes
 No
 The article is being 
downloaded, and it will be available offline when complete.
+The chosen list 
already contains all of the selected pages.
+Added %d articles 
to reading list.
+Added %1$d articles 
to %2$s
 
 This article will now be available offline.
 These articles will now be available 
offline.
diff --git a/app/src/test/java/org/wikipedia/language/TranslationTests.java 
b/app/src/test/java/org/wikipedia/language/TranslationTests.java
index 978303d..b06cbb5 100644
--- a/app/src/test/java/org/wikipedia/language/TranslationTests.java
+++ b/app/src/test/java/org/wikipedia/language/TranslationTests.java
@@ -41,14 +41,9 @@
 public class TranslationTests {
 private static File RES_BASE = new File("src/main/res/");
 
-private static final String POSSIBLE_PARAM_FLOAT_FIRST = "%1$.2f";
-private static final String 

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Cancel subscription on red-flag declined

2017-09-01 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375449 )

Change subject: Cancel subscription on red-flag declined
..

Cancel subscription on red-flag declined

Mastercard can fine merchants $1000 for retrying after certain
decline codes. Don't do our usual 3 retries in those cases.

Bug: T174450
Change-Id: I16129c7ca4f12a09900f3ca10808ee0e0a650909
---
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
M sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc
M sites/all/modules/recurring_globalcollect/tests/RecurringGlobalCollectTest.php
3 files changed, 95 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/49/375449/1

diff --git 
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module 
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
index b3aa5f8..5fa5f73 100644
--- a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
+++ b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
@@ -336,7 +336,7 @@
   );
 
   if ( $result->isFailed() || $result->getErrors() ) {
-_recurring_globalcollect_update_record_failure($contribution_recur_id);
+_recurring_globalcollect_update_record_failure($contribution_recur_id, 
$result->getErrors());
 throw new WmfException( 'PAYMENT_FAILED', 'recurring charge failed', 
array('payment_result' => $result));
   }
 
diff --git 
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc 
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc
index 99dae1a..83a5488 100644
--- 
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc
+++ 
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc
@@ -165,11 +165,12 @@
  * - [5] => In Progress (there is a process actively trying to process this 
donation right now; used to avoid race conditions, if a contribution is stuck 
in this state it'll need manual intervention and reconciliation)
  * - [6] => Overdue (not used by this module)
  *
- * @param integer $id The primary key of the record.
+ * @param integer $id The primary key of the record.
  *
- * @return integer  Returns the number of affected rows.
+ * @param array $errors
+ * @return int Returns the number of affected rows.
  */
-function _recurring_globalcollect_update_record_failure($id) {
+function _recurring_globalcollect_update_record_failure($id, $errors) {
 
   $result = recurring_globalcollect_get_payment_by_id($id);
   $record = (array) $result;
@@ -188,7 +189,10 @@
   $contribution_status_id = civicrm_api_contribution_status('Failed');
 
   // If there have been too many failures, cancel this payment permanently.
-  if ( $record['failure_count'] >= ( $failures_before_cancellation - 1 ) ) {
+  if (
+$record['failure_count'] >= ( $failures_before_cancellation - 1 )
+|| recurring_globalcollect_should_force_cancel( $errors )
+  ) {
 $contribution_status_id = civicrm_api_contribution_status('Cancelled');
 $end_date = 'NULL';
 $failure_retry_date = 'NULL';
@@ -222,6 +226,40 @@
 }
 
 /**
+ * Detect payment errors serious enough to warrant cancelling the subscription
+ * without any retries. These are mostly codes which Mastercard would fine us
+ * for retrying.
+ * TODO: de-duplicate this list, or indicate severity somewhere in PaymentError
+ *
+ * @param PaymentError[] $errors
+ * @return bool true if there's an error serious enough to force cancellation
+ */
+function recurring_globalcollect_should_force_cancel( $errors ) {
+  $thirdRailErrorCodes = array(
+'430260',
+'430349',
+'430357',
+'430410',
+'430415',
+'430418',
+'430421',
+'430697',
+'485020',
+'4360022',
+'4360023',
+'430306',
+'430330',
+'430354',
+  );
+  foreach ( $errors as $error ) {
+if ( array_search( $error->getErrorCode(), $thirdRailErrorCodes ) !== 
false ) {
+  return true;
+}
+  }
+  return false;
+}
+
+/**
  * Update recurring payment as in progress.
  *
  * @todo Implement $contributionStatus = 
CRM_Contribute_PseudoConstant::contributionStatus( null, 'name' );
diff --git 
a/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalCollectTest.php
 
b/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalCollectTest.php
index c3d2d06..b1f5091 100644
--- 
a/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalCollectTest.php
+++ 
b/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalCollectTest.php
@@ -203,4 +203,56 @@
) );
$this->assertNotEmpty( $contribution_tracking_id );
}
+
+   /**
+* Tests to make sure that certain error codes returned from GC will
+* trigger subscription cancellation, even if retryable errors also 
exist.
+  

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Make _flush aware of _putthread ongoing tasks

2017-09-01 Thread Mpaa (Code Review)
Mpaa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375448 )

Change subject: Make _flush aware of _putthread ongoing tasks
..

Make _flush aware of _putthread ongoing tasks

Make sure _flush() is aware if _putthread() is idle or working on a
task.
Relying on page_put_queue.qsize() > 0 only, as a condition to keep the while
loop alive is not safe as the last item in the queue can be fetched by
async_manager() before page_put_queue.qsize() is checked and then found empty.
In this case _flush() returns before all pending requests are served.

A new Queue is introduced as a form of synchronisation between
MainThread in _flush() and asyc_manager(), signalling when async_manager
is actually working and not idle waiting for a request.

Bug: T147178
Change-Id: I184b445c43aa44cb000bfacc1cad18d2de265c48
---
M pywikibot/__init__.py
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/48/375448/1

diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index e4000cc..782297e 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -1315,7 +1315,8 @@
 '{lightblue}Waiting for {num} pages to be put. '
 'Estimated time remaining: {sec}{default}', num=num, sec=sec))
 
-while _putthread.isAlive() and page_put_queue.qsize() > 0:
+while (_putthread.isAlive() and
+   (page_put_queue.qsize() > 0 or page_put_queue_busy.qsize() > 0)):
 try:
 _putthread.join(1)
 except KeyboardInterrupt:
@@ -1341,10 +1342,12 @@
 """Daemon; take requests from the queue and execute them in background."""
 while True:
 (request, args, kwargs) = page_put_queue.get()
+page_put_queue_busy.put(None)
 if request is None:
 break
 request(*args, **kwargs)
 page_put_queue.task_done()
+page_put_queue_busy.get()
 
 
 def async_request(request, *args, **kwargs):
@@ -1363,6 +1366,8 @@
 
 # queue to hold pending requests
 page_put_queue = Queue(config.max_queue_size)
+# queue to signal that async_manager is working on a request. See T147178.
+page_put_queue_busy = Queue(config.max_queue_size)
 # set up the background thread
 _putthread = threading.Thread(target=async_manager)
 # identification for debugging purposes

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I184b445c43aa44cb000bfacc1cad18d2de265c48
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix texts in article page show English instead of Chinese

2017-09-01 Thread Cooltey (Code Review)
Cooltey has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375447 )

Change subject: Fix texts in article page show English instead of Chinese
..

Fix texts in article page show English instead of Chinese

In this update
  - Add a method to detect the language code from API, and setLocale directly 
if it is in "zh" variant

Bug: T162398
Change-Id: If50de9da3a933f5546f314e4c2558cc92f2f26a1
---
M app/src/main/java/org/wikipedia/util/L10nUtil.java
1 file changed, 25 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/47/375447/1

diff --git a/app/src/main/java/org/wikipedia/util/L10nUtil.java 
b/app/src/main/java/org/wikipedia/util/L10nUtil.java
index 4224bd1..b4cabcf 100644
--- a/app/src/main/java/org/wikipedia/util/L10nUtil.java
+++ b/app/src/main/java/org/wikipedia/util/L10nUtil.java
@@ -153,7 +153,7 @@
 private static SparseArray getStringsForLocale(Locale 
targetLocale, @StringRes int[] strings) {
 Configuration config = getCurrentConfiguration();
 Locale systemLocale = ConfigurationCompat.getLocale(config);
-ConfigurationCompat.setLocale(config, targetLocale);
+setDesiredLocale(config, targetLocale);
 SparseArray localizedStrings = getTargetStrings(strings, 
config);
 ConfigurationCompat.setLocale(config, systemLocale);
 resetConfiguration(config);
@@ -194,6 +194,30 @@
 return DateUtils.getRelativeTimeSpanString(date.getTime(), 
System.currentTimeMillis(), DateUtils.SECOND_IN_MILLIS, 0).toString();
 }
 
+
+/**
+ * Special method for Chinese variant
+ * @param config Configuration from current configuration
+ * @param desiredLocale Desired Locale from API
+ */
+public static void setDesiredLocale(Configuration config, Locale 
desiredLocale){
+// when loads API in chinese variant, we can get zh-hant, zh-hans and 
zh
+// but if we want to display chinese correctly based on the article 
itself, we have to detect the variant from  the API responses
+// otherwise, we will only get english texts. And this might only 
happen in Chinese variant
+if (desiredLocale != null) {
+if (desiredLocale.getLanguage().equals("zh-hant")) {
+ConfigurationCompat.setLocale(config, 
Locale.TRADITIONAL_CHINESE);
+} else if (desiredLocale.getLanguage().equals("zh-hans")) {
+ConfigurationCompat.setLocale(config, 
Locale.SIMPLIFIED_CHINESE);
+} else if (desiredLocale.getLanguage().equals("zh")) {
+// create a new Locale object to manage only "zh" language 
code based on its app language code
+setDesiredLocale(config, new 
Locale(WikipediaApp.getInstance().getAppLanguageCode()));
+} else {
+ConfigurationCompat.setLocale(config, desiredLocale);
+}
+}
+}
+
 private L10nUtil() {
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If50de9da3a933f5546f314e4c2558cc92f2f26a1
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Cooltey 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Update pt-br and ja Thank You letters

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375403 )

Change subject: Update pt-br and ja Thank You letters
..


Update pt-br and ja Thank You letters

Bug: T173809
Change-Id: Ie42d0cbad9667e8278c6c147161fc85aff2f4a73
---
M sites/all/modules/thank_you/templates/html/thank_you.ja.html
M sites/all/modules/thank_you/templates/html/thank_you.pt-br.html
2 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  XenoRyet: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/thank_you/templates/html/thank_you.ja.html 
b/sites/all/modules/thank_you/templates/html/thank_you.ja.html
index e91c212..2837de0 100644
--- a/sites/all/modules/thank_you/templates/html/thank_you.ja.html
+++ b/sites/all/modules/thank_you/templates/html/thank_you.ja.html
@@ -5,7 +5,7 @@
 ご寄付くださったみなさまへ
 {%endif%}
 
-このたびは、ウィキペディアとウィキメディア財団へのご支援を頂きありがとうございました。あなたの {{ (currency ~ " " ~ 
amount) | l10n_currency(locale) }} 
ご寄付はウィキペディアを支え、誰もがアクセスできる自由な知識の未来の確保のために役立ちます。
+このたびは、ウィキペディアとウィキメディア財団へのご支援を頂きありがとうございました。あなたの {{ (currency ~ " " ~ 
amount) | l10n_currency(locale) }} 
のご寄付はウィキペディアを支え、誰もがアクセスできる自由な知識の未来の確保のために役立ちます。
 
 {% if "RecurringRestarted" in contribution_tags %}
 
毎月の定期寄付が引き落されないという技術的な問題が発生しておりましたが、先般これを解決いたしました。これからの寄付につきましては通常通り引き落とされます。停止期間の引き落としを改めて行うことは御座いません。皆様の辛抱とご支援に深く感謝致します。もし何かご質問がございましたら、どうぞ遠慮なく
 don...@wikimedia.org までお寄せください。
@@ -16,7 +16,7 @@
 {%endif%}
 
 
-  
ウィキペディアは力強い考え方のおかげで実現できています。その考え方とは、世界の知識の構築、そして誰もがどこからでもその知識に自由にアクセスできるようにする作業に、あなたや私のような人たちがに参加できるということです。
+  
ウィキペディアは力強い考え方のおかげで実現できています。その考え方とは、世界の知識の構築、そして誰もがどこからでもその知識に自由にアクセスできるようにする作業に、あなたや私のような人たちが参加できるということです。
 
 
 
いまあなたがウィキペディアを何時間でも読んでいられるのは、何百万人というボランティアの寄稿者や支援者のおかげです。ウィキペディアの記事数は4000万件以上、自由利用が許可された画像数は3500万以上あり、ウィキペディアはほぼどのような疑問にも答えることができ、今までに経験したことのない世界へと皆さんをいざないます。
@@ -44,4 +44,4 @@
 
 郵送先住所:Wikimedia Foundation, Inc., P.O. Box 98204, Washington, DC 
20090-8204, USA. 米国の課税控除番号:20-0049703
 
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/sites/all/modules/thank_you/templates/html/thank_you.pt-br.html 
b/sites/all/modules/thank_you/templates/html/thank_you.pt-br.html
index 8aefd30..e580952 100644
--- a/sites/all/modules/thank_you/templates/html/thank_you.pt-br.html
+++ b/sites/all/modules/thank_you/templates/html/thank_you.pt-br.html
@@ -19,7 +19,7 @@
   A Wikipédia é o resultado de uma ideia poderosa: que pessoas como você e 
eu podem participar na construção do conhecimento mundial e em torná-lo 
livremente disponível para todos, estejam onde estiverem.
 
 
-Hoje, graças ao apoio de milhões de colaboradores e apoiadores voluntários, 
você pode navegar horas e horas na Wikipédia. Com mais de 40 milhões de artigos 
e 35 milhões de imagens com licença livre, a Wikipédia é capaz responder a 
praticamente qualquer pergunta e levar você a lugares onde nunca esteve.
+Hoje, graças ao apoio de milhões de colaboradores e apoiadores voluntários, 
você pode navegar horas e horas na Wikipédia. Com mais de 40 milhões de artigos 
e 35 milhões de imagens com licença livre, a Wikipédia é capaz de responder a 
praticamente qualquer pergunta e levar você a lugares onde nunca esteve.
 
 Sua doação ajuda a criar e compartilhar o livre conhecimento de forma real 
e prática. Ela nos permite fazer com que a Wikipédia seja rápida, segura e 
acessível às pessoas do mundo todo. Ela nos ajuda a oferecer livre acesso à 
Wikipédia em lugares onde os altos preços dos dados móveis poderiam impedir que 
as pessoas usassem a internet. Ela nos ajuda a prestar apoio àqueles que estão 
digitalizando conhecimentos atualmente limitados a arquivos analógicos. E ela 
protege a Wikipédia de ameaças ao livre conhecimento e à internet aberta.
 
@@ -34,7 +34,7 @@
 Katherine Maher
 Diretora executiva, Fundação Wikimedia
 
-Muitos empregadores podem generosamente coincidir com a contribuição dos 
seus funcionários; confirma com seu empregador para saber se sua empresa tem 
esse programa https://wikimediafoundation.org/wiki/Matching_Gifts/form;>programa de 
doações. Para os seus registos: A sua doação, número {{ transaction_id }}, 
em {{ receive_date }} foi de {{ (currency ~ " " ~ amount) | 
l10n_currency(locale) }}.
+Muitos empregadores podem generosamente coincidir com a contribuição dos 
seus funcionários; confirme com seu patrão para saber se sua empresa tem um https://wikimediafoundation.org/wiki/Matching_Gifts/form;>programa de 
doações. Para os seus registos: A sua doação, número {{ transaction_id }}, 
em {{ receive_date }} foi de {{ (currency ~ " " ~ amount) | 
l10n_currency(locale) }}.
 
 {% if recurring %}
 Esta doação é parte de uma doação recorrente. Serão debitados pela Fundação 
Wikimedia pagamentos mensais até que nos notifique a fim de parar. Se desejar 
cancelar os pagamentos, por favor veja nossas instruções em 

[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-21124 fix overlong cacheKey when deduping by criteria

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/374677 )

Change subject: CRM-21124 fix overlong cacheKey when deduping by criteria
..


CRM-21124 fix overlong cacheKey when deduping by criteria

Bug: T151270

Change-Id: If085edcf7ef1a6c684d3ca73db410765252f5ce1
---
M CRM/Dedupe/Merger.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Ejegg: Looks good to me, approved



diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php
index df93c93..2c59e88 100644
--- a/CRM/Dedupe/Merger.php
+++ b/CRM/Dedupe/Merger.php
@@ -1928,7 +1928,7 @@
 $cacheKeyString = "merge {$contactType}";
 $cacheKeyString .= $rule_group_id ? "_{$rule_group_id}" : '_0';
 $cacheKeyString .= $group_id ? "_{$group_id}" : '_0';
-$cacheKeyString .= !empty($criteria) ? serialize($criteria) : '_0';
+$cacheKeyString .= !empty($criteria) ? md5(serialize($criteria)) : '_0';
 if ($checkPermissions) {
   $contactID = CRM_Core_Session::getLoggedInContactID();
   if (!$contactID) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If085edcf7ef1a6c684d3ca73db410765252f5ce1
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Eileen 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Mepps 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: read-html: strip reference list contents

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362442 )

Change subject: read-html: strip reference list contents
..


read-html: strip reference list contents

This looks for 'ol[typeof=\'mw:Extension/references\']' and removes
all child nodes from it, then replacing them with a placeholder
.

Bug: T167921
Change-Id: I4ac73ca29cede1dff4f557f902122b37bc92a940
---
M lib/parsoid-access.js
A lib/transformations/stripReferenceListContent.js
M lib/transforms.js
A test/lib/transformations/strip-reference-list-test.js
4 files changed, 45 insertions(+), 0 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/parsoid-access.js b/lib/parsoid-access.js
index 70aa177..c4dc9c9 100644
--- a/lib/parsoid-access.js
+++ b/lib/parsoid-access.js
@@ -142,6 +142,7 @@
 const meta = { revision: getRevisionFromEtag(response.headers) };
 const doc = domino.createDocument(response.body);
 
+transforms.stripReferenceListContent(doc);
 transforms.stripUnneededMarkup(doc, legacy);
 parsoidSections.addSectionDivs(doc);
 
diff --git a/lib/transformations/stripReferenceListContent.js 
b/lib/transformations/stripReferenceListContent.js
new file mode 100644
index 000..b5442b1
--- /dev/null
+++ b/lib/transformations/stripReferenceListContent.js
@@ -0,0 +1,16 @@
+"use strict";
+
+/**
+ * Scan the DOM for reference lists and replace its contents with a 
placeholder div.
+ * @param {!Document} doc to scan for references
+ */
+function stripReferenceListContent(doc) {
+const refLists = 
doc.querySelectorAll('ol[typeof=\'mw:Extension/references\']');
+for (const refList of refLists) {
+const placeholder = doc.createElement('DIV');
+placeholder.classList.add('mw-references-placeholder');
+refList.parentNode.replaceChild(placeholder, refList);
+}
+}
+
+module.exports = stripReferenceListContent;
diff --git a/lib/transforms.js b/lib/transforms.js
index 3771d4e..96f04ea 100644
--- a/lib/transforms.js
+++ b/lib/transforms.js
@@ -12,6 +12,7 @@
 const hideIPA = require('./transformations/hideIPA');
 const extractHatnotes = require('./transformations/extractHatnotes');
 const markReferenceSections = 
require('./transformations/markReferenceSections');
+const stripReferenceListContent = 
require('./transformations/stripReferenceListContent');
 const relocateFirstParagraph = 
require('./transformations/relocateFirstParagraph');
 const extractInfobox = require('./transformations/extractInfobox');
 const extractPageIssues = require('./transformations/extractPageIssues');
@@ -334,6 +335,7 @@
 transforms.relocateFirstParagraph = relocateFirstParagraph;
 transforms.extractHatnotes = extractHatnotes;
 transforms.markReferenceSections = markReferenceSections;
+transforms.stripReferenceListContent = stripReferenceListContent;
 transforms.extractInfobox = extractInfobox;
 transforms.extractPageIssues = extractPageIssues;
 transforms.extractLeadIntroduction = extractLeadIntroduction;
diff --git a/test/lib/transformations/strip-reference-list-test.js 
b/test/lib/transformations/strip-reference-list-test.js
new file mode 100644
index 000..31f072d
--- /dev/null
+++ b/test/lib/transformations/strip-reference-list-test.js
@@ -0,0 +1,26 @@
+'use strict';
+
+const assert = require('../../utils/assert.js');
+const domino = require('domino');
+const transforms = require('../../../lib/transforms');
+
+describe('lib:strip reference list transform', () => {
+it('reference list contents should be replaced by placeholders', () => {
+const doc = domino.createDocument(''
++ ''
++ 'foo A1'
++ 'foo A2'
++ ''
++ ''
++ 'foo B'
++ ''
++ ''
++ ''
++ '');
+
+transforms.stripReferenceListContent(doc);
+assert.selectorExistsNTimes(doc, 'ol', 0, `expected  tags to be 
removed`);
+assert.selectorExistsNTimes(doc, 'li', 0, `expected  tags to be 
removed`);
+assert.selectorExistsNTimes(doc, 'div', 3, `expected 3  tags to 
be found`);
+});
+});

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4ac73ca29cede1dff4f557f902122b37bc92a940
Gerrit-PatchSet: 32
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: BearND 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Fjalapeno 
Gerrit-Reviewer: GWicke 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Mhurd 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mediawiki.special.changeslist.legend.js: Remove wait for doc...

2017-09-01 Thread Fomafix (Code Review)
Fomafix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375446 )

Change subject: mediawiki.special.changeslist.legend.js: Remove wait for 
document ready
..

mediawiki.special.changeslist.legend.js: Remove wait for document ready

mw.hook( 'wikipage.content' ) gets fired after document ready.

Change-Id: Ia1536e734f8ae08cc7cc07c3b1854bdaafb54866
---
M resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/46/375446/1

diff --git 
a/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js 
b/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
index a991d36..aeb15bc 100644
--- a/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
+++ b/resources/src/mediawiki.special/mediawiki.special.changeslist.legend.js
@@ -20,7 +20,5 @@
} );
};
 
-   $( function () {
-   mw.hook( 'wikipage.content' ).add( doCollapsibleLegend );
-   } );
+   mw.hook( 'wikipage.content' ).add( doCollapsibleLegend );
 }( mediaWiki, jQuery ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1536e734f8ae08cc7cc07c3b1854bdaafb54866
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Fomafix 

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


[MediaWiki-commits] [Gerrit] mediawiki...SpamBlacklist[master]: Avoid directly using EditPage::$mTitle

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375435 )

Change subject: Avoid directly using EditPage::$mTitle
..


Avoid directly using EditPage::$mTitle

And other minor cleanup

Change-Id: I551a7cae75f47cddae83646dd35a29a123b6c2b2
---
M SpamBlacklistHooks.php
1 file changed, 9 insertions(+), 8 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/SpamBlacklistHooks.php b/SpamBlacklistHooks.php
index b3e3748..c7500b0 100644
--- a/SpamBlacklistHooks.php
+++ b/SpamBlacklistHooks.php
@@ -122,23 +122,24 @@
 * Confirm that a local blacklist page being saved is valid,
 * and toss back a warning to the user if it isn't.
 *
-* @param $editPage EditPage
-* @param $text string
-* @param $section string
-* @param $hookError string
+* @param EditPage $editPage
+* @param string $text
+* @param string $section
+* @param string $hookError
 * @return bool
 */
-   static function validate( $editPage, $text, $section, &$hookError ) {
-   $thisPageName = $editPage->mTitle->getPrefixedDBkey();
+   static function validate( EditPage $editPage, $text, $section, 
&$hookError ) {
+   $title = $editPage->getTitle();
+   $thisPageName = $title->getPrefixedDBkey();
 
-   if ( !BaseBlacklist::isLocalSource( $editPage->mTitle ) ) {
+   if ( !BaseBlacklist::isLocalSource( $title ) ) {
wfDebugLog( 'SpamBlacklist',
"Spam blacklist validator: [[$thisPageName]] 
not a local blacklist\n"
);
return true;
}
 
-   $type = BaseBlacklist::getTypeFromTitle( $editPage->mTitle );
+   $type = BaseBlacklist::getTypeFromTitle( $title );
if ( $type === false ) {
return true;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I551a7cae75f47cddae83646dd35a29a123b6c2b2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SpamBlacklist
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...WikiEditor[master]: Add some type hints

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375443 )

Change subject: Add some type hints
..


Add some type hints

And avoid an unncessary getContext() function call.

Change-Id: I845c43098a580ffc2cc6ee2b33d11fb010eabe9c
---
M WikiEditor.hooks.php
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/WikiEditor.hooks.php b/WikiEditor.hooks.php
index af7821d..0ba259f 100644
--- a/WikiEditor.hooks.php
+++ b/WikiEditor.hooks.php
@@ -163,7 +163,7 @@
 * @param OutputPage $outputPage object.
 * @return bool
 */
-   public static function editPageShowEditFormInitial( $editPage, 
$outputPage ) {
+   public static function editPageShowEditFormInitial( EditPage $editPage, 
OutputPage $outputPage ) {
if ( $editPage->contentModel !== CONTENT_MODEL_WIKITEXT ) {
return true;
}
@@ -219,12 +219,12 @@
 * @param OutputPage $outputPage object.
 * @return bool
 */
-   public static function editPageShowEditFormFields( $editPage, 
$outputPage ) {
+   public static function editPageShowEditFormFields( EditPage $editPage, 
OutputPage $outputPage ) {
if ( $editPage->contentModel !== CONTENT_MODEL_WIKITEXT ) {
return true;
}
 
-   $req = $outputPage->getContext()->getRequest();
+   $req = $outputPage->getRequest();
$editingStatsId = $req->getVal( 'editingStatsId' );
if ( !$editingStatsId || !$req->wasPosted() ) {
$editingStatsId = self::getEditingStatsId();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I845c43098a580ffc2cc6ee2b33d11fb010eabe9c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: TheDJ 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Fix fatals and redundant arguments

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375397 )

Change subject: Fix fatals and redundant arguments
..


Fix fatals and redundant arguments

Bug: T174803
Change-Id: If48dda1682fced29da3353b643286c0a09e676cf
---
M frontend/specialpages/reports/ConfiguredPages_body.php
M frontend/specialpages/reports/ReviewedPages_body.php
M frontend/specialpages/reports/StablePages_body.php
3 files changed, 9 insertions(+), 9 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/frontend/specialpages/reports/ConfiguredPages_body.php 
b/frontend/specialpages/reports/ConfiguredPages_body.php
index 89f9849..532a9ea 100644
--- a/frontend/specialpages/reports/ConfiguredPages_body.php
+++ b/frontend/specialpages/reports/ConfiguredPages_body.php
@@ -78,7 +78,7 @@
SpecialPage::getTitleFor( 'Stabilization' ),
$this->msg( 'configuredpages-config' )->text(),
[],
-   'page=' . $title->getPrefixedUrl()
+   [ 'page' => $title->getPrefixedUrl() ]
);
# Show which version is the default (stable or draft)
if ( intval( $row->fpc_override ) ) {
diff --git a/frontend/specialpages/reports/ReviewedPages_body.php 
b/frontend/specialpages/reports/ReviewedPages_body.php
index ce91ab3..6d2fb08 100644
--- a/frontend/specialpages/reports/ReviewedPages_body.php
+++ b/frontend/specialpages/reports/ReviewedPages_body.php
@@ -101,7 +101,7 @@
SpecialPage::getTitleFor( 'ReviewedVersions' ),
$this->msg( 'reviewedpages-all' )->text(),
[],
-   'page=' . $title->getPrefixedUrl()
+   [ 'page' => $title->getPrefixedUrl() ]
);
# Link to highest tier rev
$best = '';
@@ -110,7 +110,7 @@
$title,
$this->msg( 'reviewedpages-best' )->text(),
[],
-   'stableid=best'
+   [ 'stableid' => 'best' ]
);
$best = " [$best]";
}
diff --git a/frontend/specialpages/reports/StablePages_body.php 
b/frontend/specialpages/reports/StablePages_body.php
index 909479c..48f48af 100644
--- a/frontend/specialpages/reports/StablePages_body.php
+++ b/frontend/specialpages/reports/StablePages_body.php
@@ -72,18 +72,18 @@
$link = $linkRenderer->makeLink( $title );
// Helpful utility links
$utilLinks = [];
-   $utilLinks[] = $linkRenderer->makeLink(
+   $utilLinks[] = $linkRenderer->makeKnownLink(
$title,
$this->msg( 'stablepages-config' )->text(),
-   [], [ 'action' => 'protect' ], 'known' );
-   $utilLinks[] = $linkRenderer->makeLink(
+   [], [ 'action' => 'protect' ] );
+   $utilLinks[] = $linkRenderer->makeKnownLink(
$title,
$this->msg( 'history' )->text(),
-   [], [ 'action' => 'history' ], 'known' );
-   $utilLinks[] = $linkRenderer->makeLink(
+   [], [ 'action' => 'history' ] );
+   $utilLinks[] = $linkRenderer->makeKnownLink(
SpecialPage::getTitleFor( 'Log', 'stable' ),
$this->msg( 'stable-logpage' )->text(),
-   [], [ 'page' => $title->getPrefixedText() ], 'known' );
+   [], [ 'page' => $title->getPrefixedText() ] );
// Autoreview/review restriction level
$restr = '';
if ( $row->fpc_level != '' ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If48dda1682fced29da3353b643286c0a09e676cf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: add wmf employee dmaza to admin module

2017-09-01 Thread RobH (Code Review)
RobH has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375445 )

Change subject: add wmf employee dmaza to admin module
..


add wmf employee dmaza to admin module

user is goign to be flagged with wmf group after addition to module

Bug: T174828
Change-Id: I5f580a8e1d3184cdcb04068b054bd5c3bd0324fc
---
M modules/admin/data/data.yaml
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  jenkins-bot: Verified
  RobH: Looks good to me, approved



diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 632b524..1f46288 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -2742,3 +2742,7 @@
 ensure: present
 realname: Sam Wilson
 email: swil...@wikimedia.org
+  dmaza:
+ensure: present
+realname: Dayllan Maza
+email: dm...@wikimedia.org

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5f580a8e1d3184cdcb04068b054bd5c3bd0324fc
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: RobH 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Muehlenhoff 
Gerrit-Reviewer: RobH 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: add wmf employee dmaza to admin module

2017-09-01 Thread RobH (Code Review)
RobH has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375445 )

Change subject: add wmf employee dmaza to admin module
..

add wmf employee dmaza to admin module

user is goign to be flagged with wmf group after addition to module

Bug: T174828
Change-Id: I5f580a8e1d3184cdcb04068b054bd5c3bd0324fc
---
M modules/admin/data/data.yaml
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/45/375445/1

diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 632b524..1f46288 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -2742,3 +2742,7 @@
 ensure: present
 realname: Sam Wilson
 email: swil...@wikimedia.org
+  dmaza:
+ensure: present
+realname: Dayllan Maza
+email: dm...@wikimedia.org

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f580a8e1d3184cdcb04068b054bd5c3bd0324fc
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: RobH 

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


[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: [WIP] Introduce extension.json

2017-09-01 Thread Pmiazga (Code Review)
Pmiazga has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375444 )

Change subject: [WIP] Introduce extension.json
..

[WIP] Introduce extension.json

Changes:
 - Moved all necessary config options from Collection.php to
 extension.json file

Change-Id: I96dea0f8987ccefdf357d631be407d92c7309239
---
M Collection.php
A extension.json
2 files changed, 214 insertions(+), 222 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection 
refs/changes/44/375444/1

diff --git a/Collection.php b/Collection.php
index 9f95178..41589a7 100644
--- a/Collection.php
+++ b/Collection.php
@@ -21,233 +21,18 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-# Not a valid entry point, skip unless MEDIAWIKI is defined
-if ( !defined( 'MEDIAWIKI' ) ) {
-   echo << __FILE__,
-   'name' => 'Collection',
-   'version' => '1.7.0',
-   'author' => [ 'PediaPress GmbH', 'Siebrand Mazeland', 'Marcin Cieślak' 
],
-   'url' => 'https://www.mediawiki.org/wiki/Extension:Collection',
-   'descriptionmsg' => 'coll-desc',
-   'license-name' => 'GPL-2.0+',
-];
-
-# 
==
-
-# Configuration:
-
-/** URL of mw-serve render server */
-$wgCollectionMWServeURL = 'https://tools.pediapress.com/mw-serve/';
-
-/** Login credentials to this MediaWiki as 'USERNAME:PASSWORD' string */
-$wgCollectionMWServeCredentials = null;
-
-/** PEM-encoded SSL certificate for the mw-serve render server to pass to CURL 
*/
-$wgCollectionMWServeCert = null;
-
-/** Array of namespaces that can be added to a collection */
-$wgCollectionArticleNamespaces = [
-   NS_MAIN,
-   NS_TALK,
-   NS_USER,
-   NS_USER_TALK,
-   NS_PROJECT,
-   NS_PROJECT_TALK,
-   NS_MEDIAWIKI,
-   NS_MEDIAWIKI_TALK,
-   100,
-   101,
-   102,
-   103,
-   104,
-   105,
-   106,
-   107,
-   108,
-   109,
-   110,
-   111,
-];
-
-/** Namespace for "community books" */
-$wgCommunityCollectionNamespace = NS_PROJECT;
-
-/** Maximum no. of articles in a book */
-$wgCollectionMaxArticles = 500;
-
-/** Name of license */
-$wgCollectionLicenseName = null;
-
-/** HTTP(s) URL pointing to license in wikitext format: */
-$wgCollectionLicenseURL = null;
-
-/** List of available download formats,
-   as mapping of mwlib writer to format name */
-$wgCollectionFormats = [
-   'rl' => 'PDF',
-];
-
-/** Additional renderer options for collections. Format is as for
- * HTMLForm::loadInputFromParameters. Note that fieldnames may only contain
- * [a-zA-Z0-9_-], and values may not contain pipes or newlines. If the
- * 'options' field is an array, keys will be interpreted as messages.
- */
-$wgCollectionRendererSettings = [
-   'papersize' => [
-   'type' => 'select',
-   'label-message' => 'coll-setting-papersize',
-   'default' => 'a4',
-   'options' => [
-   'coll-setting-papersize-a4' => 'a4',
-   'coll-setting-papersize-letter' => 'letter',
-   ],
-   ],
-   'toc' => [
-   'type' => 'select',
-   'label-message' => 'coll-setting-toc',
-   'default' => 'auto',
-   'options' => [
-   'coll-setting-toc-auto' => 'auto',
-   'coll-setting-toc-yes' => 'yes',
-   'coll-setting-toc-no' => 'no',
-   ]
-   ],
-   'columns' => [
-   'type' => 'select',
-   'label-message' => 'coll-setting-columns',
-   'default' => '2',
-   'options' => [
-   'coll-setting-columns-1' => '1',
-   'coll-setting-columns-2' => '2',
-   ],
-   ],
-];
-
-/** Some commands require an external server
- */
-$wgCollectionCommandToServeURL = [];
-
-/** For formats which rendering depends on an external server
-*/
-$wgCollectionFormatToServeURL = [];
-
-$wgCollectionContentTypeToFilename = [
-   'application/pdf' => 'collection.pdf',
-   'application/vnd.oasis.opendocument.text' => 'collection.odt',
-   'text/plain' => 'collection.txt',
-];
-
-$wgCollectionPortletFormats = [ 'rl' ];
-
-$wgCollectionPortletForLoggedInUsersOnly = false;
-
-$wgCollectionMaxSuggestions = 10;
-
-$wgCollectionSuggestCheapWeightThreshhold = 50;
-
-$wgCollectionSuggestThreshhold = 100;
-
-$wgCollectionPODPartners = [
-   'pediapress' => [
-   'name' => 'PediaPress',
-   'url' => 'https://pediapress.com/',
-   'posturl' => 'https://pediapress.com/api/collections/',
-   'infopagetitle' => 'coll-order_info_article',
-   ],
-];
-
-# Optional notes that are displayed on the download screen for the rendered
-# document. Each entry is a message key.

[MediaWiki-commits] [Gerrit] mediawiki...WikiEditor[master]: Add some type hints

2017-09-01 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375443 )

Change subject: Add some type hints
..

Add some type hints

And avoid an unncessary getContext() function call.

Change-Id: I845c43098a580ffc2cc6ee2b33d11fb010eabe9c
---
M WikiEditor.hooks.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor 
refs/changes/43/375443/1

diff --git a/WikiEditor.hooks.php b/WikiEditor.hooks.php
index af7821d..0ba259f 100644
--- a/WikiEditor.hooks.php
+++ b/WikiEditor.hooks.php
@@ -163,7 +163,7 @@
 * @param OutputPage $outputPage object.
 * @return bool
 */
-   public static function editPageShowEditFormInitial( $editPage, 
$outputPage ) {
+   public static function editPageShowEditFormInitial( EditPage $editPage, 
OutputPage $outputPage ) {
if ( $editPage->contentModel !== CONTENT_MODEL_WIKITEXT ) {
return true;
}
@@ -219,12 +219,12 @@
 * @param OutputPage $outputPage object.
 * @return bool
 */
-   public static function editPageShowEditFormFields( $editPage, 
$outputPage ) {
+   public static function editPageShowEditFormFields( EditPage $editPage, 
OutputPage $outputPage ) {
if ( $editPage->contentModel !== CONTENT_MODEL_WIKITEXT ) {
return true;
}
 
-   $req = $outputPage->getContext()->getRequest();
+   $req = $outputPage->getRequest();
$editingStatsId = $req->getVal( 'editingStatsId' );
if ( !$editingStatsId || !$req->wasPosted() ) {
$editingStatsId = self::getEditingStatsId();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I845c43098a580ffc2cc6ee2b33d11fb010eabe9c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Notification about editing Flow topic summary

2017-09-01 Thread Etonkovidova (Code Review)
Etonkovidova has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375441 )

Change subject: Notification about editing Flow topic summary
..

Notification about editing Flow topic summary

Change-Id: I15ad0e12a825dbfb3a3c20be7a07db14e61fc2f6
---
A tests/rspec/edit_summary_spec.rb
1 file changed, 71 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/41/375441/1

diff --git a/tests/rspec/edit_summary_spec.rb b/tests/rspec/edit_summary_spec.rb
new file mode 100644
index 000..de8357d
--- /dev/null
+++ b/tests/rspec/edit_summary_spec.rb
@@ -0,0 +1,71 @@
+require 'mediawiki_api'
+
+describe 'Echo' do
+  before(:all) do
+if ENV['JENKINS_HOME']
+  # jenkins
+  @mediawiki_api = "#{ENV['MW_SERVER']}#{ENV['MW_SCRIPT_PATH']}/api.php"
+  @admin_username = 'WikiAdmin'
+  @admin_password = 'testpass'
+else
+  # mediawiki-vagrant
+  @mediawiki_api = 'http://127.0.0.1:8080/w/api.php'
+  @admin_username = 'Admin'
+  @admin_password = 'vagrant'
+end
+
+@client = MediawikiApi::Client.new @mediawiki_api
+  end
+
+  before(:each) do
+@client.log_in @admin_username, @admin_password
+
+require 'securerandom'
+@random_username = "U#{SecureRandom.hex(5)}"
+@random_password = SecureRandom.hex(5)
+  end
+
+
+  it 'should notify Admin that topic summary was edited' do
+page = 'Talk:' + SecureRandom.hex(5)
+topic = SecureRandom.hex(5)
+topic_content = SecureRandom.hex(5)
+topic_summary = SecureRandom.hex(5)
+
+# Admin creates a Flow page
+response = @client.action(
+  'flow', submodule: 'new-topic', page: page, nttopic: topic,
+  ntcontent: topic_content, ntformat: 'wikitext')
+
+# Admin adds a summary to the new topic
+  # identify a topic
+   topic_page = 
response.data['new-topic']['committed']['topiclist']['topic-page']
+
+   added_summary = @client.action('flow', submodule: 'edit-topic-summary', 
page: topic_page,
+  etssummary: topic_summary, etsformat: 'wikitext')
+
+# Admin creates a User
+@client.create_account(@random_username, @random_password)
+
+# Random user logs in
+@client.log_in @random_username, @random_password
+
+# Random user edits a summary
+summary_revision = added_summary
+  
.data['edit-topic-summary']['committed']['topicsummary']['summary-revision-id']
+
+@client.action('flow', submodule: 'edit-topic-summary', page: topic_page,
+  etsprev_revision: summary_revision,
+  etssummary: topic_summary + ' edited by ' + @random_username, etsformat: 
'wikitext')
+
+# Admin logs in and the most recent notification will 'edit-topic-summary'
+@client.log_in @admin_username, @admin_password
+notifications = @client.query(meta: 
'notifications').data['notifications']['list']
+flow_summary = notifications.last
+
+expect(flow_summary['type']).to eq 'flow-summary-edited'
+expect(flow_summary['agent']['name']).to eq @random_username
+expect(flow_summary['timestamp']['date']).to eq 'Today'
+  end
+
+end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I15ad0e12a825dbfb3a3c20be7a07db14e61fc2f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Etonkovidova 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix fling scrolling in Compilations and Reading List fragments.

2017-09-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375430 )

Change subject: Fix fling scrolling in Compilations and Reading List fragments.
..


Fix fling scrolling in Compilations and Reading List fragments.

This seems to be an issue with using a NestedScrollView alongside the
CollapsingToolbarLayout. Going forward, let's discourage the usage of
NestedScrollView in these contexts, and instead favor usage of a
non-nested RecyclerView with a height of wrap_content.

Bug: T173108
Change-Id: I05b54018204aac677839bf4932506532897714e4
---
M app/src/main/java/org/wikipedia/offline/RemoteCompilationsFragment.java
M app/src/main/java/org/wikipedia/readinglist/ReadingListFragment.java
M app/src/main/res/layout/fragment_reading_list.xml
M app/src/main/res/layout/fragment_remote_compilations.xml
4 files changed, 56 insertions(+), 66 deletions(-)

Approvals:
  jenkins-bot: Verified
  Mholloway: Looks good to me, approved



diff --git 
a/app/src/main/java/org/wikipedia/offline/RemoteCompilationsFragment.java 
b/app/src/main/java/org/wikipedia/offline/RemoteCompilationsFragment.java
index 83c6be0..a12c1be 100644
--- a/app/src/main/java/org/wikipedia/offline/RemoteCompilationsFragment.java
+++ b/app/src/main/java/org/wikipedia/offline/RemoteCompilationsFragment.java
@@ -298,7 +298,8 @@
 private class SearchCallback extends SearchActionModeCallback {
 @Override
 public boolean onCreateActionMode(ActionMode mode, Menu menu) {
-appBarLayout.setExpanded(false, true);
+recyclerView.stopScroll();
+appBarLayout.setExpanded(false, false);
 return super.onCreateActionMode(mode, menu);
 }
 
diff --git 
a/app/src/main/java/org/wikipedia/readinglist/ReadingListFragment.java 
b/app/src/main/java/org/wikipedia/readinglist/ReadingListFragment.java
index 7cabe18..43d974d 100644
--- a/app/src/main/java/org/wikipedia/readinglist/ReadingListFragment.java
+++ b/app/src/main/java/org/wikipedia/readinglist/ReadingListFragment.java
@@ -737,7 +737,8 @@
 @Override
 public boolean onCreateActionMode(ActionMode mode, Menu menu) {
 actionMode = mode;
-appBarLayout.setExpanded(false, true);
+recyclerView.stopScroll();
+appBarLayout.setExpanded(false, false);
 return super.onCreateActionMode(mode, menu);
 }
 
diff --git a/app/src/main/res/layout/fragment_reading_list.xml 
b/app/src/main/res/layout/fragment_reading_list.xml
index 3e296a2..861169f 100644
--- a/app/src/main/res/layout/fragment_reading_list.xml
+++ b/app/src/main/res/layout/fragment_reading_list.xml
@@ -42,44 +42,39 @@
 
 
 
-
 
-
+android:scrollbars="vertical"
+android:background="?attr/window_background_color"/>
 
-
+
 
-
+
 
-
-
-
-
-
+
 
 
diff --git a/app/src/main/res/layout/fragment_remote_compilations.xml 
b/app/src/main/res/layout/fragment_remote_compilations.xml
index 24a120a..15dad7f 100644
--- a/app/src/main/res/layout/fragment_remote_compilations.xml
+++ b/app/src/main/res/layout/fragment_remote_compilations.xml
@@ -68,47 +68,40 @@
 
 
 
-
 
-
+android:scrollbars="vertical"
+android:background="?attr/window_background_color"/>
 
-
+
 
-
+
 
-
+
 
-
-
-
-
-
+
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I05b54018204aac677839bf4932506532897714e4
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Cooltey 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Sharvaniharan 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...TwoColConflict[master]: tests: Return a TestingAccessWrapper always

2017-09-01 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375440 )

Change subject: tests: Return a TestingAccessWrapper always
..

tests: Return a TestingAccessWrapper always

Instead of reapeating the exact same code in every test, just do it once
in the getMockPage() function.

Change-Id: I636432061c08817bb4d833c5bc0ccf241da5cb33
---
M tests/phpunit/includes/TwoColConflictPageTest.php
1 file changed, 12 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwoColConflict 
refs/changes/40/375440/1

diff --git a/tests/phpunit/includes/TwoColConflictPageTest.php 
b/tests/phpunit/includes/TwoColConflictPageTest.php
index f055579..6f9af84 100644
--- a/tests/phpunit/includes/TwoColConflictPageTest.php
+++ b/tests/phpunit/includes/TwoColConflictPageTest.php
@@ -12,7 +12,7 @@
 * @covers TwoColConflictPageTest::getCollapsedText
 */
public function testGetCollapsedText_returnFalseWhenInLimit() {
-   $twoColConflictPageMock = TestingAccessWrapper::newFromObject( 
$this->getMockPage() );
+   $twoColConflictPageMock = $this->getMockPage();
$this->assertFalse(
$twoColConflictPageMock->getCollapsedText( 'One Two 
Three.', 14 )
);
@@ -26,7 +26,6 @@
 */
public function 
testGetCollapsedText_returnFalseWhenWhenOverLimitWithWhitespaces() {
$twoColConflictPageMock = $this->getMockPageWithContext();
-   $twoColConflictPageMock = TestingAccessWrapper::newFromObject( 
$twoColConflictPageMock );
$this->assertFalse(
$twoColConflictPageMock->getCollapsedText( "One Two 
Three.\n \n", 14 )
);
@@ -40,7 +39,6 @@
 */
public function testGetCollapsedText_cutWhenSingleLineOverLimit() {
$twoColConflictPageMock = $this->getMockPageWithContext();
-   $twoColConflictPageMock = TestingAccessWrapper::newFromObject( 
$twoColConflictPageMock );
$this->assertEquals(
'One ' .
'even.',
@@ -53,7 +51,6 @@
 */
public function testGetCollapsedText_returnFalseWhenTwoLinesInLimit() {
$twoColConflictPageMock = $this->getMockPageWithContext();
-   $twoColConflictPageMock = TestingAccessWrapper::newFromObject( 
$twoColConflictPageMock );
$this->assertFalse(
$twoColConflictPageMock->getCollapsedText( "One 
Two\nThree Four.", 25 )
);
@@ -64,7 +61,6 @@
 */
public function testGetCollapsedText_cutWhenTwoLinesOverLimit() {
$twoColConflictPageMock = $this->getMockPageWithContext();
-   $twoColConflictPageMock = TestingAccessWrapper::newFromObject( 
$twoColConflictPageMock );
$this->assertEquals(
"One\n" .
"Four.",
@@ -77,7 +73,6 @@
 */
public function testGetCollapsedText_cutWhenMultipleLinesInLimit() {
$twoColConflictPageMock = $this->getMockPageWithContext();
-   $twoColConflictPageMock = TestingAccessWrapper::newFromObject( 
$twoColConflictPageMock );
$this->assertEquals(
"One Two\n" .
"Six Seven.",
@@ -89,7 +84,7 @@
 * @covers TwoColConflictPageTest::trimStringToFullWord
 */
public function testTrimStringToFullWord_noCutWhenInLimit() {
-   $twoColConflictPageMock = TestingAccessWrapper::newFromObject( 
$this->getMockPage() );
+   $twoColConflictPageMock = $this->getMockPage();
$this->assertEquals(
'One Two Three.',
$twoColConflictPageMock->trimStringToFullWord( 'One Two 
Three.', 14 )
@@ -104,7 +99,7 @@
 * @covers TwoColConflictPageTest::trimStringToFullWord
 */
public function testTrimStringToFullWord_trimWhiteSpaceAtEndOfResult() {
-   $twoColConflictPageMock = TestingAccessWrapper::newFromObject( 
$this->getMockPage() );
+   $twoColConflictPageMock = $this->getMockPage();
$this->assertEquals(
'One Two',
$twoColConflictPageMock->trimStringToFullWord( 'One Two 
Three.', 8, true )
@@ -115,7 +110,7 @@
 * @covers TwoColConflictPageTest::trimStringToFullWord
 */
public function 
testTrimStringToFullWord_trimWhiteSpaceAtStartOfResult() {
-   $twoColConflictPageMock = TestingAccessWrapper::newFromObject( 
$this->getMockPage() );
+   $twoColConflictPageMock = $this->getMockPage();
$this->assertEquals(
'Three.',
$twoColConflictPageMock->trimStringToFullWord( 'One 
Two. And Three.', 7, 

[MediaWiki-commits] [Gerrit] mediawiki...TwoColConflict[master]: Avoid using $wgRequest

2017-09-01 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375439 )

Change subject: Avoid using $wgRequest
..

Avoid using $wgRequest

Change-Id: I967c74fa973f7d04146094586d3028641e88b8d4
---
M includes/TwoColConflictHooks.php
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwoColConflict 
refs/changes/39/375439/1

diff --git a/includes/TwoColConflictHooks.php b/includes/TwoColConflictHooks.php
index 9dcb5b8..25e13bb 100644
--- a/includes/TwoColConflictHooks.php
+++ b/includes/TwoColConflictHooks.php
@@ -42,9 +42,7 @@
 * @param Status $status
 */
public static function onAttemptSaveAfter( EditPage $editPage, Status 
$status ) {
-   global $wgRequest;
-
-   if ( !$wgRequest->getBool( 'mw-twocolconflict-submit' ) ) {
+   if ( !$editPage->getContext()->getRequest()->getBool( 
'mw-twocolconflict-submit' ) ) {
return;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I967c74fa973f7d04146094586d3028641e88b8d4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TwoColConflict
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] mediawiki...TwoColConflict[master]: Consistently use $this->context

2017-09-01 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375438 )

Change subject: Consistently use $this->context
..

Consistently use $this->context

Avoids an extra function call, and it will always be set.

Change-Id: I91aeef58546be345665ef63ac1c61521d7081723
---
M includes/TwoColConflictPage.php
1 file changed, 20 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwoColConflict 
refs/changes/38/375438/1

diff --git a/includes/TwoColConflictPage.php b/includes/TwoColConflictPage.php
index c4377ed..2dd43c7 100644
--- a/includes/TwoColConflictPage.php
+++ b/includes/TwoColConflictPage.php
@@ -26,7 +26,7 @@
 */
protected function addExplainConflictHeader( OutputPage $out ) {
// don't show conflict message when coming from VisualEditor
-   if ( $this->getContext()->getRequest()->getVal( 'veswitched' ) 
!== "1" ) {
+   if ( $this->context->getRequest()->getVal( 'veswitched' ) !== 
"1" ) {
$out->wrapWikiMsg(
"\n$1\n",
[ 'twoColConflict-explainconflict', 
$this->getSubmitButtonLabel() ]
@@ -117,16 +117,16 @@
$out = '';
$out .= '';
$out .= '' .
-   $this->getContext()->msg( 
'twoColConflict-changes-col-title' )->parse() . '';
+   $this->context->msg( 'twoColConflict-changes-col-title' 
)->parse() . '';
$out .= '';
-   $out .= $this->getContext()->msg( 
'twoColConflict-changes-col-desc-1' )->text();
+   $out .= $this->context->msg( 
'twoColConflict-changes-col-desc-1' )->text();
$out .= '';
$out .= '';
$out .= '' .
-   $this->getContext()->msg( 
'twoColConflict-changes-col-desc-2' )->text() .
+   $this->context->msg( 
'twoColConflict-changes-col-desc-2' )->text() .
'' . $this->buildEditSummary() . '';
$out .= '' .
-   $this->getContext()->msg( 
'twoColConflict-changes-col-desc-4' )->text() .
+   $this->context->msg( 
'twoColConflict-changes-col-desc-4' )->text() .
'';
$out .= '';
$out .= '';
@@ -157,11 +157,11 @@
'options' => [
[
'data' => 'show',
-   'label' => $this->getContext()->msg( 
'twoColConflict-label-show' )->text()
+   'label' => $this->context->msg( 
'twoColConflict-label-show' )->text()
],
[
'data' => 'hide',
-   'label' => $this->getContext()->msg( 
'twoColConflict-label-hide' )->text()
+   'label' => $this->context->msg( 
'twoColConflict-label-hide' )->text()
],
],
] );
@@ -175,7 +175,7 @@
 
$out .= '';
$out .= '' .
-   $this->getContext()->msg( 
'twoColConflict-label-unchanged' )->text() .
+   $this->context->msg( 'twoColConflict-label-unchanged' 
)->text() .
'';
$out .= $fieldset;
$out .= $this->buildHelpButton();
@@ -199,7 +199,7 @@
'icon' => 'help',
'framed' => false,
'name' => 'mw-twocolconflict-show-help',
-   'title' => $this->getContext()->msg( 
'twoColConflict-show-help-tooltip' )->text(),
+   'title' => $this->context->msg( 
'twoColConflict-show-help-tooltip' )->text(),
'classes' => [ 'mw-twocolconflict-show-help' ]
] );
$helpButton->setAttributes( [
@@ -267,13 +267,13 @@
 */
private function buildEditSummary() {
$currentRev = $this->getArticle()->getPage()->getRevision();
-   $baseRevId = $this->getContext()->getRequest()->getIntOrNull( 
'editRevId' );
+   $baseRevId = $this->context->getRequest()->getIntOrNull( 
'editRevId' );
$nEdits = $this->getTitle()->countRevisionsBetween( $baseRevId, 
$currentRev, 100 );
 
if ( $nEdits === 0 ) {
$out = '';
$out .= Linker::userLink( $currentRev->getUser(), 
$currentRev->getUserText() );
-   $out .= 
$this->getContext()->getLanguage()->getDirMark();
+   $out .= $this->context->getLanguage()->getDirMark();
$out .= 

  1   2   3   4   5   >