[MediaWiki-commits] [Gerrit] mediawiki...RelatedArticles[master]: Increase threshold for loading related articles in the footer

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Increase threshold for loading related articles in the footer
..


Increase threshold for loading related articles in the footer

The threshold is now 2 times the window height per Nirzar.

Bug: T144822
Change-Id: Ia72b0532e481211645364a1ed9715f6f07f28fca
---
M resources/ext.relatedArticles.readMore.bootstrap/index.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/resources/ext.relatedArticles.readMore.bootstrap/index.js 
b/resources/ext.relatedArticles.readMore.bootstrap/index.js
index e906776..2c60d21 100644
--- a/resources/ext.relatedArticles.readMore.bootstrap/index.js
+++ b/resources/ext.relatedArticles.readMore.bootstrap/index.js
@@ -22,7 +22,7 @@
 */
function loadRelatedArticles() {
var readMore = $( '.read-more-container' ).get( 0 ),
-   scrollThreshold = $window.height() * 1.5;
+   scrollThreshold = $window.height() * 2;
 
if ( mw.viewport.isElementCloseToViewport( readMore, 
scrollThreshold ) ) {
$.when(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia72b0532e481211645364a1ed9715f6f07f28fca
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/RelatedArticles
Gerrit-Branch: master
Gerrit-Owner: Bmansurov 
Gerrit-Reviewer: Phuedx 
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...UniversalLanguageSelector[master]: geoclient: Update localStorage comment

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: geoclient: Update localStorage comment
..


geoclient: Update localStorage comment

Follows-up 4cd1def.

localStorage is available by all supported browsers as of MediaWiki 1.25.
As of MediaWiki 1.27, this is also enforced by an explicit feature test
in startup.js.

Change-Id: I12b577919579f498e294376f748715b868f21869
---
M resources/js/ext.uls.geoclient.js
1 file changed, 3 insertions(+), 4 deletions(-)

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



diff --git a/resources/js/ext.uls.geoclient.js 
b/resources/js/ext.uls.geoclient.js
index 52937de..2d07cec 100644
--- a/resources/js/ext.uls.geoclient.js
+++ b/resources/js/ext.uls.geoclient.js
@@ -29,10 +29,9 @@
return;
}
 
-   // Using cache for speed and to be nice for the service. Using cookies 
over
-   // localstorage because cookies support automatic expiring and are 
supported
-   // everywhere where as localstorage might not. This cookie is not 
currently
-   // read server side.
+   // Using cache for speed and to reduce load on the third-party service.
+   // Using cookies over localStorage because cookies support automatic 
expiring.
+   // This cookie is not currently read server-side.
geo = mw.cookie.get( 'ULSGeo' );
if ( geo ) {
try {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I12b577919579f498e294376f748715b868f21869
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Nikerabbit 
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]: Avoid calling awful DatabaseBase::strictIPs() method

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Avoid calling awful DatabaseBase::strictIPs() method
..

Avoid calling awful DatabaseBase::strictIPs() method

That method should be removed since it encourages incompatibility

Change-Id: Id8a0174266bcd988c85943507f1edb3518fe087e
---
M includes/changes/RecentChange.php
M includes/db/DatabaseMssql.php
2 files changed, 2 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/92/311092/1

diff --git a/includes/changes/RecentChange.php 
b/includes/changes/RecentChange.php
index 590fd37..ac5824b 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -297,7 +297,8 @@
}
 
# If our database is strict about IP addresses, use NULL 
instead of an empty string
-   if ( $dbw->strictIPs() && $this->mAttribs['rc_ip'] == '' ) {
+   $strictIPs = in_array( $dbw->getType(), [ 'oracle', 'postgres' 
] ); // legacy
+   if ( $strictIPs && $this->mAttribs['rc_ip'] == '' ) {
unset( $this->mAttribs['rc_ip'] );
}
 
diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
index 4ffafde..4875b48 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -50,10 +50,6 @@
return false;
}
 
-   public function strictIPs() {
-   return false;
-   }
-
public function realTimestamps() {
return false;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8a0174266bcd988c85943507f1edb3518fe087e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove DB cascadingDeletes()/cleanupTriggers() methods

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Remove DB cascadingDeletes()/cleanupTriggers() methods
..

Remove DB cascadingDeletes()/cleanupTriggers() methods

These have no callers are where a mistake to begin with.
They only encouraged code forking and incompatibilities
among different backing DB types.

Change-Id: I37bef8585151e2782d2c88b5ae1e6752109c6ac7
---
M includes/db/Database.php
M includes/db/DatabaseMssql.php
M includes/db/DatabaseOracle.php
M includes/db/DatabasePostgres.php
4 files changed, 1 insertion(+), 40 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/91/311091/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index 2c8e67cd..7decc05 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -49,22 +49,6 @@
}
 
/**
-* Returns true if this database supports (and uses) cascading deletes
-*
-* @return bool
-*/
-   public function cascadingDeletes() {
-   return false;
-   }
-   /**
-* Returns true if this database supports (and uses) triggers (e.g. on 
the page table)
-*
-* @return bool
-*/
-   public function cleanupTriggers() {
-   return false;
-   }
-   /**
 * Returns true if this database is strict about what can be put into 
an IP field.
 * Specifically, it uses a NULL value instead of an empty string.
 *
diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
index 339174e..604c01a 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -42,14 +42,6 @@
 
protected $mPort;
 
-   public function cascadingDeletes() {
-   return true;
-   }
-
-   public function cleanupTriggers() {
-   return false;
-   }
-
public function strictIPs() {
return false;
}
diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php
index 9e821a1..83a24b2 100644
--- a/includes/db/DatabaseOracle.php
+++ b/includes/db/DatabaseOracle.php
@@ -176,14 +176,6 @@
return 'oracle';
}
 
-   function cascadingDeletes() {
-   return true;
-   }
-
-   function cleanupTriggers() {
-   return true;
-   }
-
function strictIPs() {
return true;
}
diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php
index 2773067..3c3a2ca 100644
--- a/includes/db/DatabasePostgres.php
+++ b/includes/db/DatabasePostgres.php
@@ -227,14 +227,6 @@
return 'postgres';
}
 
-   function cascadingDeletes() {
-   return true;
-   }
-
-   function cleanupTriggers() {
-   return true;
-   }
-
function strictIPs() {
return true;
}
@@ -247,6 +239,7 @@
return false;
}
 
+
function hasConstraint( $name ) {
$sql = "SELECT 1 FROM pg_catalog.pg_constraint c, 
pg_catalog.pg_namespace n " .
"WHERE c.connamespace = n.oid AND conname = '" .

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I37bef8585151e2782d2c88b5ae1e6752109c6ac7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid using cascadingDeletes()/cleanupTriggers()

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Avoid using cascadingDeletes()/cleanupTriggers()
..

Avoid using cascadingDeletes()/cleanupTriggers()

Simplify DB callers by just having one code path.
All but some very old code paths bothered with these.

Change-Id: Iaf7a2f83146a0ed15995f9cfc74edcf16ae5a448
---
M includes/changes/RecentChange.php
M includes/deferred/LinksDeletionUpdate.php
M includes/page/WikiPage.php
M maintenance/rebuildrecentchanges.php
4 files changed, 78 insertions(+), 85 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/90/311090/1

diff --git a/includes/changes/RecentChange.php 
b/includes/changes/RecentChange.php
index 590fd37..306ea06 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -312,7 +312,7 @@
$this->mAttribs['rc_id'] = $dbw->nextSequenceValue( 
'recentchanges_rc_id_seq' );
 
# # If we are using foreign keys, an entry of 0 for the page_id 
will fail, so use NULL
-   if ( $dbw->cascadingDeletes() && $this->mAttribs['rc_cur_id'] 
== 0 ) {
+   if ( $this->mAttribs['rc_cur_id'] == 0 ) {
unset( $this->mAttribs['rc_cur_id'] );
}
 
diff --git a/includes/deferred/LinksDeletionUpdate.php 
b/includes/deferred/LinksDeletionUpdate.php
index 4159166..93b3ef6 100644
--- a/includes/deferred/LinksDeletionUpdate.php
+++ b/includes/deferred/LinksDeletionUpdate.php
@@ -108,87 +108,81 @@
}
}
 
-   // If using cascading deletes, we can skip some explicit deletes
-   if ( !$dbw->cascadingDeletes() ) {
-   // Delete outgoing links
-   $this->batchDeleteByPK(
-   'pagelinks',
-   [ 'pl_from' => $id ],
-   [ 'pl_from', 'pl_namespace', 'pl_title' ],
-   $batchSize
-   );
-   $this->batchDeleteByPK(
-   'imagelinks',
-   [ 'il_from' => $id ],
-   [ 'il_from', 'il_to' ],
-   $batchSize
-   );
-   $this->batchDeleteByPK(
-   'categorylinks',
-   [ 'cl_from' => $id ],
-   [ 'cl_from', 'cl_to' ],
-   $batchSize
-   );
-   $this->batchDeleteByPK(
-   'templatelinks',
-   [ 'tl_from' => $id ],
-   [ 'tl_from', 'tl_namespace', 'tl_title' ],
-   $batchSize
-   );
-   $this->batchDeleteByPK(
-   'externallinks',
-   [ 'el_from' => $id ],
-   [ 'el_id' ],
-   $batchSize
-   );
-   $this->batchDeleteByPK(
-   'langlinks',
-   [ 'll_from' => $id ],
-   [ 'll_from', 'll_lang' ],
-   $batchSize
-   );
-   $this->batchDeleteByPK(
-   'iwlinks',
-   [ 'iwl_from' => $id ],
-   [ 'iwl_from', 'iwl_prefix', 'iwl_title' ],
-   $batchSize
-   );
-   // Delete any redirect entry or page props entries
-   $dbw->delete( 'redirect', [ 'rd_from' => $id ], 
__METHOD__ );
-   $dbw->delete( 'page_props', [ 'pp_page' => $id ], 
__METHOD__ );
-   }
+   $this->batchDeleteByPK(
+   'pagelinks',
+   [ 'pl_from' => $id ],
+   [ 'pl_from', 'pl_namespace', 'pl_title' ],
+   $batchSize
+   );
+   $this->batchDeleteByPK(
+   'imagelinks',
+   [ 'il_from' => $id ],
+   [ 'il_from', 'il_to' ],
+   $batchSize
+   );
+   $this->batchDeleteByPK(
+   'categorylinks',
+   [ 'cl_from' => $id ],
+   [ 'cl_from', 'cl_to' ],
+   $batchSize
+   );
+   $this->batchDeleteByPK(
+   'templatelinks',
+   [ 'tl_from' => $id ],
+   [ 'tl_from', 'tl_namespace', 'tl_title' ],
+ 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove long-since unused cruft methods from DatabaseBase

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Remove long-since unused cruft methods from DatabaseBase
..

Remove long-since unused cruft methods from DatabaseBase

Change-Id: I4b28c15a8589504bdbbe79ba0d3aed1e52dbe65b
---
M includes/db/Database.php
M includes/db/DatabaseMssql.php
M includes/db/DatabaseOracle.php
M includes/db/DatabasePostgres.php
M tests/phpunit/includes/db/DatabaseTest.php
5 files changed, 0 insertions(+), 208 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/311089/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index 4f823b5..2c8e67cd 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -49,13 +49,6 @@
}
 
/**
-* @return string Command delimiter used by this database engine
-*/
-   public function getDelimiter() {
-   return $this->delimiter;
-   }
-
-   /**
 * Returns true if this database supports (and uses) cascading deletes
 *
 * @return bool
@@ -79,138 +72,6 @@
 */
public function strictIPs() {
return false;
-   }
-
-   /**
-* Returns true if this database can do a native search on IP columns
-* e.g. this works as expected: .. WHERE rc_ip = '127.42.12.102/32';
-*
-* @return bool
-*/
-   public function searchableIPs() {
-   return false;
-   }
-
-   /**
-* Returns true if this database uses timestamps rather than integers
-*
-* @return bool
-*/
-   public function realTimestamps() {
-   return false;
-   }
-
-   /**
-* Returns true if this database can use functional indexes
-*
-* @return bool
-*/
-   public function functionalIndexes() {
-   return false;
-   }
-
-   /**
-* Intended to be compatible with the PEAR::DB wrapper functions.
-* http://pear.php.net/manual/en/package.database.db.intro-execute.php
-*
-* ? = scalar value, quoted as necessary
-* ! = raw SQL bit (a function for instance)
-* & = filename; reads the file and inserts as a blob
-* (we don't use this though...)
-*
-* @param string $sql
-* @param string $func
-*
-* @return array
-*/
-   protected function prepare( $sql, $func = __METHOD__ ) {
-   /* MySQL doesn't support prepared statements (yet), so just
-* pack up the query for reference. We'll manually replace
-* the bits later.
-*/
-   return [ 'query' => $sql, 'func' => $func ];
-   }
-
-   /**
-* Free a prepared query, generated by prepare().
-* @param string $prepared
-*/
-   protected function freePrepared( $prepared ) {
-   /* No-op by default */
-   }
-
-   /**
-* Execute a prepared query with the various arguments
-* @param string $prepared The prepared sql
-* @param mixed $args Either an array here, or put scalars as varargs
-*
-* @return ResultWrapper
-*/
-   public function execute( $prepared, $args = null ) {
-   if ( !is_array( $args ) ) {
-   # Pull the var args
-   $args = func_get_args();
-   array_shift( $args );
-   }
-
-   $sql = $this->fillPrepared( $prepared['query'], $args );
-
-   return $this->query( $sql, $prepared['func'] );
-   }
-
-   /**
-* For faking prepared SQL statements on DBs that don't support it 
directly.
-*
-* @param string $preparedQuery A 'preparable' SQL statement
-* @param array $args Array of Arguments to fill it with
-* @return string Executable SQL
-*/
-   public function fillPrepared( $preparedQuery, $args ) {
-   reset( $args );
-   $this->preparedArgs =& $args;
-
-   return preg_replace_callback( '/([?!&]|[?!&])/',
-   [ &$this, 'fillPreparedArg' ], $preparedQuery );
-   }
-
-   /**
-* preg_callback func for fillPrepared()
-* The arguments should be in $this->preparedArgs and must not be 
touched
-* while we're doing this.
-*
-* @param array $matches
-* @throws DBUnexpectedError
-* @return string
-*/
-   protected function fillPreparedArg( $matches ) {
-   switch ( $matches[1] ) {
-   case '\\?':
-   return '?';
-   case '\\!':
-   return '!';
-   case '\\&':
-   return '&';
-   

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Throttle for RCL

2016-09-15 Thread Urbanecm (Code Review)
Urbanecm has uploaded a new change for review.

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

Change subject: Throttle for RCL
..

Throttle for RCL

Bug: T145838
Change-Id: I28f9aa480108f0f89e646aa35e707acd2721ae50
---
M wmf-config/throttle.php
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/88/311088/1

diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php
index 6463f3c..f293123 100644
--- a/wmf-config/throttle.php
+++ b/wmf-config/throttle.php
@@ -55,6 +55,14 @@
'dbname' => [ 'enwiki', 'frwiki' ],
'value' => 50 //40 expected
 ];
+$wmgThrottlingExceptions[] = [
+'from' => '2016-09-21T0:00 -0:00',
+'to' => '2016-09-22T0:00 -0:00',
+'range' => [ '142.58.113.128/26', '142.58.128.0/21', 
'207.23.160.0/19', '207.23.192.0/19', '142.58.80.0/21', '142.58.160.0/21', 
'142.58.168.0/21' ],
+'dbname' => [ 'enwiki', 'frwiki', 'commonswiki' ],
+'value' => 70 // 50 expected
+];
+
 
 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # #
 # Other rules

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28f9aa480108f0f89e646aa35e707acd2721ae50
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Urbanecm 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: [throttle] Allow the same number of accounts

2016-09-15 Thread Urbanecm (Code Review)
Urbanecm has uploaded a new change for review.

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

Change subject: [throttle] Allow the same number of accounts
..

[throttle] Allow the same number of accounts

Currently two rules for one event has different numbers of accounts.
This patch could fix it.

Change-Id: I12992cbe7227050cca93068b0e13889cdf57b69b
---
M wmf-config/throttle.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/87/311087/1

diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php
index 6463f3c..0b8305a 100644
--- a/wmf-config/throttle.php
+++ b/wmf-config/throttle.php
@@ -45,7 +45,7 @@
'to' => '2016-09-21T16:00 -8:00',
'range' => [ '128.189.64.0/19', '128.189.192.0/18', '206.12.64.0/21', 
'206.87.112.0/21', '206.87.120.0/21', '206.87.128.0/19', '206.87.192.0/21', 
'206.87.208.0/21', '206.87.216.0/21', '137.82.104.0/24', '137.82.79.0/24', 
'137.82.82.128/25' ],
'dbname' => [ 'enwiki' ],
-   'value' => 60 //50 expected
+   'value' => 70 //50 expected
 ];
 
 $wmgThrottlingExceptions[] = [ // T145115 - Montréal, Concordia Library and 
McGill University

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I12992cbe7227050cca93068b0e13889cdf57b69b
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Urbanecm 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Throttling rule for RCL

2016-09-15 Thread Urbanecm (Code Review)
Urbanecm has uploaded a new change for review.

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

Change subject: Throttling rule for RCL
..

Throttling rule for RCL

Bug: T145838
Change-Id: I9c107e0778af6bad82ca85bb4cea259f72f7018e
---
M wmf-config/throttle.php
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/86/311086/1

diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php
index 6463f3c..e491226 100644
--- a/wmf-config/throttle.php
+++ b/wmf-config/throttle.php
@@ -55,6 +55,13 @@
'dbname' => [ 'enwiki', 'frwiki' ],
'value' => 50 //40 expected
 ];
+$wmgThrottlingExceptions[] = [
+   'from' => '2016-09-19T0:00 -0:00',
+   'to' => '2016-09-20T0:00 -0:00',
+   'range' => [ '142.58.113.128/26', '142.58.128.0/21', '207.23.160.0/19', 
'207.23.192.0/19', '142.58.80.0/21', '142.58.160.0/21', '142.58.168.0/21' ],
+   'dbname' => [ 'enwiki', 'frwiki', 'commonswiki' ],
+   'value' => 70 // 50 expected
+];
 
 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # #
 # Other rules

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c107e0778af6bad82ca85bb4cea259f72f7018e
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Urbanecm 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Cleanups to DatabaseMysqlBase

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Cleanups to DatabaseMysqlBase
..

Cleanups to DatabaseMysqlBase

* Avoid global methods
* Inject global variables
* Remove $wgAllDBsAreLocalhost hack

Change-Id: I54b23654def1f83518764ad697434aebfc6cef73
---
M autoload.php
M includes/DefaultSettings.php
M includes/db/DatabaseMysqlBase.php
M includes/db/loadbalancer/LBFactoryMW.php
M includes/db/loadbalancer/LBFactorySimple.php
R includes/libs/rdbms/database/DatabaseBase.php
M includes/libs/rdbms/lbfactory/LBFactory.php
7 files changed, 36 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/311084/1

diff --git a/autoload.php b/autoload.php
index eedf7b4..716e56d 100644
--- a/autoload.php
+++ b/autoload.php
@@ -317,7 +317,7 @@
'DBUnexpectedError' => __DIR__ . 
'/includes/libs/rdbms/exception/DBError.php',
'DataUpdate' => __DIR__ . '/includes/deferred/DataUpdate.php',
'Database' => __DIR__ . '/includes/libs/rdbms/database/Database.php',
-   'DatabaseBase' => __DIR__ . '/includes/db/Database.php',
+   'DatabaseBase' => __DIR__ . 
'/includes/libs/rdbms/database/DatabaseBase.php',
'DatabaseInstaller' => __DIR__ . 
'/includes/installer/DatabaseInstaller.php',
'DatabaseLag' => __DIR__ . '/maintenance/lag.php',
'DatabaseLogEntry' => __DIR__ . '/includes/logging/LogEntry.php',
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 3ab8829..135c3e5 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -1836,13 +1836,6 @@
 $wgSQLiteDataDir = '';
 
 /**
- * Make all database connections secretly go to localhost. Fool the load 
balancer
- * thinking there is an arbitrarily large cluster of servers to connect to.
- * Useful for debugging.
- */
-$wgAllDBsAreLocalhost = false;
-
-/**
  * Shared database for multiple wikis. Commonly used for storing a user table
  * for single sign-on. The server for this database must be the same as for the
  * main database.
diff --git a/includes/db/DatabaseMysqlBase.php 
b/includes/db/DatabaseMysqlBase.php
index 06511e0..46c6678 100644
--- a/includes/db/DatabaseMysqlBase.php
+++ b/includes/db/DatabaseMysqlBase.php
@@ -46,6 +46,11 @@
protected $sslCAPath;
/** @var string[]|null */
protected $sslCiphers;
+   /** @var string sql_mode value to send on connection */
+   protected $sqlMode;
+   /** @var bool Use experimental UTF-8 transmission encoding */
+   protected $utf8Mode;
+
/** @var string|null */
private $serverVersion = null;
 
@@ -82,6 +87,8 @@
$this->$var = $params[$var];
}
}
+   $this->sqlMode = isset( $params['sqlMode'] ) ? 
$params['sqlMode'] : '';
+   $this->utf8Mode = !empty( $params['utf8Mode'] );
}
 
/**
@@ -100,13 +107,9 @@
 * @return bool
 */
function open( $server, $user, $password, $dbName ) {
-   global $wgAllDBsAreLocalhost, $wgSQLMode;
-
# Close/unset connection handle
$this->close();
 
-   # Debugging hack -- fake cluster
-   $realServer = $wgAllDBsAreLocalhost ? 'localhost' : $server;
$this->mServer = $server;
$this->mUser = $user;
$this->mPassword = $password;
@@ -114,7 +117,7 @@
 
$this->installErrorHandler();
try {
-   $this->mConn = $this->mysqlConnect( $realServer );
+   $this->mConn = $this->mysqlConnect( $this->mServer );
} catch ( Exception $ex ) {
$this->restoreErrorHandler();
throw $ex;
@@ -126,14 +129,14 @@
if ( !$error ) {
$error = $this->lastError();
}
-   wfLogDBError(
+   $this->queryLogger->error(
"Error connecting to {db_server}: {error}",
$this->getLogContext( [
'method' => __METHOD__,
'error' => $error,
] )
);
-   wfDebug( "DB connection error\n" .
+   $this->queryLogger->debug( "DB connection error\n" .
"Server: $server, User: $user, Password: " .
substr( $password, 0, 3 ) . "..., error: " . 
$error . "\n" );
 
@@ -145,14 +148,14 @@
$success = $this->selectDB( $dbName );
MediaWiki\restoreWarnings();
if ( !$success ) {
- 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move mysql database classes to /libs/rdbms

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Move mysql database classes to /libs/rdbms
..

Move mysql database classes to /libs/rdbms

Change-Id: I1ba1799deec10e5a8ab8829b69e0708626e723e2
---
M autoload.php
R includes/libs/rdbms/database/DatabaseMysql.php
R includes/libs/rdbms/database/DatabaseMysqlBase.php
R includes/libs/rdbms/database/DatabaseMysqli.php
4 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/311085/1

diff --git a/autoload.php b/autoload.php
index 716e56d..8325c45 100644
--- a/autoload.php
+++ b/autoload.php
@@ -322,9 +322,9 @@
'DatabaseLag' => __DIR__ . '/maintenance/lag.php',
'DatabaseLogEntry' => __DIR__ . '/includes/logging/LogEntry.php',
'DatabaseMssql' => __DIR__ . '/includes/db/DatabaseMssql.php',
-   'DatabaseMysql' => __DIR__ . '/includes/db/DatabaseMysql.php',
-   'DatabaseMysqlBase' => __DIR__ . '/includes/db/DatabaseMysqlBase.php',
-   'DatabaseMysqli' => __DIR__ . '/includes/db/DatabaseMysqli.php',
+   'DatabaseMysql' => __DIR__ . 
'/includes/libs/rdbms/database/DatabaseMysql.php',
+   'DatabaseMysqlBase' => __DIR__ . 
'/includes/libs/rdbms/database/DatabaseMysqlBase.php',
+   'DatabaseMysqli' => __DIR__ . 
'/includes/libs/rdbms/database/DatabaseMysqli.php',
'DatabaseOracle' => __DIR__ . '/includes/db/DatabaseOracle.php',
'DatabasePostgres' => __DIR__ . '/includes/db/DatabasePostgres.php',
'DatabaseSqlite' => __DIR__ . '/includes/db/DatabaseSqlite.php',
diff --git a/includes/db/DatabaseMysql.php 
b/includes/libs/rdbms/database/DatabaseMysql.php
similarity index 100%
rename from includes/db/DatabaseMysql.php
rename to includes/libs/rdbms/database/DatabaseMysql.php
diff --git a/includes/db/DatabaseMysqlBase.php 
b/includes/libs/rdbms/database/DatabaseMysqlBase.php
similarity index 100%
rename from includes/db/DatabaseMysqlBase.php
rename to includes/libs/rdbms/database/DatabaseMysqlBase.php
diff --git a/includes/db/DatabaseMysqli.php 
b/includes/libs/rdbms/database/DatabaseMysqli.php
similarity index 100%
rename from includes/db/DatabaseMysqli.php
rename to includes/libs/rdbms/database/DatabaseMysqli.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ba1799deec10e5a8ab8829b69e0708626e723e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Split out ConvertableTimestamp class

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Split out ConvertableTimestamp class
..


Split out ConvertableTimestamp class

* Make TimestampException a regular exception.
* Make DatabaseBase use ConvertableTimestamp.

Change-Id: I849737c9c187e8e0c6e080887ec0656e034f80d2
---
M autoload.php
M includes/GlobalFunctions.php
M includes/MWTimestamp.php
M includes/db/Database.php
D includes/exception/TimestampException.php
A includes/libs/time/ConvertableTimestamp.php
A includes/libs/time/TimestampException.php
A includes/libs/time/defines.php
M tests/phpunit/includes/MWTimestampTest.php
A tests/phpunit/includes/libs/time/ConvertableTimestampTest.php
10 files changed, 454 insertions(+), 416 deletions(-)

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



diff --git a/autoload.php b/autoload.php
index 96c8190..8fc621a 100644
--- a/autoload.php
+++ b/autoload.php
@@ -280,6 +280,7 @@
'ConvertExtensionToRegistration' => __DIR__ . 
'/maintenance/convertExtensionToRegistration.php',
'ConvertLinks' => __DIR__ . '/maintenance/convertLinks.php',
'ConvertUserOptions' => __DIR__ . '/maintenance/convertUserOptions.php',
+   'ConvertableTimestamp' => __DIR__ . 
'/includes/libs/time/ConvertableTimestamp.php',
'ConverterRule' => __DIR__ . '/languages/ConverterRule.php',
'Cookie' => __DIR__ . '/includes/libs/Cookie.php',
'CookieJar' => __DIR__ . '/includes/libs/CookieJar.php',
@@ -1410,7 +1411,7 @@
'ThumbnailRenderJob' => __DIR__ . 
'/includes/jobqueue/jobs/ThumbnailRenderJob.php',
'TidyUpBug37714' => __DIR__ . '/maintenance/tidyUpBug37714.php',
'TiffHandler' => __DIR__ . '/includes/media/Tiff.php',
-   'TimestampException' => __DIR__ . 
'/includes/exception/TimestampException.php',
+   'TimestampException' => __DIR__ . 
'/includes/libs/time/TimestampException.php',
'Timing' => __DIR__ . '/includes/libs/Timing.php',
'Title' => __DIR__ . '/includes/Title.php',
'TitleArray' => __DIR__ . '/includes/TitleArray.php',
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 0e59653..90bba53 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1992,56 +1992,7 @@
 
 # Autodetect, convert and provide timestamps of various types
 
-/**
- * Unix time - the number of seconds since 1970-01-01 00:00:00 UTC
- */
-define( 'TS_UNIX', 0 );
-
-/**
- * MediaWiki concatenated string timestamp (MMDDHHMMSS)
- */
-define( 'TS_MW', 1 );
-
-/**
- * MySQL DATETIME (-MM-DD HH:MM:SS)
- */
-define( 'TS_DB', 2 );
-
-/**
- * RFC 2822 format, for E-mail and HTTP headers
- */
-define( 'TS_RFC2822', 3 );
-
-/**
- * ISO 8601 format with no timezone: 1986-02-09T20:00:00Z
- *
- * This is used by Special:Export
- */
-define( 'TS_ISO_8601', 4 );
-
-/**
- * An Exif timestamp (:MM:DD HH:MM:SS)
- *
- * @see http://exif.org/Exif2-2.PDF The Exif 2.2 spec, see page 28 for the
- *   DateTime tag and page 36 for the DateTimeOriginal and
- *   DateTimeDigitized tags.
- */
-define( 'TS_EXIF', 5 );
-
-/**
- * Oracle format time.
- */
-define( 'TS_ORACLE', 6 );
-
-/**
- * Postgres format time.
- */
-define( 'TS_POSTGRES', 7 );
-
-/**
- * ISO 8601 basic format with no timezone: 19860209T20Z.  This is used by 
ResourceLoader
- */
-define( 'TS_ISO_8601_BASIC', 9 );
+require_once __DIR__ . '/libs/time/defines.php';
 
 /**
  * Get a timestamp string in one of various formats
diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php
index defdc96..201e9b6 100644
--- a/includes/MWTimestamp.php
+++ b/includes/MWTimestamp.php
@@ -28,171 +28,15 @@
  *
  * @since 1.20
  */
-class MWTimestamp {
+class MWTimestamp extends ConvertableTimestamp {
/**
-* Standard gmdate() formats for the different timestamp types.
+* Get a timestamp instance in GMT
+*
+* @param bool|string $ts Timestamp to set, or false for current time
+* @return MWTimestamp The instance
 */
-   private static $formats = [
-   TS_UNIX => 'U',
-   TS_MW => 'YmdHis',
-   TS_DB => 'Y-m-d H:i:s',
-   TS_ISO_8601 => 'Y-m-d\TH:i:s\Z',
-   TS_ISO_8601_BASIC => 'Ymd\THis\Z',
-   TS_EXIF => 'Y:m:d H:i:s', // This shouldn't ever be used, but 
is included for completeness
-   TS_RFC2822 => 'D, d M Y H:i:s',
-   TS_ORACLE => 'd-m-Y H:i:s.00', // Was 'd-M-y h.i.s A' . ' 
+00:00' before r51500
-   TS_POSTGRES => 'Y-m-d H:i:s',
-   ];
-
-   /**
-* The actual timestamp being wrapped (DateTime object).
-* @var DateTime
-*/
-   public $timestamp;
-
-   /**
-* Make a new timestamp and set it to the specified time,
-* or the current time if unspecified.
-*
-* @since 1.20
-*
-* @param 

[MediaWiki-commits] [Gerrit] mediawiki...ArticleRatings[master]: Modernize the extension, ditch PHP entry point and i18n file

2016-09-15 Thread Legoktm (Code Review)
Legoktm has submitted this change and it was merged.

Change subject: Modernize the extension, ditch PHP entry point and i18n file
..


Modernize the extension, ditch PHP entry point and i18n file

Bug: T145313
Change-Id: Icf23981a5e40a3fb155c0efbc2378c94a51edcc6
---
D ArticleRatings.php
M ArticleRatingsHooks.php
M RatingDataClass.php
D RatingTag.php
M SpecialChangeRating.php
A extension.json
A i18n/en.json
A i18n/vi.json
8 files changed, 234 insertions(+), 175 deletions(-)

Approvals:
  Legoktm: Verified
  SamanthaNguyen: Looks good to me, approved



diff --git a/ArticleRatings.php b/ArticleRatings.php
deleted file mode 100644
index 77af34f..000
--- a/ArticleRatings.php
+++ /dev/null
@@ -1,74 +0,0 @@
-https://www.mediawiki.org/wiki/Extension:ArticleRatings Documentation
- */
-
-# Not an entry point
-if ( !defined( 'MEDIAWIKI' ) ) {
-   die( 'This file is a MediaWiki extension, it is not a valid entry 
point' );
-}
-
-# Load classes
-$wgAutoloadClasses['RatingData'] = __DIR__ . '/RatingDataClass.php';
-$wgAutoloadClasses['Rating'] = __DIR__ . '/RatingDataClass.php';
-
-# Load hooks
-$wgAutoloadClasses['AreHooks'] = __DIR__ . '/ArticleRatingsHooks.php';
-$wgHooks['BaseTemplateToolbox'][] = 'AreHooks::onBaseTemplateToolbox';
-$wgHooks['TitleMove'][] = 'AreHooks::onTitleMove';
-$wgHooks['ParserFirstCallInit'][] = 'wfRatingParserInit';
-$wgHooks['LoadExtensionSchemaUpdates'][] = 
'AreHooks::onLoadExtensionSchemaUpdates';
-$wgHooks['ArticleDeleteComplete'][] = 'AreHooks::onArticleDeleteComplete';
-
-include( __DIR__ . '/RatingTag.php' );
-
-function wfRatingParserInit( Parser $parser ) {
-   $parser->setHook( 'rating', 'wfRatingRender' );
-   return true;
-}
-
-# Credits
-$wgExtensionCredits['other'][] = array(
-   'path' => __FILE__,
-   'name' => 'ArticleRating',
-   'version' => '2.4.0',
-   'author' => 'UltrasonicNXT/Adam Carter',
-   'url' => 'https://www.mediawiki.org/wiki/Extension:ArticleRatings',
-   'descriptionmsg' => 'ratings-desc',
-);
-
-# Group the special pages under the correct headers in Special:SpecialPages
-$wgSpecialPageGroups['ChangeRating'] = 'other';
-$wgSpecialPageGroups['MassRatings'] = 'other';
-
-# Set up Special:ChangeRating
-$wgAutoloadClasses['SpecialChangeRating'] = __DIR__ . 
'/SpecialChangeRating.php';
-$wgSpecialPages['ChangeRating'] = 'SpecialChangeRating';
-
-# Set up Special:MassRatings
-$wgAutoloadClasses['SpecialMassRatings'] = __DIR__ . '/SpecialMassRatings.php';
-$wgSpecialPages['MassRatings'] = 'SpecialMassRatings';
-
-# i18n
-$wgExtensionMessagesFiles['ArticleRatings'] = __DIR__ . 
'/ArticleRatings.i18n.php';
-$wgExtensionMessagesFiles['ArticleRatingsAlias'] = __DIR__ . 
'/ArticleRatings.alias.php';
-
-# Logs
-$wgLogTypes[] = 'ratings';
-$wgLogActionsHandlers['ratings/*'] = 'LogFormatter';
-
-# New user right
-$wgAvailableRights[] = 'change-rating';
-
-# TODO FIXME:
-# this definition needs to be moved to Brickimedia's config file(s)
-$wgGroupPermissions['reviewer']['change-rating'] = true;
-
-# vars
-$wgAREUseInitialRatings = false;
-$wgARENamespaces = $wgContentNamespaces;
diff --git a/ArticleRatingsHooks.php b/ArticleRatingsHooks.php
index 7e1a0ca..b2bb183 100644
--- a/ArticleRatingsHooks.php
+++ b/ArticleRatingsHooks.php
@@ -1,12 +1,137 @@
  tag with the Parser.
+*
+* @param Parser $parser
+* @return bool
+*/
+   public static function onParserFirstCallInit( Parser $parser ) {
+   $parser->setHook( 'rating', array( __CLASS__, 'renderRating' ) 
);
+   return true;
+   }
+
+   /**
+* Callback for the above function.
+*
+* @param mixed $input User-supplied input [unused]
+* @param array $args Arguments for the tag ()
+* @param Parser $parser
+* @param PPFrame $frame
+* @return string
+*/
+   public static function renderRating( $input, array $args, Parser 
$parser, PPFrame $frame ) {
+   global $wgAREUseInitialRatings, $wgARENamespaces;
+
+   $out = '';
+
+   if ( isset( $args['page'] ) && $args['page'] ) {
+   $page = $parser->recursiveTagParse( $args['page'], 
$frame ); // parse variables like {{{1}}}
+
+   $title = Title::newFromText( $page );
+
+   if ( $title && $title->exists() ) {
+   $out .= '';
+   } else {
+   return wfMessage( 'are-no-such-page', $page 
)->parse();
+   }
+
+   if ( $title->isRedirect() ) { // follow redirects
+   $wikipage = WikiPage::factory( $title );
+   $content = $wikipage->getContent( 
Revision::FOR_PUBLIC );
+   $title = $content->getUltimateRedirectTarget();
+   }
+
+  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Stub out DatabaseBase::getSearchEngine() as a dummy method

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Stub out DatabaseBase::getSearchEngine() as a dummy method
..

Stub out DatabaseBase::getSearchEngine() as a dummy method

Change-Id: I984b80815633a8dc38a76d7de8a46ec249ae729f
SearchEngineFactory::getSearchEngineClass() should be used instead
---
M includes/db/Database.php
M includes/db/DatabaseMssql.php
M includes/db/DatabaseMysqlBase.php
M includes/db/DatabaseOracle.php
M includes/db/DatabasePostgres.php
M includes/db/DatabaseSqlite.php
6 files changed, 1 insertion(+), 35 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/82/311082/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index a2d6e3c..53444df 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -3619,10 +3619,8 @@
}
 
/**
-* Get search engine class. All subclasses of this need to implement 
this
-* if they wish to use searching.
-*
 * @return string
+* @deprecated since 1.27; use 
SearchEngineFactory::getSearchEngineClass()
 */
public function getSearchEngine() {
return 'SearchEngineDummy';
diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
index 4ffafde..21323fa 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -1266,13 +1266,6 @@
}
 
/**
-* @return string
-*/
-   public function getSearchEngine() {
-   return "SearchMssql";
-   }
-
-   /**
 * Returns an associative array for fields that are of type varbinary, 
binary, or image
 * $table can be either a raw table name or passed through tableName() 
first
 * @param string $table
diff --git a/includes/db/DatabaseMysqlBase.php 
b/includes/db/DatabaseMysqlBase.php
index f8737a8..d302000 100644
--- a/includes/db/DatabaseMysqlBase.php
+++ b/includes/db/DatabaseMysqlBase.php
@@ -1057,16 +1057,6 @@
}
 
/**
-* Get search engine class. All subclasses of this
-* need to implement this if they wish to use searching.
-*
-* @return string
-*/
-   public function getSearchEngine() {
-   return 'SearchMySQL';
-   }
-
-   /**
 * @param bool $value
 */
public function setBigSelects( $value = true ) {
diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php
index df311aa..4ad8e6d 100644
--- a/includes/db/DatabaseOracle.php
+++ b/includes/db/DatabaseOracle.php
@@ -1517,10 +1517,6 @@
return 'CAST ( ' . $field . ' AS VARCHAR2 )';
}
 
-   public function getSearchEngine() {
-   return 'SearchOracle';
-   }
-
public function getInfinity() {
return '31-12-2030 12:00:00.00';
}
diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php
index 590e1f4..783ba04 100644
--- a/includes/db/DatabasePostgres.php
+++ b/includes/db/DatabasePostgres.php
@@ -1545,10 +1545,6 @@
return $field . '::text';
}
 
-   public function getSearchEngine() {
-   return 'SearchPostgres';
-   }
-
public function streamStatementEnd( &$sql, &$newLine ) {
# Allow dollar quoting for function declarations
if ( substr( $newLine, 0, 4 ) == '$mw$' ) {
diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php
index 0cbb496..8b5ba28 100644
--- a/includes/db/DatabaseSqlite.php
+++ b/includes/db/DatabaseSqlite.php
@@ -841,13 +841,6 @@
}
 
/**
-* @return string
-*/
-   public function getSearchEngine() {
-   return "SearchSqlite";
-   }
-
-   /**
 * No-op version of deadlockLoop
 *
 * @return mixed

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I984b80815633a8dc38a76d7de8a46ec249ae729f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add SearchEngineFactory::getSearchEngineClass() instead of u...

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Add SearchEngineFactory::getSearchEngineClass() instead of 
using the DB
..

Add SearchEngineFactory::getSearchEngineClass() instead of using the DB

Change-Id: I46207cafec737cb830adc2bdf1b501a0d138b40d
---
M includes/search/SearchEngineFactory.php
1 file changed, 23 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/81/311081/1

diff --git a/includes/search/SearchEngineFactory.php 
b/includes/search/SearchEngineFactory.php
index e30869e..a767bc3 100644
--- a/includes/search/SearchEngineFactory.php
+++ b/includes/search/SearchEngineFactory.php
@@ -5,7 +5,6 @@
  * Allows to create engine of the specific type.
  */
 class SearchEngineFactory {
-
/**
 * Configuration for SearchEngine classes.
 * @var SearchEngineConfig
@@ -33,10 +32,32 @@
$class = $configType;
} else {
$dbr = wfGetDB( DB_REPLICA );
-   $class = $dbr->getSearchEngine();
+   $class = self::getSearchEngineClass( $dbr );
}
 
$search = new $class( $dbr );
return $search;
}
+
+   /**
+* @param IDatabase $db
+* @return string SearchEngine subclass name
+* @since 1.28
+*/
+   public static function getSearchEngineClass( IDatabase $db ) {
+   switch ( $db->getType() ) {
+   case 'sqlite':
+   return 'SearchSqlite';
+   case 'mysql':
+   return 'SearchMySQL';
+   case 'postgres':
+   return 'SearchPostgres';
+   case 'mssql':
+   return 'SearchMssql';
+   case 'oracle':
+   return 'SearchOracle';
+   default:
+   return 'SearchEngineDummy';
+   }
+   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46207cafec737cb830adc2bdf1b501a0d138b40d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix $wgFileCache DB outage fallback

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix $wgFileCache DB outage fallback
..


Fix $wgFileCache DB outage fallback

Change-Id: I5c41b4669ca29d119de5c08a2c61dbadae7cf55c
---
M includes/MediaWiki.php
M includes/cache/HTMLFileCache.php
M includes/exception/MWExceptionRenderer.php
3 files changed, 56 insertions(+), 21 deletions(-)

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



diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 2aa4b80..2fce08c 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -528,6 +528,24 @@
$e->report(); // display the GUI error
}
} catch ( Exception $e ) {
+   $context = $this->context;
+   if (
+   $e instanceof DBConnectionError &&
+   $context->hasTitle() &&
+   $context->getTitle()->canExist() &&
+   $context->getRequest()->getVal( 'action', 
'view' ) === 'view' &&
+   HTMLFileCache::useFileCache( $this->context, 
HTMLFileCache::MODE_OUTAGE )
+   ) {
+   // Try to use any (even stale) file during 
outages...
+   $cache = new HTMLFileCache( 
$context->getTitle(), 'view' );
+   if ( $cache->isCached() ) {
+   $cache->loadFromFileCache( $context, 
HTMLFileCache::MODE_OUTAGE );
+   print MWExceptionRenderer::getHTML( $e 
);
+   exit;
+   }
+
+   }
+
MWExceptionHandler::handleException( $e );
}
 
@@ -819,24 +837,22 @@
}
}
 
-   if ( $this->config->get( 'UseFileCache' ) && 
$title->getNamespace() >= 0 ) {
-   if ( HTMLFileCache::useFileCache( $this->context ) ) {
-   // Try low-level file cache hit
-   $cache = new HTMLFileCache( $title, $action );
-   if ( $cache->isCacheGood( /* Assume up to date 
*/ ) ) {
-   // Check incoming headers to see if 
client has this cached
-   $timestamp = $cache->cacheTimestamp();
-   if ( !$output->checkLastModified( 
$timestamp ) ) {
-   $cache->loadFromFileCache( 
$this->context );
-   }
-   // Do any stats increment/watchlist 
stuff
-   // Assume we're viewing the latest 
revision (this should always be the case with file cache)
-   
$this->context->getWikiPage()->doViewUpdates( $this->context->getUser() );
-   // Tell OutputPage that output is taken 
care of
-   $output->disable();
-
-   return;
+   if ( $title->canExist() && HTMLFileCache::useFileCache( 
$this->context ) ) {
+   // Try low-level file cache hit
+   $cache = new HTMLFileCache( $title, $action );
+   if ( $cache->isCacheGood( /* Assume up to date */ ) ) {
+   // Check incoming headers to see if client has 
this cached
+   $timestamp = $cache->cacheTimestamp();
+   if ( !$output->checkLastModified( $timestamp ) 
) {
+   $cache->loadFromFileCache( 
$this->context );
}
+   // Do any stats increment/watchlist stuff, 
assuming user is viewing the
+   // latest revision (which should always be the 
case for file cache)
+   $this->context->getWikiPage()->doViewUpdates( 
$this->context->getUser() );
+   // Tell OutputPage that output is taken care of
+   $output->disable();
+
+   return;
}
}
 
diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php
index 1bab0f5..52ae279 100644
--- a/includes/cache/HTMLFileCache.php
+++ b/includes/cache/HTMLFileCache.php
@@ -29,6 +29,9 @@
  * @ingroup Cache
  */
 class HTMLFileCache extends FileCacheBase {
+   const MODE_NORMAL = 0; // normal cache mode
+   const MODE_OUTAGE = 1; // fallback cache for DB outages
+
/**
 * Construct an 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move LBFactoryMulti to /libs/rdbms

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Move LBFactoryMulti to /libs/rdbms
..

Move LBFactoryMulti to /libs/rdbms

Change-Id: I2a30f42721715c56f5cddf9f07c10e8de70addd1
---
M autoload.php
R includes/libs/rdbms/lbfactory/LBFactoryMulti.php
2 files changed, 29 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/80/311080/1

diff --git a/autoload.php b/autoload.php
index 3fbe3c3..a2c5af6 100644
--- a/autoload.php
+++ b/autoload.php
@@ -657,7 +657,7 @@
'KuConverter' => __DIR__ . '/languages/classes/LanguageKu.php',
'LBFactory' => __DIR__ . '/includes/libs/rdbms/lbfactory/LBFactory.php',
'LBFactoryMW' => __DIR__ . '/includes/db/loadbalancer/LBFactoryMW.php',
-   'LBFactoryMulti' => __DIR__ . 
'/includes/db/loadbalancer/LBFactoryMulti.php',
+   'LBFactoryMulti' => __DIR__ . 
'/includes/libs/rdbms/lbfactory/LBFactoryMulti.php',
'LBFactorySimple' => __DIR__ . 
'/includes/libs/rdbms/lbfactory/LBFactorySimple.php',
'LBFactorySingle' => __DIR__ . 
'/includes/db/loadbalancer/LBFactorySingle.php',
'LCStore' => __DIR__ . '/includes/cache/localisation/LCStore.php',
diff --git a/includes/db/loadbalancer/LBFactoryMulti.php 
b/includes/libs/rdbms/lbfactory/LBFactoryMulti.php
similarity index 89%
rename from includes/db/loadbalancer/LBFactoryMulti.php
rename to includes/libs/rdbms/lbfactory/LBFactoryMulti.php
index 1f7f528..a6d98e0 100644
--- a/includes/db/loadbalancer/LBFactoryMulti.php
+++ b/includes/libs/rdbms/lbfactory/LBFactoryMulti.php
@@ -83,7 +83,7 @@
  *
  * @ingroup Database
  */
-class LBFactoryMulti extends LBFactoryMW {
+class LBFactoryMulti extends LBFactory {
/** @var array A map of database names to section names */
private $sectionsByDB;
 
@@ -94,9 +94,8 @@
private $sectionLoads;
 
/**
-* @var array A server info associative array as documented for
-* $wgDBservers. The host, hostName and load entries will be
-* overridden
+* @var array[] Server info associative array
+* @note The host, hostName and load entries will be overridden
 */
private $serverTemplate;
 
@@ -178,7 +177,7 @@
 
foreach ( $required as $key ) {
if ( !isset( $conf[$key] ) ) {
-   throw new InvalidArgumentException( __CLASS__ . 
": $key is required in configuration" );
+   throw new InvalidArgumentException( __CLASS__ . 
": $key is required." );
}
$this->$key = $conf[$key];
}
@@ -191,32 +190,32 @@
}
 
/**
-* @param bool|string $wiki
+* @param bool|string $domain
 * @return string
 */
-   private function getSectionForWiki( $wiki = false ) {
-   if ( $this->lastWiki === $wiki ) {
+   private function getSectionForWiki( $domain = false ) {
+   if ( $this->lastWiki === $domain ) {
return $this->lastSection;
}
-   list( $dbName, ) = $this->getDBNameAndPrefix( $wiki );
+   list( $dbName, ) = $this->getDBNameAndPrefix( $domain );
if ( isset( $this->sectionsByDB[$dbName] ) ) {
$section = $this->sectionsByDB[$dbName];
} else {
$section = 'DEFAULT';
}
$this->lastSection = $section;
-   $this->lastWiki = $wiki;
+   $this->lastWiki = $domain;
 
return $section;
}
 
/**
-* @param bool|string $wiki
+* @param bool|string $domain
 * @return LoadBalancer
 */
-   public function newMainLB( $wiki = false ) {
-   list( $dbName, ) = $this->getDBNameAndPrefix( $wiki );
-   $section = $this->getSectionForWiki( $wiki );
+   public function newMainLB( $domain = false ) {
+   list( $dbName, ) = $this->getDBNameAndPrefix( $domain );
+   $section = $this->getSectionForWiki( $domain );
if ( isset( $this->groupLoadsByDB[$dbName] ) ) {
$groupLoads = $this->groupLoadsByDB[$dbName];
} else {
@@ -224,7 +223,8 @@
}
 
if ( isset( $this->groupLoadsBySection[$section] ) ) {
-   $groupLoads = array_merge_recursive( $groupLoads, 
$this->groupLoadsBySection[$section] );
+   $groupLoads = array_merge_recursive(
+   $groupLoads, 
$this->groupLoadsBySection[$section] );
}
 
$readOnlyReason = $this->readOnlyReason;
@@ -247,13 +247,13 @@
}
 
/**
-* @param bool|string $wiki
+* @param 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: salt: add Icinga plugin to check for unaccepted keys

2016-09-15 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: salt: add Icinga plugin to check for unaccepted keys
..

salt: add Icinga plugin to check for unaccepted keys

Add a simple Icinga plugin script to check for unaccepted
salt keys and install it on the master via the salt module.

Bug: T144801
Change-Id: If15055ca58673b12dfa0f64f214fece7335d1085
---
A modules/salt/files/check_unaccepted_keys
M modules/salt/manifests/master.pp
2 files changed, 29 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/79/311079/1

diff --git a/modules/salt/files/check_unaccepted_keys 
b/modules/salt/files/check_unaccepted_keys
new file mode 100755
index 000..afde985
--- /dev/null
+++ b/modules/salt/files/check_unaccepted_keys
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Icinga plugin to check for unaccepted salt keys (T144801)
+# Daniel Zahn - Wikimedia Foundation Inc.
+
+num_keys=$(sudo /usr/bin/salt-key -l un | wc -l)
+let num_keys=num_keys-1
+
+# echo "There are ${num_keys} unaccepted keys"
+
+if [[ $num_keys -gt 0 ]] ; then
+echo "CRITICAL- ${num_keys} unaccepted salt keys"
+exit 2
+elif [[ $num_keys -eq 0 ]] ; then
+echo "OK- No unaccepted salt keys"
+exit 0
+fi
+
+echo "UNKOWN- check plugin script"
+exit 3
+
diff --git a/modules/salt/manifests/master.pp b/modules/salt/manifests/master.pp
index c3d0e25..251bc3b 100644
--- a/modules/salt/manifests/master.pp
+++ b/modules/salt/manifests/master.pp
@@ -89,5 +89,14 @@
 group  => 'root',
 }
 
+# Icinga plugin to check for unaccepted keys (T144801)
+file { '/usr/local/lib/nagios/plugins/check_unaccepted_keys':
+ensure => present,
+mode   => '0550',
+owner  => 'root',
+group  => 'root',
+source => 'puppet:///modules/salt/check_unaccepted_keys',
+}
+
 include salt::orchestration
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CategoryTree[master]: Simplify a message about JavaScript requirement

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Simplify a message about JavaScript requirement
..


Simplify a message about JavaScript requirement

CategoryTree was one of the first extensions to use AJAX,
but today AJAX is so common that it doesn't need special mention.

Change-Id: I2c326b1334cf8d08a843c6db1ef6b6eec7d44469
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 362af12..b4d0184 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -8,7 +8,7 @@
"categorytree-portlet": "Categories",
"categorytree-legend": "Show category tree",
"categorytree-desc": "Dynamically navigate the 
[[Special:CategoryTree|category structure]]",
-   "categorytree-header": "Enter a category name to see its contents as a 
tree structure.\nNote that this requires advanced JavaScript functionality 
known as AJAX.\nIf you have a very old browser, or have JavaScript disabled, it 
will not work.",
+   "categorytree-header": "Enter a category name to see its contents as a 
tree structure. (Requires JavaScript.)",
"categorytree-category": "Category:",
"categorytree-go": "Show tree",
"categorytree-parents": "Parents",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2c326b1334cf8d08a843c6db1ef6b6eec7d44469
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CategoryTree
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Legoktm 
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...CategoryTree[master]: Fix indentation of i18n/en.json

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix indentation of i18n/en.json
..


Fix indentation of i18n/en.json

Change-Id: I6a119163a2cf050d09819861a26b6902ce607145
---
M i18n/en.json
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index b4d0184..74aa7d1 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -37,7 +37,7 @@
"categorytree-not-found": "Category $1 not found",
"categorytree-error": "Problem loading data.",
"categorytree-retry": "Please wait a moment and try again.",
-"apihelp-categorytree-description": "Internal module for the CategoryTree 
extension.",
-"apihelp-categorytree-param-category": "Title in the category namespace, 
prefix will be ignored if given.",
-"apihelp-categorytree-param-options": "Options for the CategoryTree 
constructor as a JSON object. The depth option defaults to 
1."
+   "apihelp-categorytree-description": "Internal module for the 
CategoryTree extension.",
+   "apihelp-categorytree-param-category": "Title in the category 
namespace, prefix will be ignored if given.",
+   "apihelp-categorytree-param-options": "Options for the CategoryTree 
constructor as a JSON object. The depth option defaults to 
1."
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6a119163a2cf050d09819861a26b6902ce607145
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CategoryTree
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 
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]: Fix indentation of i18n/en.json

2016-09-15 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Fix indentation of i18n/en.json
..

Fix indentation of i18n/en.json

Change-Id: I6a119163a2cf050d09819861a26b6902ce607145
---
M i18n/en.json
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index b4d0184..74aa7d1 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -37,7 +37,7 @@
"categorytree-not-found": "Category $1 not found",
"categorytree-error": "Problem loading data.",
"categorytree-retry": "Please wait a moment and try again.",
-"apihelp-categorytree-description": "Internal module for the CategoryTree 
extension.",
-"apihelp-categorytree-param-category": "Title in the category namespace, 
prefix will be ignored if given.",
-"apihelp-categorytree-param-options": "Options for the CategoryTree 
constructor as a JSON object. The depth option defaults to 
1."
+   "apihelp-categorytree-description": "Internal module for the 
CategoryTree extension.",
+   "apihelp-categorytree-param-category": "Title in the category 
namespace, prefix will be ignored if given.",
+   "apihelp-categorytree-param-options": "Options for the CategoryTree 
constructor as a JSON object. The depth option defaults to 
1."
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a119163a2cf050d09819861a26b6902ce607145
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CategoryTree
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/core[master]: Rephrase tooltip-rollback for clarity

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Rephrase tooltip-rollback for clarity
..


Rephrase tooltip-rollback for clarity

This wording is already use in the English Wikipedia,
and it's indeed clearer, so it should be in core.

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

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



diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index cc7466b..c650205 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -2761,7 +2761,7 @@
"tooltip-watchlistedit-raw-submit": "Update watchlist",
"tooltip-recreate": "Recreate the page even though it has been deleted",
"tooltip-upload": "Start upload",
-   "tooltip-rollback": "\"Rollback\" reverts edit(s) to this page of the 
last contributor in one click",
+   "tooltip-rollback": "\"Rollback\" reverts the last contributor's 
edit(s) to this page in one click",
"tooltip-undo": "\"Undo\" reverts this edit and opens the edit form in 
preview mode. It allows adding a reason in the summary.",
"tooltip-preferences-save": "Save preferences",
"tooltip-summary": "Enter a short summary",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifce5a15e33c98e9c40b338f388ace54e50594ec8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Legoktm 
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]: API: Force straight join for prop=linkshere|transcludedin|fi...

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: API: Force straight join for 
prop=linkshere|transcludedin|fileusage
..


API: Force straight join for prop=linkshere|transcludedin|fileusage

MySQL (or at least 5.5.5-10.0.23-MariaDB) chooses a really bad query plan if it
thinks there will be more matching rows in the linktable than are in page. Use
STRAIGHT_JOIN here to force it to use the intended, fast plan. See T145079 for
details.

Bug: T145079
Change-Id: I1a363450b818a049938145d0feb207c9894d2a49
---
M includes/api/ApiQueryBacklinksprop.php
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Jcrespo: Looks good to me, but someone else must approve
  Legoktm: Looks good to me, approved
  Mobrovac: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/api/ApiQueryBacklinksprop.php 
b/includes/api/ApiQueryBacklinksprop.php
index 236fb9e..8e89c32 100644
--- a/includes/api/ApiQueryBacklinksprop.php
+++ b/includes/api/ApiQueryBacklinksprop.php
@@ -264,6 +264,12 @@
}
}
 
+   // MySQL (or at least 5.5.5-10.0.23-MariaDB) chooses a really 
bad query
+   // plan if it thinks there will be more matching rows in the 
linktable
+   // than are in page. Use STRAIGHT_JOIN here to force it to use 
the
+   // intended, fast plan. See T145079 for details.
+   $this->addOption( 'STRAIGHT_JOIN' );
+
$this->addOption( 'LIMIT', $params['limit'] + 1 );
 
$res = $this->select( __METHOD__ );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a363450b818a049938145d0feb207c9894d2a49
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Mobrovac 
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...Scribunto[master]: Specify license and add COPYING file

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Specify license and add COPYING file
..


Specify license and add COPYING file

Bug: T123943
Bug: T128586
Change-Id: I5cb16829bb8a4debe4b0e6ca7d891a0c98591f9a
---
A COPYING
M Scribunto.php
M composer.json
3 files changed, 378 insertions(+), 1 deletion(-)

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



diff --git a/COPYING b/COPYING
new file mode 100644
index 000..3eca345
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,376 @@
+The majority of Scribunto is licensed under the GNU General Public License,
+version 2 or later. The text of this license is included below.
+
+Some included files and subdirectories are licensed with an MIT license, not
+with the GPL. These are:
+
+* engines/LuaCommon/lualib/package.lua (as described in that file)
+* engines/LuaCommon/lualib/luabit/ (as described in readme.txt in that 
directory)
+* engines/LuaCommon/lualib/ustring/ (as described in README in that directory)
+* engines/LuaStandalone/binaries/ (as described in README in that directory)
+
+The text of this license is also included below.
+
+--
+
+GNU GENERAL PUBLIC LICENSE
+   Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make DB snapshot commit errors include active methods

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Make DB snapshot commit errors include active methods
..


Make DB snapshot commit errors include active methods

Change-Id: I59e501528b104e797b36103fa18792f539d92a14
---
M includes/db/Database.php
1 file changed, 28 insertions(+), 14 deletions(-)

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



diff --git a/includes/db/Database.php b/includes/db/Database.php
index 6cfff0e..3374d67 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -618,6 +618,25 @@
return $this->mTrxLevel ? $this->mTrxWriteCallers : [];
}
 
+   protected function pendingWriteAndCallbackCallers() {
+   if ( !$this->mTrxLevel ) {
+   return [];
+   }
+
+   $fnames = $this->mTrxWriteCallers;
+   foreach ( [
+   $this->mTrxIdleCallbacks,
+   $this->mTrxPreCommitCallbacks,
+   $this->mTrxEndCallbacks
+   ] as $callbacks ) {
+   foreach ( $callbacks as $callback ) {
+   $fnames[] = $callback[1];
+   }
+   }
+
+   return $fnames;
+   }
+
public function isOpen() {
return $this->mOpened;
}
@@ -3042,9 +3061,10 @@
public function flushSnapshot( $fname = __METHOD__ ) {
if ( $this->writesOrCallbacksPending() || 
$this->explicitTrxActive() ) {
// This only flushes transactions to clear snapshots, 
not to write data
+   $fnames = implode( ', ', 
$this->pendingWriteAndCallbackCallers() );
throw new DBUnexpectedError(
$this,
-   "$fname: Cannot COMMIT to clear snapshot 
because writes are pending."
+   "$fname: Cannot COMMIT to clear snapshot 
because writes are pending ($fnames)."
);
}
 
@@ -3511,9 +3531,10 @@
public function getScopedLockAndFlush( $lockKey, $fname, $timeout ) {
if ( $this->writesOrCallbacksPending() ) {
// This only flushes transactions to clear snapshots, 
not to write data
+   $fnames = implode( ', ', 
$this->pendingWriteAndCallbackCallers() );
throw new DBUnexpectedError(
$this,
-   "$fname: Cannot COMMIT to clear snapshot 
because writes are pending."
+   "$fname: Cannot COMMIT to clear snapshot 
because writes are pending ($fnames)."
);
}
 
@@ -3650,18 +3671,11 @@
if ( $this->mTrxLevel && $this->mTrxDoneWrites ) {
trigger_error( "Uncommitted DB writes (transaction from 
{$this->mTrxFname})." );
}
-   $danglingCallbacks = array_merge(
-   $this->mTrxIdleCallbacks,
-   $this->mTrxPreCommitCallbacks,
-   $this->mTrxEndCallbacks
-   );
-   if ( $danglingCallbacks ) {
-   $callers = [];
-   foreach ( $danglingCallbacks as $callbackInfo ) {
-   $callers[] = $callbackInfo[1];
-   }
-   $callers = implode( ', ', $callers );
-   trigger_error( "DB transaction callbacks still pending 
(from $callers)." );
+
+   $danglingWriters = $this->pendingWriteAndCallbackCallers();
+   if ( $danglingWriters ) {
+   $fnames = implode( ', ', $danglingWriters );
+   trigger_error( "DB transaction writes or callbacks 
still pending ($fnames)." );
}
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I59e501528b104e797b36103fa18792f539d92a14
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Parent5446 
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.user: Minor clean up of code and unit tests

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: mediawiki.user: Minor clean up of code and unit tests
..


mediawiki.user: Minor clean up of code and unit tests

* Clarify getRegistration() return documentation and minor
  optimisation of code order.

* Fix typo in test name for getUserInfo().

* Remove redundant test expect numbers.
  Follows-up 7c363752ed.

* Separate getter assertions for anonymous and logged-in.
  Avoid changing the fixture mid-test. Let setup/teardown
  clean up in the middle.

Change-Id: If777d44a571ac590e91ed84060ea714df67f8f2f
---
M resources/src/mediawiki/mediawiki.user.js
M tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js
2 files changed, 20 insertions(+), 23 deletions(-)

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



diff --git a/resources/src/mediawiki/mediawiki.user.js 
b/resources/src/mediawiki/mediawiki.user.js
index 7df778f..52a1efb 100644
--- a/resources/src/mediawiki/mediawiki.user.js
+++ b/resources/src/mediawiki/mediawiki.user.js
@@ -104,20 +104,17 @@
/**
 * Get date user registered, if available
 *
-* @return {Date|boolean|null} Date user registered, or false 
for anonymous users, or
-*  null when data is not available
+* @return {boolean|null|Date} False for anonymous users, null 
if data is
+*  unavailable, or Date for when the user registered.
 */
getRegistration: function () {
-   var registration = mw.config.get( 'wgUserRegistration' 
);
if ( mw.user.isAnon() ) {
return false;
}
-   if ( registration === null ) {
-   // Information may not be available if they 
signed up before
-   // MW began storing this.
-   return null;
-   }
-   return new Date( registration );
+   var registration = mw.config.get( 'wgUserRegistration' 
);
+   // Registration may be unavailable if the user signed 
up before MediaWiki
+   // began tracking this.
+   return !registration ? null : new Date( registration );
},
 
/**
diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js
index 3332c08..5122dcd 100644
--- a/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js
+++ b/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js
@@ -15,32 +15,32 @@
}
} ) );
 
-   QUnit.test( 'options', 1, function ( assert ) {
+   QUnit.test( 'options', function ( assert ) {
assert.ok( mw.user.options instanceof mw.Map, 'options instance 
of mw.Map' );
} );
 
-   QUnit.test( 'user status', 7, function ( assert ) {
-
+   QUnit.test( 'getters (anonymous)', function ( assert ) {
// Forge an anonymous user
mw.config.set( 'wgUserName', null );
delete mw.config.values.wgUserId;
 
-   assert.strictEqual( mw.user.getName(), null, 'user.getName() 
returns null when anonymous' );
-   assert.assertTrue( mw.user.isAnon(), 'user.isAnon() returns 
true when anonymous' );
-   assert.strictEqual( mw.user.getId(), 0, 'user.getId() returns 0 
when anonymous' );
+   assert.strictEqual( mw.user.getName(), null, 'getName()' );
+   assert.strictEqual( mw.user.isAnon(), true, 'isAnon()' );
+   assert.strictEqual( mw.user.getId(), 0, 'getId()' );
+   } );
 
-   // Not part of startUp module
+   QUnit.test( 'getters (logged-in)', function ( assert ) {
mw.config.set( 'wgUserName', 'John' );
mw.config.set( 'wgUserId', 123 );
 
-   assert.equal( mw.user.getName(), 'John', 'user.getName() 
returns username when logged-in' );
-   assert.assertFalse( mw.user.isAnon(), 'user.isAnon() returns 
false when logged-in' );
-   assert.strictEqual( mw.user.getId(), 123, 'user.getId() returns 
correct ID when logged-in' );
+   assert.equal( mw.user.getName(), 'John', 'getName()' );
+   assert.strictEqual( mw.user.isAnon(), false, 'isAnon()' );
+   assert.strictEqual( mw.user.getId(), 123, 'getId()' );
 
-   assert.equal( mw.user.id(), 'John', 'user.id Returns username 
when logged-in' );
+   assert.equal( mw.user.id(), 'John', 'user.id()' );
} );
 
-   QUnit.test( 'getUserInfos', 3, function ( assert ) {
+   QUnit.test( 'getUserInfo', function ( assert ) {

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid global state in DatabaseBase::factory()/query()

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Avoid global state in DatabaseBase::factory()/query()
..


Avoid global state in DatabaseBase::factory()/query()

Change-Id: Ibb4f1c0dafea071a1c34e0cd5b5c15b8b4bb7bc6
---
M includes/MediaWiki.php
M includes/db/Database.php
M includes/db/loadbalancer/LBFactoryMW.php
M includes/libs/rdbms/lbfactory/LBFactory.php
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
M maintenance/Maintenance.php
M maintenance/doMaintenance.php
7 files changed, 69 insertions(+), 25 deletions(-)

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



diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 9bbbd35..2aa4b80 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -517,6 +517,7 @@
 */
public function run() {
try {
+   $this->setDBProfilingAgent();
try {
$this->main();
} catch ( ErrorPageError $e ) {
@@ -533,6 +534,15 @@
$this->doPostOutputShutdown( 'normal' );
}
 
+   private function setDBProfilingAgent() {
+   $services = MediaWikiServices::getInstance();
+   // Add a comment for easy SHOW PROCESSLIST interpretation
+   $name = $this->context->getUser()->getName();
+   $services->getDBLoadBalancerFactory()->setAgentName(
+   mb_strlen( $name ) > 15 ? mb_substr( $name, 0, 15 ) . 
'...' : $name
+   );
+   }
+
/**
 * @see MediaWiki::preOutputCommit()
 * @param callable $postCommitWork [default: null]
diff --git a/includes/db/Database.php b/includes/db/Database.php
index 3fa1335..232bd38 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -62,8 +62,10 @@
protected $mDBname;
/** @var array[] $aliases Map of (table => (dbname, schema, prefix) 
map) */
protected $tableAliases = [];
-   /** @var bool */
+   /** @var bool Whether this PHP instance is for a CLI script */
protected $cliMode;
+   /** @var string Agent name for query profiling */
+   protected $agent;
 
/** @var BagOStuff APC cache */
protected $srvCache;
@@ -251,6 +253,9 @@
$this->cliMode = isset( $params['cliMode'] )
? $params['cliMode']
: ( PHP_SAPI === 'cli' );
+   $this->agent = isset( $params['agent'] )
+   ? str_replace( '/', '-', $params['agent'] ) // escape 
for comment
+   : '';
 
$this->mFlags = $flags;
if ( $this->mFlags & DBO_DEFAULT ) {
@@ -308,8 +313,6 @@
 * @throws InvalidArgumentException If the database driver or extension 
cannot be found
 */
final public static function factory( $dbType, $p = [] ) {
-   global $wgCommandLineMode;
-
$canonicalDBTypes = [
'mysql' => [ 'mysqli', 'mysql' ],
'postgres' => [],
@@ -367,7 +370,6 @@
$p['schema'] = isset( $defaultSchemas[$dbType] 
) ? $defaultSchemas[$dbType] : null;
}
$p['foreign'] = isset( $p['foreign'] ) ? $p['foreign'] 
: false;
-   $p['cliMode'] = $wgCommandLineMode;
 
$conn = new $class( $p );
if ( isset( $p['connLogger'] ) ) {
@@ -379,7 +381,9 @@
if ( isset( $p['errorLogger'] ) ) {
$conn->errorLogger = $p['errorLogger'];
} else {
-   $conn->errorLogger = [ 
MWExceptionHandler::class, 'logException' ];
+   $conn->errorLogger = function ( Exception $e ) {
+   trigger_error( get_class( $e ) . ': ' . 
$e->getMessage(), E_WARNING );
+   };
}
} else {
$conn = null;
@@ -831,8 +835,6 @@
}
 
public function query( $sql, $fname = __METHOD__, $tempIgnore = false ) 
{
-   global $wgUser;
-
$priorWritesPending = $this->writesOrCallbacksPending();
$this->mLastQuery = $sql;
 
@@ -846,20 +848,9 @@
$this->mDoneWrites = microtime( true );
}
 
-   # Add a comment for easy SHOW PROCESSLIST interpretation
-   if ( is_object( $wgUser ) && $wgUser->isItemLoaded( 'name' ) ) {
-   $userName = $wgUser->getName();
-   if ( mb_strlen( $userName ) > 15 ) {
-   $userName = mb_substr( $userName, 0, 15 ) . 
'...';
-   }
-  

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Avoid RequestContext::getMain()

2016-09-15 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Avoid RequestContext::getMain()
..

Avoid RequestContext::getMain()

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


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

diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index c52b934..ae26d9a 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -309,7 +309,7 @@
$editTab['text'] = $skin->msg( 
$editTabMessage )->text();
}
 
-   $editor = self::getUserEditor( $user, 
RequestContext::getMain()->getRequest() );
+   $editor = self::getUserEditor( $user, 
$skin->getRequest() );
if (
$isAvailable &&
$config->get( 
'VisualEditorUseSingleEditTab' ) &&

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7802ad88ec7a86d2323f3c582cadf8d80d53ab7d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
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/core[master]: Add RemoteWikiPage interface

2016-09-15 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Add RemoteWikiPage interface
..

Add RemoteWikiPage interface

This is one of the first steps to implementing shadow namespaces -
creating a generic interface for representing remote content. This
allows us to no-longer special case WikiFilePage in SkinTemplate when
building content_navigation, and will let GlobalUserPage to add similar
tabs just by implementing the same interface.

There is a note on the RemoteWikiPage interface that it is woefully
incomplete and more will be added to it in the future.

Change-Id: Ib3d7dcbefe95da351872e63f306799eef83e00a7
---
M autoload.php
A includes/page/RemoteWikiPage.php
M includes/page/WikiFilePage.php
M includes/skins/SkinTemplate.php
4 files changed, 69 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/75/311075/1

diff --git a/autoload.php b/autoload.php
index 9fd83eb..fa85a0c 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1143,6 +1143,7 @@
'RefreshLinks' => __DIR__ . '/maintenance/refreshLinks.php',
'RefreshLinksJob' => __DIR__ . 
'/includes/jobqueue/jobs/RefreshLinksJob.php',
'RegexlikeReplacer' => __DIR__ . 
'/includes/libs/replacers/RegexlikeReplacer.php',
+   'RemoteWikiPage' => __DIR__ . '/includes/page/RemoteWikiPage.php',
'RemoveInvalidEmails' => __DIR__ . 
'/maintenance/removeInvalidEmails.php',
'RemoveUnusedAccounts' => __DIR__ . 
'/maintenance/removeUnusedAccounts.php',
'RenameDbPrefix' => __DIR__ . '/maintenance/renameDbPrefix.php',
diff --git a/includes/page/RemoteWikiPage.php b/includes/page/RemoteWikiPage.php
new file mode 100644
index 000..2700dad
--- /dev/null
+++ b/includes/page/RemoteWikiPage.php
@@ -0,0 +1,43 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * Interface for WikiPage when the content might come from a remote wiki
+ *
+ * @note This interface is incomplete and will be added to over time
+ * @since 1.28
+ */
+interface RemoteWikiPage {
+
+   /**
+* Get a name that identifies the remote wiki
+* the content comes from for display
+*
+* @return string
+*/
+   public function getRemoteWikiDisplayName();
+
+   /**
+* URL to view the content on the remote wiki
+*
+* @return string
+*/
+   public function getRemoteURL();
+}
diff --git a/includes/page/WikiFilePage.php b/includes/page/WikiFilePage.php
index c478550..81731e1 100644
--- a/includes/page/WikiFilePage.php
+++ b/includes/page/WikiFilePage.php
@@ -25,7 +25,7 @@
  *
  * @ingroup Media
  */
-class WikiFilePage extends WikiPage {
+class WikiFilePage extends WikiPage implements RemoteWikiPage {
/** @var File */
protected $mFile = false;
/** @var LocalRepo */
@@ -224,4 +224,20 @@
 
return TitleArray::newFromResult( $res );
}
+
+   /**
+* @since 1.28
+* @return string
+*/
+   public function getRemoteWikiDisplayName() {
+   return $this->getFile()->getRepo()->getDisplayName();
+   }
+
+   /**
+* @since 1.28
+* @return string
+*/
+   public function getRemoteURL() {
+   return $this->getFile()->getDescriptionUrl();
+   }
 }
diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php
index 2351ab8..c6b0115 100644
--- a/includes/skins/SkinTemplate.php
+++ b/includes/skins/SkinTemplate.php
@@ -920,19 +920,18 @@

$content_navigation['views']['view']['redundant'] = true;
}
 
-   $isForeignFile = $title->inNamespace( NS_FILE ) 
&& $this->canUseWikiPage() &&
-   $this->getWikiPage() instanceof 
WikiFilePage && !$this->getWikiPage()->isLocal();
+   $page = $this->canUseWikiPage() ? 
$this->getWikiPage() : false;
+   $isRemoteContent = $page && !$page->isLocal() 
&& $page instanceof RemoteWikiPage;
 
// If it is a non-local file, show a link to 
the file in its own repository
// @todo abstract this for remote content that 
isn't a file
-   if ( $isForeignFile ) {
-   $file = $this->getWikiPage()->getFile();
+   if ( $isRemoteContent ) {

$content_navigation['views']['view-foreign'] = [
'class' => '',
'text' => wfMessageFallback( 
"$skname-view-foreign", 'view-foreign' )->
setContext( 
$this->getContext() )->
-   

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Remove unused ContentHandlerDefaultModelFor hook

2016-09-15 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Remove unused ContentHandlerDefaultModelFor hook
..

Remove unused ContentHandlerDefaultModelFor hook

This was supposed to be removed in 7f02824ec4b0 except it got missed
somehow...

There was nothing registering it in extension.json, so it was entirely
unused.

Change-Id: I991c464ef0b60543a0ecd4cb1f9dda62e9d73dd4
---
M VisualEditor.hooks.php
1 file changed, 0 insertions(+), 20 deletions(-)


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

diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 4a2cc62..c52b934 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -196,26 +196,6 @@
}
 
/**
-* Convert the content model of a message that is actually JSON to JSON.
-* This only affects validation and UI when saving and editing, not
-* loading the content.
-*
-* @param Title $title
-* @param string $model
-* @return bool
-*/
-   public static function onContentHandlerDefaultModelFor( Title $title, 
&$model ) {
-   if (
-   $title->inNamespace( NS_MEDIAWIKI ) &&
-   $title->getText() === 
'Visualeditor-quick-access-characters.json'
-   ) {
-   $model = CONTENT_MODEL_JSON;
-   }
-
-   return true;
-   }
-
-   /**
 * Changes the Edit tab and adds the VisualEditor tab.
 *
 * This is attached to the MediaWiki 'SkinTemplateNavigation' hook.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I991c464ef0b60543a0ecd4cb1f9dda62e9d73dd4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
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...Kartographer[master]: Use externalData properties for geoshape service

2016-09-15 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: Use externalData properties for geoshape service
..

Use externalData properties for geoshape service

Bug: T145151
Change-Id: I1adfea768e778b83eb1fa530887ea6d54ba41259
---
M modules/box/Map.js
1 file changed, 13 insertions(+), 0 deletions(-)


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

diff --git a/modules/box/Map.js b/modules/box/Map.js
index 45640f4..50ec8a8 100644
--- a/modules/box/Map.js
+++ b/modules/box/Map.js
@@ -246,6 +246,7 @@
uri.query.getgeojson = 1;
 
return $.getJSON( uri.toString() ).then( 
function ( geoshape ) {
+   var baseProps = data.properties;
delete data.href;
 
// HACK: workaround for T144777 - we 
should be using topojson instead
@@ -256,6 +257,18 @@
// $.each( geoshape.objects, function ( 
key ) {
//  data.features.push( 
topojson.feature( geoshape, geoshape.objects[ key ] ) );
// } );
+
+   // Each feature returned from geoshape 
service may contain "properties"
+   // If externalData element has 
properties, merge it with properties in the feature
+   if ( baseProps ) {
+   $.each( data.features, function 
( index, feature ) {
+   if ( $.isEmptyObject( 
feature.properties ) ) {
+   
feature.properties = baseProps;
+   } else {
+   
feature.properties = $.extend( {}, baseProps, feature.properties );
+   }
+   } );
+   }
} );
 
default:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1adfea768e778b83eb1fa530887ea6d54ba41259
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: Yurik 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove wfSetBit()/wfSetVar() calls in DatabaseBase

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove wfSetBit()/wfSetVar() calls in DatabaseBase
..


Remove wfSetBit()/wfSetVar() calls in DatabaseBase

Change-Id: I4f1269d3a4e26c766f181208942042fdf768e0af
---
M includes/db/Database.php
M includes/db/DatabaseMssql.php
2 files changed, 28 insertions(+), 10 deletions(-)

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



diff --git a/includes/db/Database.php b/includes/db/Database.php
index 917bc91..3597b7c 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -412,18 +412,25 @@
 *   - false to disable debugging
 *   - omitted or null to do nothing
 *
-* @return bool|null Previous value of the flag
+* @return bool Previous value of the flag
+* @deprecated since 1.28; use setFlag()
 */
public function debug( $debug = null ) {
-   return wfSetBit( $this->mFlags, DBO_DEBUG, $debug );
+   $res = $this->getFlag( DBO_DEBUG );
+   if ( $debug !== null ) {
+   $debug ? $this->setFlag( DBO_DEBUG ) : 
$this->clearFlag( DBO_DEBUG );
+   }
+
+   return $res;
}
 
public function bufferResults( $buffer = null ) {
-   if ( is_null( $buffer ) ) {
-   return !(bool)( $this->mFlags & DBO_NOBUFFER );
-   } else {
-   return !wfSetBit( $this->mFlags, DBO_NOBUFFER, !$buffer 
);
+   $res = !$this->getFlag( DBO_NOBUFFER );
+   if ( $buffer !== null ) {
+   $buffer ? $this->clearFlag( DBO_NOBUFFER ) : 
$this->setFlag( DBO_NOBUFFER );
}
+
+   return $res;
}
 
/**
@@ -439,7 +446,12 @@
 * @return bool The previous value of the flag.
 */
protected function ignoreErrors( $ignoreErrors = null ) {
-   return wfSetBit( $this->mFlags, DBO_IGNORE, $ignoreErrors );
+   $res = $this->getFlag( DBO_IGNORE );
+   if ( $ignoreErrors !== null ) {
+   $ignoreErrors ? $this->setFlag( DBO_IGNORE ) : 
$this->clearFlag( DBO_IGNORE );
+   }
+
+   return $res;
}
 
public function trxLevel() {
@@ -451,11 +463,17 @@
}
 
public function tablePrefix( $prefix = null ) {
-   return wfSetVar( $this->mTablePrefix, $prefix );
+   $old = $this->mTablePrefix;
+   $this->mTablePrefix = $prefix;
+
+   return $old;
}
 
public function dbSchema( $schema = null ) {
-   return wfSetVar( $this->mSchema, $schema );
+   $old = $this->mSchema;
+   $this->mSchema = $schema;
+
+   return $old;
}
 
/**
diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
index 59c8952..4ffafde 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -165,7 +165,7 @@
 * @throws DBUnexpectedError
 */
protected function doQuery( $sql ) {
-   if ( $this->debug() ) {
+   if ( $this->getFlag( DBO_DEBUG ) ) {
wfDebug( "SQL: [$sql]\n" );
}
$this->offset = 0;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f1269d3a4e26c766f181208942042fdf768e0af
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: Skizzerz 
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...SmashPig[master]: More details for PendingQueueConsumer log

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: More details for PendingQueueConsumer log
..


More details for PendingQueueConsumer log

$data doesn't show up in the Jenkins output

Change-Id: I4cae66bb390ab219879de1ba15c9e5ca4fbb76d8
---
M Core/QueueConsumers/PendingQueueConsumer.php
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/Core/QueueConsumers/PendingQueueConsumer.php 
b/Core/QueueConsumers/PendingQueueConsumer.php
index 7868487..733d9b7 100644
--- a/Core/QueueConsumers/PendingQueueConsumer.php
+++ b/Core/QueueConsumers/PendingQueueConsumer.php
@@ -23,12 +23,14 @@
}
 
public function processMessage( $message ) {
+   $logIdentifier = "message with gateway {$message['gateway']}" .
+   " and order ID {$message['order_id']}";
if ( $this->paymentsInitialDatabase->isTransactionFinalized( 
$message ) ) {
// Throw the message out if it's already completed or 
failed, and
// exists in the fredge database.
-   Logger::info( "Skipping finalized message", $message );
+   Logger::info( "Skipping finalized $logIdentifier" );
} else {
-   Logger::info( "Storing message in database", $message );
+   Logger::info( "Storing $logIdentifier in database" );
$this->pendingDatabase->storeMessage( $message );
}
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4cae66bb390ab219879de1ba15c9e5ca4fbb76d8
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
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]: Remove wfRandomString() dependency in DatabaseBase

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove wfRandomString() dependency in DatabaseBase
..


Remove wfRandomString() dependency in DatabaseBase

Change-Id: I9a889e120bd665683e53dfbc8729a7c484ea507c
---
M includes/db/Database.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/db/Database.php b/includes/db/Database.php
index 3fa1335..d1221cf 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -2907,7 +2907,7 @@
$this->mTrxAutomatic = ( $mode === self::TRANSACTION_INTERNAL );
$this->mTrxAutomaticAtomic = false;
$this->mTrxAtomicLevels = [];
-   $this->mTrxShortId = wfRandomString( 12 );
+   $this->mTrxShortId = sprintf( '%06x', mt_rand( 0, 0xff ) );
$this->mTrxWriteDuration = 0.0;
$this->mTrxWriteQueryCount = 0;
$this->mTrxWriteAdjDuration = 0.0;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9a889e120bd665683e53dfbc8729a7c484ea507c
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Parent5446 
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]: refreshLinks: Use vslow group for DB_REPLICA connections

2016-09-15 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: refreshLinks: Use vslow group for DB_REPLICA connections
..

refreshLinks: Use vslow group for DB_REPLICA connections

Change-Id: If2f3bba7f0b518f26f0672150c94b999ac79f325
---
M maintenance/refreshLinks.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/72/311072/1

diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php
index 106be1f..e7a4d06 100644
--- a/maintenance/refreshLinks.php
+++ b/maintenance/refreshLinks.php
@@ -90,7 +90,7 @@
$end = null, $redirectsOnly = false, $oldRedirectsOnly = false
) {
$reportingInterval = 100;
-   $dbr = $this->getDB( DB_REPLICA );
+   $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] );
 
if ( $start === null ) {
$start = 1;
@@ -282,7 +282,7 @@
) {
wfWaitForSlaves();
$this->output( "Deleting illegal entries from the links 
tables...\n" );
-   $dbr = $this->getDB( DB_REPLICA );
+   $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] );
do {
// Find the start of the next chunk. This is based only
// on existent page_ids.
@@ -324,7 +324,7 @@
 */
private function dfnCheckInterval( $start = null, $end = null, 
$batchSize = 100 ) {
$dbw = $this->getDB( DB_MASTER );
-   $dbr = $this->getDB( DB_REPLICA );
+   $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] );
 
$linksTables = [ // table name => page_id field
'pagelinks' => 'pl_from',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2f3bba7f0b518f26f0672150c94b999ac79f325
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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/core[master]: Add 'WikiPageFactory' hook

2016-09-15 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Add 'WikiPageFactory' hook
..

Add 'WikiPageFactory' hook

This allows extension to consistently use their WikiPage subclasses.
Currently the only way a subclass would be used is if Article::newPage()
was called.

Change-Id: I74cce5f9627c4bc4b92502aff74beb2daeb78d17
---
M docs/hooks.txt
M includes/page/WikiPage.php
2 files changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/311073/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index ae0770b..91e9409 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -3743,6 +3743,10 @@
 due to an error)
 &$updates: the array of DataUpdate objects. Hook function may want to add to 
it.
 
+'WikiPageFactory': Override WikiPage class used for a title
+$title: Title of the page
+&$page: Variable to set the created WikiPage to.
+
 'XmlDumpWriterOpenPage': Called at the end of XmlDumpWriter::openPage, to allow
 extra metadata to be added.
 $obj: The XmlDumpWriter object.
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 6c0c4a8..d997566 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -121,6 +121,11 @@
throw new MWException( "Invalid or virtual namespace 
$ns given." );
}
 
+   $page = null;
+   if ( !Hooks::run( 'WikiPageFactory', [ $title, &$page ] ) ) {
+   return $page;
+   }
+
switch ( $ns ) {
case NS_FILE:
$page = new WikiFilePage( $title );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74cce5f9627c4bc4b92502aff74beb2daeb78d17
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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/core[master]: Move LoadMonitorMySQL to LoadMonitor

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Move LoadMonitorMySQL to LoadMonitor
..


Move LoadMonitorMySQL to LoadMonitor

* The LoadMonitor interface is now ILoadMonitor.
* Nothing in this code was MySQL specific.
  Now any DB type can benefit from a LoadMonitor.

Change-Id: I272a72cd55a70f99a866d518d44cb3bcaca91b9e
---
M autoload.php
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
A includes/libs/rdbms/loadmonitor/ILoadMonitor.php
M includes/libs/rdbms/loadmonitor/LoadMonitor.php
M includes/libs/rdbms/loadmonitor/LoadMonitorMySQL.php
M includes/libs/rdbms/loadmonitor/LoadMonitorNull.php
6 files changed, 201 insertions(+), 167 deletions(-)

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



diff --git a/autoload.php b/autoload.php
index 9fd83eb..1cb71d8 100644
--- a/autoload.php
+++ b/autoload.php
@@ -583,6 +583,7 @@
'IExpiringStore' => __DIR__ . 
'/includes/libs/objectcache/IExpiringStore.php',
'IJobSpecification' => __DIR__ . 
'/includes/jobqueue/JobSpecification.php',
'ILoadBalancer' => __DIR__ . 
'/includes/libs/rdbms/loadbalancer/ILoadBalancer.php',
+   'ILoadMonitor' => __DIR__ . 
'/includes/libs/rdbms/loadmonitor/ILoadMonitor.php',
'IP' => __DIR__ . '/includes/utils/IP.php',
'IPSet' => __DIR__ . '/includes/compat/IPSetCompat.php',
'IPTC' => __DIR__ . '/includes/media/IPTC.php',
diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
index cea7523..36279bc 100644
--- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
@@ -45,7 +45,7 @@
/** @var array[] $aliases Map of (table => (dbname, schema, prefix) 
map) */
private $tableAliases = [];
 
-   /** @var LoadMonitor */
+   /** @var ILoadMonitor */
private $mLoadMonitor;
/** @var BagOStuff */
private $srvCache;
@@ -190,7 +190,7 @@
/**
 * Get a LoadMonitor instance
 *
-* @return LoadMonitor
+* @return ILoadMonitor
 */
private function getLoadMonitor() {
if ( !isset( $this->mLoadMonitor ) ) {
diff --git a/includes/libs/rdbms/loadmonitor/ILoadMonitor.php 
b/includes/libs/rdbms/loadmonitor/ILoadMonitor.php
new file mode 100644
index 000..e355c03
--- /dev/null
+++ b/includes/libs/rdbms/loadmonitor/ILoadMonitor.php
@@ -0,0 +1,65 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Database
+ */
+use Psr\Log\LoggerAwareInterface;
+
+/**
+ * An interface for database load monitoring
+ *
+ * @ingroup Database
+ */
+interface ILoadMonitor extends LoggerAwareInterface {
+   /**
+* Construct a new LoadMonitor with a given LoadBalancer parent
+*
+* @param ILoadBalancer $lb LoadBalancer this instance serves
+* @param BagOStuff $sCache Local server memory cache
+* @param BagOStuff $cCache Local cluster memory cache
+*/
+   public function __construct( ILoadBalancer $lb, BagOStuff $sCache, 
BagOStuff $cCache );
+
+   /**
+* Perform pre-connection load ratio adjustment.
+* @param int[] &$loads
+* @param string|bool $group The selected query group. Default: false
+* @param string|bool $domain Default: false
+*/
+   public function scaleLoads( &$loads, $group = false, $domain = false );
+
+   /**
+* Get an estimate of replication lag (in seconds) for each server
+*
+* Values may be "false" if replication is too broken to estimate
+*
+* @param integer[] $serverIndexes
+* @param string $domain
+*
+* @return array Map of (server index => float|int|bool)
+*/
+   public function getLagTimes( $serverIndexes, $domain );
+
+   /**
+* Clear any process and persistent cache of lag times
+* @since 1.27
+*/
+   public function clearCaches();
+}
diff --git a/includes/libs/rdbms/loadmonitor/LoadMonitor.php 
b/includes/libs/rdbms/loadmonitor/LoadMonitor.php
index 460746b..1da8f4e 100644
--- a/includes/libs/rdbms/loadmonitor/LoadMonitor.php
+++ b/includes/libs/rdbms/loadmonitor/LoadMonitor.php
@@ -1,7 +1,5 @@
 parent = $lb;
+   $this->srvCache = $srvCache;
+   $this->mainCache = $cache;
+   $this->replLogger = new \Psr\Log\NullLogger();
+   }
 
-   /**
-* Get an estimate of replication lag (in seconds) for each server
-*
-* Values may be "false" if replication is too broken to estimate
-*
-* @param integer[] $serverIndexes
-* @param string $domain
-*
-* @return array Map of (server index => float|int|bool)
-*/
-   public function getLagTimes( $serverIndexes, $domain );
+   public function setLogger( LoggerInterface $logger ) 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move database constants to their own file

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Move database constants to their own file
..


Move database constants to their own file

Change-Id: I47e067687bbce7b89e02a0e732ee27368beddb61
---
M includes/Defines.php
A includes/libs/rdbms/defines.php
2 files changed, 38 insertions(+), 32 deletions(-)

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



diff --git a/includes/Defines.php b/includes/Defines.php
index ab02a8e..077f39a 100644
--- a/includes/Defines.php
+++ b/includes/Defines.php
@@ -24,29 +24,6 @@
  * @defgroup Constants MediaWiki constants
  */
 
-/**@{
- * Database related constants
- */
-define( 'DBO_DEBUG', 1 );
-define( 'DBO_NOBUFFER', 2 );
-define( 'DBO_IGNORE', 4 );
-define( 'DBO_TRX', 8 ); // automatically start transaction on first query
-define( 'DBO_DEFAULT', 16 );
-define( 'DBO_PERSISTENT', 32 );
-define( 'DBO_SYSDBA', 64 ); // for oracle maintenance
-define( 'DBO_DDLMODE', 128 ); // when using schema files: mostly for Oracle
-define( 'DBO_SSL', 256 );
-define( 'DBO_COMPRESS', 512 );
-/**@}*/
-
-/**@{
- * Valid database indexes
- * Operation-based indexes
- */
-define( 'DB_REPLICA', -1 ); # Read from a replica (or only server)
-define( 'DB_MASTER', -2 );# Write to master (or only server)
-/**@}*/
-
 # Obsolete aliases
 define( 'DB_SLAVE', -1 );
 
@@ -185,16 +162,10 @@
 define( 'EDIT_INTERNAL', 128 );
 /**@}*/
 
-/**@{
- * Flags for Database::makeList()
- * These are also available as Database class constants
+/**
+ * Database related
  */
-define( 'LIST_COMMA', 0 );
-define( 'LIST_AND', 1 );
-define( 'LIST_SET', 2 );
-define( 'LIST_NAMES', 3 );
-define( 'LIST_OR', 4 );
-/**@}*/
+require_once __DIR__ . '/libs/rdbms/defines.php';
 
 /**
  * Unicode and normalisation related
diff --git a/includes/libs/rdbms/defines.php b/includes/libs/rdbms/defines.php
new file mode 100644
index 000..48baa3c
--- /dev/null
+++ b/includes/libs/rdbms/defines.php
@@ -0,0 +1,35 @@
+https://gerrit.wikimedia.org/r/311059
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I47e067687bbce7b89e02a0e732ee27368beddb61
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Krinkle 
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...SmashPig[master]: More details for PendingQueueConsumer log

2016-09-15 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: More details for PendingQueueConsumer log
..

More details for PendingQueueConsumer log

$data doesn't show up in the Jenkins output

Change-Id: I4cae66bb390ab219879de1ba15c9e5ca4fbb76d8
---
M Core/QueueConsumers/PendingQueueConsumer.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/71/311071/1

diff --git a/Core/QueueConsumers/PendingQueueConsumer.php 
b/Core/QueueConsumers/PendingQueueConsumer.php
index 7868487..733d9b7 100644
--- a/Core/QueueConsumers/PendingQueueConsumer.php
+++ b/Core/QueueConsumers/PendingQueueConsumer.php
@@ -23,12 +23,14 @@
}
 
public function processMessage( $message ) {
+   $logIdentifier = "message with gateway {$message['gateway']}" .
+   " and order ID {$message['order_id']}";
if ( $this->paymentsInitialDatabase->isTransactionFinalized( 
$message ) ) {
// Throw the message out if it's already completed or 
failed, and
// exists in the fredge database.
-   Logger::info( "Skipping finalized message", $message );
+   Logger::info( "Skipping finalized $logIdentifier" );
} else {
-   Logger::info( "Storing message in database", $message );
+   Logger::info( "Storing $logIdentifier in database" );
$this->pendingDatabase->storeMessage( $message );
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4cae66bb390ab219879de1ba15c9e5ca4fbb76d8
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove wfGetCaller() dependency from DatabaseBase

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove wfGetCaller() dependency from DatabaseBase
..


Remove wfGetCaller() dependency from DatabaseBase

Change-Id: I3e240b2eb5c1f6a21f1bc974c3d28f5755c7451a
---
M includes/auth/EmailNotificationSecondaryAuthenticationProvider.php
M includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
M includes/changes/RecentChange.php
M includes/db/Database.php
M includes/deferred/AtomicSectionUpdate.php
M includes/deferred/AutoCommitUpdate.php
M includes/deferred/LinksUpdate.php
M includes/deferred/MWCallableUpdate.php
M includes/filerepo/LocalRepo.php
M includes/filerepo/file/LocalFile.php
M includes/jobqueue/JobQueueDB.php
M includes/jobqueue/jobs/RecentChangesUpdateJob.php
M includes/jobqueue/utils/PurgeJobUtils.php
M includes/libs/rdbms/database/DBConnRef.php
M includes/libs/rdbms/database/IDatabase.php
M includes/page/WikiPage.php
M includes/resourceloader/ResourceLoaderModule.php
M includes/revisiondelete/RevDelList.php
M includes/user/User.php
M includes/user/UserRightsProxy.php
M tests/phpunit/includes/db/DatabaseTest.php
21 files changed, 301 insertions(+), 232 deletions(-)

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



diff --git a/includes/auth/EmailNotificationSecondaryAuthenticationProvider.php 
b/includes/auth/EmailNotificationSecondaryAuthenticationProvider.php
index a82f018..a485531 100644
--- a/includes/auth/EmailNotificationSecondaryAuthenticationProvider.php
+++ b/includes/auth/EmailNotificationSecondaryAuthenticationProvider.php
@@ -51,15 +51,18 @@
&& !$this->manager->getAuthenticationSessionData( 
'no-email' )
) {
// TODO show 
'confirmemail_oncreate'/'confirmemail_sendfailed' message
-   wfGetDB( DB_MASTER )->onTransactionIdle( function () 
use ( $user ) {
-   $user = $user->getInstanceForUpdate();
-   $status = $user->sendConfirmationMail();
-   $user->saveSettings();
-   if ( !$status->isGood() ) {
-   $this->logger->warning( 'Could not send 
confirmation email: ' .
-   $status->getWikiText( false, 
false, 'en' ) );
-   }
-   } );
+   wfGetDB( DB_MASTER )->onTransactionIdle(
+   function () use ( $user ) {
+   $user = $user->getInstanceForUpdate();
+   $status = $user->sendConfirmationMail();
+   $user->saveSettings();
+   if ( !$status->isGood() ) {
+   $this->logger->warning( 'Could 
not send confirmation email: ' .
+   $status->getWikiText( 
false, false, 'en' ) );
+   }
+   },
+   __METHOD__
+   );
}
 
return AuthenticationResponse::newPass();
diff --git a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php 
b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
index f5571c7..f16423d 100644
--- a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
+++ b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
@@ -304,10 +304,13 @@
 
if ( $sendMail ) {
// Send email after DB commit
-   $dbw->onTransactionIdle( function () use ( $req ) {
-   /** @var TemporaryPasswordAuthenticationRequest 
$req */
-   $this->sendPasswordResetEmail( $req );
-   } );
+   $dbw->onTransactionIdle(
+   function () use ( $req ) {
+   /** @var 
TemporaryPasswordAuthenticationRequest $req */
+   $this->sendPasswordResetEmail( $req );
+   },
+   __METHOD__
+   );
}
}
 
@@ -375,9 +378,12 @@
 
if ( $mailpassword ) {
// Send email after DB commit
-   wfGetDB( DB_MASTER )->onTransactionIdle( function () 
use ( $user, $creator, $req ) {
-   $this->sendNewAccountEmail( $user, $creator, 
$req->password );
-   } );
+   wfGetDB( DB_MASTER )->onTransactionIdle(
+   function () use ( $user, $creator, $req ) {
+   

[MediaWiki-commits] [Gerrit] mediawiki...FundraisingEmailUnsubscribe[master]: Mirror messages to php-queue backend

2016-09-15 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Mirror messages to php-queue backend
..

Mirror messages to php-queue backend

Might want to catch potential exceptions.

Bug: T145419
Change-Id: Id80eda1541ab4347c33717b14e66fa4ee9712e90
---
M extension.json
M methods/FundraiserUnsubscribeThankYou.php
2 files changed, 22 insertions(+), 2 deletions(-)


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

diff --git a/extension.json b/extension.json
index 6cf12c9..39d929a 100644
--- a/extension.json
+++ b/extension.json
@@ -51,6 +51,8 @@
"FundraisingEmailUnsubscribeSilverpopURL": null,
"FundraisingEmailUnsubscribeLogFacility": 8,
"FundraisingEmailUnsubscribeLogXmlTransactions": false,
+   "FundraisingEmailUnsubscribeQueueClass": "",
+   "FundraisingEmailUnsubscribeQueueParameters": {},
"FundraisingEmailUnsubscribeProcesses": {
"thankyou": [
"FundraiserUnsubscribeThankYou"
diff --git a/methods/FundraiserUnsubscribeThankYou.php 
b/methods/FundraiserUnsubscribeThankYou.php
index 130521e..ec020fd 100644
--- a/methods/FundraiserUnsubscribeThankYou.php
+++ b/methods/FundraiserUnsubscribeThankYou.php
@@ -63,19 +63,37 @@
}
 
public function unsubscribe( $requestID, $process, array $params ) {
+   global $wgFundraisingEmailUnsubscribeQueueClass,
+  $wgFundraisingEmailUnsubscribeQueueParameters;
+
Logger::pushLabel( 'UnsubThankYou' );
 
$email = $params['email'];
$contribId = $params['contribution-id'];
 
+   $message = array(
+   'process' => $process,
+   'email' => $email,
+   'contribution-id' => $contribId
+   );
// And now we attempt the STOMP transaction
Logger::log( 'Placing STOMP message in queue for email ' . 
json_encode( $email ) );
$result = FundraiserUnsubscribeStompAdapter::sendMessage(
-   array( 'process' => $process, 'email' => $email, 
'contribution-id' => $contribId ),
+   $message,
'unsubscribe',
$requestID
);
-
+   if ( $wgFundraisingEmailUnsubscribeQueueClass ) {
+   $wgFundraisingEmailUnsubscribeQueueParameters = 
array_merge(
+   $wgFundraisingEmailUnsubscribeQueueParameters,
+   array( 'queue' => 'unsubscribe' )
+   );
+   $queue = new $wgFundraisingEmailUnsubscribeQueueClass(
+   $wgFundraisingEmailUnsubscribeQueueParameters
+   );
+   // Throws exception if it is unsuccessful
+   $queue->push( $message );
+   }
// Clean up and return
Logger::popLabel();
return $result;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id80eda1541ab4347c33717b14e66fa4ee9712e90
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FundraisingEmailUnsubscribe
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Deprecate jquery.arrowSteps module

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Deprecate jquery.arrowSteps module
..


Deprecate jquery.arrowSteps module

Bug: T144974
Change-Id: I765902082e6a71ca69983a2e67dcc856ad8b6ca8
---
M RELEASE-NOTES-1.28
M resources/Resources.php
2 files changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  Paladox: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28
index 1f4b8dc..03cba09 100644
--- a/RELEASE-NOTES-1.28
+++ b/RELEASE-NOTES-1.28
@@ -169,6 +169,7 @@
   phpunit.php: --regex and --keep-uploads. Instead of --regex, use --filter.
   Instead of --keep-uploads, use the same option to parserTests.php, but you
   must specify a directory with --upload-dir.
+* The 'jquery.arrowSteps' ResourceLoader module is now deprecated.
 
 == Compatibility ==
 
diff --git a/resources/Resources.php b/resources/Resources.php
index 63c3490..89168db 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -166,6 +166,7 @@
'scripts' => 'resources/lib/jquery/jquery.appear.js',
],
'jquery.arrowSteps' => [
+   'deprecated' => true,
'scripts' => 'resources/src/jquery/jquery.arrowSteps.js',
'styles' => 'resources/src/jquery/jquery.arrowSteps.css',
'targets' => [ 'desktop', 'mobile' ],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I765902082e6a71ca69983a2e67dcc856ad8b6ca8
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Paladox 
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]: resourceloader: Set a Title on context-created messages

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: resourceloader: Set a Title on context-created messages
..


resourceloader: Set a Title on context-created messages

Ensure that messages created using ResourceLoaderContext::msg() have a
title set so they don't trigger the GlobalTitleFail log. We use a dummy
title since there is no real title we can use here, and the cache
doesn't vary on a title anyways. This particular title was picked
especially for Roan.

This patch should quiet the GlobalTitleFail logs for
MFResourceLoaderParsedMessageModule and VisualEditorDataModule.

Change-Id: I502faa22776e1cb34a6ef17be96567f121c80081
---
M includes/resourceloader/ResourceLoaderContext.php
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/includes/resourceloader/ResourceLoaderContext.php 
b/includes/resourceloader/ResourceLoaderContext.php
index 30fe3ae..4a2f759 100644
--- a/includes/resourceloader/ResourceLoaderContext.php
+++ b/includes/resourceloader/ResourceLoaderContext.php
@@ -219,7 +219,11 @@
 */
public function msg() {
return call_user_func_array( 'wfMessage', func_get_args() )
-   ->inLanguage( $this->getLanguage() );
+   ->inLanguage( $this->getLanguage() )
+   // Use a dummy title because there is no real title
+   // for this endpoint, and the cache won't vary on it
+   // anyways.
+   ->title( Title::newFromText( 'Dwimmerlaik' ) );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I502faa22776e1cb34a6ef17be96567f121c80081
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Krinkle 
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...WikimediaEvents[master]: Document AuthManagerStatsdHandler better

2016-09-15 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Document AuthManagerStatsdHandler better
..

Document AuthManagerStatsdHandler better

Change-Id: I499fa5ce8db5619f4c706512224f60928e341306
---
M includes/AuthManagerStatsdHandler.php
1 file changed, 14 insertions(+), 1 deletion(-)


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

diff --git a/includes/AuthManagerStatsdHandler.php 
b/includes/AuthManagerStatsdHandler.php
index 02e1955..5d5f21d 100644
--- a/includes/AuthManagerStatsdHandler.php
+++ b/includes/AuthManagerStatsdHandler.php
@@ -26,9 +26,22 @@
 use Monolog\Handler\AbstractHandler;
 
 /**
- * Counts authentication-related log calls (those sent to the 'authmanager'
+ * Counts authentication-related log events (those sent to the 'authevents'
  * channel) via StatsD.
  *
+ * Events can include the following data in their context:
+ *   - 'event': (string, required) the type of the event (e.g. 'login').
+ *   - 'type': (string) a subtype for more complex events.
+ *   - 'successful': (bool) whether the attempt was successful. Can be omitted 
if 'status' is
+ * a Status or a StatusValue.
+ *   - 'status': (Status|StatusValue|string|int) attempt status (such as an 
error message key).
+ * string/int values will be ignored unless 'successful' is false.
+ *
+ * Will result in a ping to a graphite key that looks like
+ * .authmanager[success|failure].
+ * Some segments will be omitted when the appropriate data is not present.
+ *  is 'web' or 'centrallogin' or 'api' and filled automatically.
+ *
  * Used to alert on sudden, unexplained changes in e.g. the number of login
  * errors.
  */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I499fa5ce8db5619f4c706512224f60928e341306
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 

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


[MediaWiki-commits] [Gerrit] mediawiki...ProofreadPage[wmf/1.28.0-wmf.18]: Fix missing dependency of ext.proofreadpage.ve.pageTarget up...

2016-09-15 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Fix missing dependency of ext.proofreadpage.ve.pageTarget upon 
ext.visualEditor.desktopArticleTarget
..

Fix missing dependency of ext.proofreadpage.ve.pageTarget upon 
ext.visualEditor.desktopArticleTarget

Change-Id: I4ccd9efa38139366f574bc65cb41b27513abf268
(cherry picked from commit fdfd1b1217844e87876a75f7fb8d60a3167d52c4)
---
M extension.json
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/extension.json b/extension.json
index 8624f26..5b8207b 100644
--- a/extension.json
+++ b/extension.json
@@ -220,6 +220,7 @@
],
"dependencies": [
"ext.visualEditor.mwcore",
+   "ext.visualEditor.desktopArticleTarget",
"jquery.prpZoom"
],
"messages": [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ccd9efa38139366f574bc65cb41b27513abf268
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: wmf/1.28.0-wmf.18
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Alex Monk 

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


[MediaWiki-commits] [Gerrit] mediawiki...ProofreadPage[wmf/1.28.0-wmf.19]: Fix missing dependency of ext.proofreadpage.ve.pageTarget up...

2016-09-15 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Fix missing dependency of ext.proofreadpage.ve.pageTarget upon 
ext.visualEditor.desktopArticleTarget
..

Fix missing dependency of ext.proofreadpage.ve.pageTarget upon 
ext.visualEditor.desktopArticleTarget

Change-Id: I4ccd9efa38139366f574bc65cb41b27513abf268
(cherry picked from commit fdfd1b1217844e87876a75f7fb8d60a3167d52c4)
---
M extension.json
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/extension.json b/extension.json
index 8624f26..5b8207b 100644
--- a/extension.json
+++ b/extension.json
@@ -220,6 +220,7 @@
],
"dependencies": [
"ext.visualEditor.mwcore",
+   "ext.visualEditor.desktopArticleTarget",
"jquery.prpZoom"
],
"messages": [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ccd9efa38139366f574bc65cb41b27513abf268
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: wmf/1.28.0-wmf.19
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Alex Monk 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mediawiki.user: Minor clean up of code and unit tests

2016-09-15 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: mediawiki.user: Minor clean up of code and unit tests
..

mediawiki.user: Minor clean up of code and unit tests

* Clarify getRegistration() return documentation and minor
  optimisation of code order.

* Fix typo in test name for getUserInfo().

* Remove redundant test expect numbers.
  Follows-up 7c363752ed.

* Separate getter assertions for anonymous and logged-in.
  Avoid changing the fixture mid-test. Let setup/teardown
  clean up in the middle.

Change-Id: If777d44a571ac590e91ed84060ea714df67f8f2f
---
M resources/src/mediawiki/mediawiki.user.js
M tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js
2 files changed, 20 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/64/311064/1

diff --git a/resources/src/mediawiki/mediawiki.user.js 
b/resources/src/mediawiki/mediawiki.user.js
index 7df778f..1f3e779 100644
--- a/resources/src/mediawiki/mediawiki.user.js
+++ b/resources/src/mediawiki/mediawiki.user.js
@@ -104,17 +104,18 @@
/**
 * Get date user registered, if available
 *
-* @return {Date|boolean|null} Date user registered, or false 
for anonymous users, or
-*  null when data is not available
+* @return {boolean|null|Date} False for anonymous users, null 
if data is
+*  unavailable, or Date for when the user registered.
 */
getRegistration: function () {
-   var registration = mw.config.get( 'wgUserRegistration' 
);
if ( mw.user.isAnon() ) {
return false;
}
+   var registration = mw.config.get( 'wgUserRegistration' 
);
+   // Registration may be unavailable if the user signed 
up before MediaWiki
+   // began tracking this.
+   return !registration ? null : new Date( registration );
if ( registration === null ) {
-   // Information may not be available if they 
signed up before
-   // MW began storing this.
return null;
}
return new Date( registration );
diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js
index 3332c08..5122dcd 100644
--- a/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js
+++ b/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js
@@ -15,32 +15,32 @@
}
} ) );
 
-   QUnit.test( 'options', 1, function ( assert ) {
+   QUnit.test( 'options', function ( assert ) {
assert.ok( mw.user.options instanceof mw.Map, 'options instance 
of mw.Map' );
} );
 
-   QUnit.test( 'user status', 7, function ( assert ) {
-
+   QUnit.test( 'getters (anonymous)', function ( assert ) {
// Forge an anonymous user
mw.config.set( 'wgUserName', null );
delete mw.config.values.wgUserId;
 
-   assert.strictEqual( mw.user.getName(), null, 'user.getName() 
returns null when anonymous' );
-   assert.assertTrue( mw.user.isAnon(), 'user.isAnon() returns 
true when anonymous' );
-   assert.strictEqual( mw.user.getId(), 0, 'user.getId() returns 0 
when anonymous' );
+   assert.strictEqual( mw.user.getName(), null, 'getName()' );
+   assert.strictEqual( mw.user.isAnon(), true, 'isAnon()' );
+   assert.strictEqual( mw.user.getId(), 0, 'getId()' );
+   } );
 
-   // Not part of startUp module
+   QUnit.test( 'getters (logged-in)', function ( assert ) {
mw.config.set( 'wgUserName', 'John' );
mw.config.set( 'wgUserId', 123 );
 
-   assert.equal( mw.user.getName(), 'John', 'user.getName() 
returns username when logged-in' );
-   assert.assertFalse( mw.user.isAnon(), 'user.isAnon() returns 
false when logged-in' );
-   assert.strictEqual( mw.user.getId(), 123, 'user.getId() returns 
correct ID when logged-in' );
+   assert.equal( mw.user.getName(), 'John', 'getName()' );
+   assert.strictEqual( mw.user.isAnon(), false, 'isAnon()' );
+   assert.strictEqual( mw.user.getId(), 123, 'getId()' );
 
-   assert.equal( mw.user.id(), 'John', 'user.id Returns username 
when logged-in' );
+   assert.equal( mw.user.id(), 'John', 'user.id()' );
} );
 
-   QUnit.test( 'getUserInfos', 3, function ( assert ) {
+   QUnit.test( 'getUserInfo', function ( assert ) {

[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Add proper QUnit tests

2016-09-15 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review.

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

Change subject: Add proper QUnit tests
..

Add proper QUnit tests

Change-Id: I7a4abf068a32d9cf65eb464eb036f72f319c54ff
---
A tests/qunit/model/test_mw.echo.dm.NotificationItem.js
A tests/qunit/model/test_mw.echo.dm.SourcePagesModel.js
2 files changed, 310 insertions(+), 0 deletions(-)


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

diff --git a/tests/qunit/model/test_mw.echo.dm.NotificationItem.js 
b/tests/qunit/model/test_mw.echo.dm.NotificationItem.js
new file mode 100644
index 000..99ae6f8
--- /dev/null
+++ b/tests/qunit/model/test_mw.echo.dm.NotificationItem.js
@@ -0,0 +1,139 @@
+( function ( mw, $ ) {
+   QUnit.module( 'ext.echo.dm - mw.echo.dm.NotificationItem' );
+   var fakeData = {
+   type: 'alert',
+   read: true,
+   seen: true,
+   timestamp: '2016-09-14T23:21:56Z',
+   content: {
+   header: 'Your edit on ‪Moai‬ 
was reverted.',
+   compactHeader: 'Your edit on 
‪Moai‬ was reverted.',
+   body: 'undo'
+   },
+   iconType: 'revert',
+   primaryUrl: 
'http://dev.wiki.local.wmftest.net:8080/w/index.php?title=Moai=prev=1978=2126',
+   secondaryUrls: [
+   {
+   url: 
'http://dev.wiki.local.wmftest.net:8080/wiki/User:RandomUser',
+   label: 'RandomUser',
+   icon: 'userAvatar'
+   },
+   {
+   url: 
'http://dev.wiki.local.wmftest.net:8080/wiki/Talk:Moai',
+   label: 'Moai',
+   tooltip: 'Talk:Moai',
+   icon: 'speechBubbles'
+   }
+   ]
+   };
+
+   QUnit.test( 'Constructing items', function ( assert ) {
+   var i, j, itemModel, checkMethods,
+   defaultValues = {
+   getId: undefined,
+   getContentHeader: '',
+   getContentBody: '',
+   getCategory: '',
+   getType: 'message',
+   isRead: false,
+   isSeen: false,
+   isForeign: false,
+   isBundled: false,
+   // getTimestamp: moment.utc().format( 
'-MM-DD[T]HH:mm:ss[Z]' );
+   getPrimaryUrl: undefined,
+   getIconURL: undefined,
+   getIconType: undefined,
+   getSecondaryUrls: [],
+   getModelName: 'local',
+   getAllIds: []
+   },
+   tests = [
+   {
+   msg: 'Empty data',
+   params: { id: 0, config: {} },
+   tests: 'all',
+   expected: $.extend( true, {}, 
defaultValues, { getId: 0, getAllIds: [ 0 ] } )
+   },
+   {
+   msg: 'Fake data',
+   params: { id: 999, config: fakeData },
+   tests: 'all',
+   expected: $.extend( true, {}, 
defaultValues, {
+   getId: 999,
+   getAllIds: [ 999 ],
+   getType: 'alert',
+   isRead: true,
+   isSeen: true,
+   getTimestamp: 
'2016-09-14T23:21:56Z',
+   getContentHeader: 'Your edit on 
‪Moai‬ was reverted.',
+   getContentBody: 'undo',
+   getIconType: 'revert',
+   getPrimaryUrl: 
'http://dev.wiki.local.wmftest.net:8080/w/index.php?title=Moai=prev=1978=2126',
+   getSecondaryUrls: [
+   {
+   

[MediaWiki-commits] [Gerrit] mediawiki...FundraisingEmailUnsubscribe[master]: Update libs, add php-queue and predis

2016-09-15 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Update libs, add php-queue and predis
..

Update libs, add php-queue and predis

Preparing to switch off of ActiveMQ

Bug: T145419
Change-Id: I7c96ff947b852a819e158faf00b13211b24cf06f
---
M composer.json
M composer.lock
A vendor/clio/clio/LICENSE
A vendor/clio/clio/README.md
A vendor/clio/clio/composer.json
A vendor/clio/clio/src/Clio/Console.php
A vendor/clio/clio/src/Clio/Daemon.php
A vendor/coderkungfu/php-queue
M vendor/composer/LICENSE
M vendor/composer/autoload_namespaces.php
M vendor/composer/autoload_psr4.php
M vendor/composer/autoload_real.php
A vendor/composer/autoload_static.php
M vendor/composer/installed.json
A vendor/monolog/monolog/.php_cs
A vendor/monolog/monolog/CHANGELOG.mdown
A vendor/monolog/monolog/LICENSE
A vendor/monolog/monolog/README.mdown
A vendor/monolog/monolog/composer.json
A vendor/monolog/monolog/doc/01-usage.md
A vendor/monolog/monolog/doc/02-handlers-formatters-processors.md
A vendor/monolog/monolog/doc/03-utilities.md
A vendor/monolog/monolog/doc/04-extending.md
A vendor/monolog/monolog/doc/sockets.md
A vendor/monolog/monolog/phpunit.xml.dist
A vendor/monolog/monolog/src/Monolog/ErrorHandler.php
A vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php
A vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php
A vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php
A vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php
A 
vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php
A 
vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php
A 
vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php
A vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php
A vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php
A vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php
A vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php
A 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: [WIP] File search features

2016-09-15 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

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

Change subject: [WIP] File search features
..

[WIP] File search features

Bug: T145560
Change-Id: I5032ea080b9661903c2f42b37c839c57d90c9b9f
---
A includes/Query/FileNumericFeature.php
A includes/Query/FileResolutionFeature.php
A includes/Query/FileTypeFeature.php
3 files changed, 208 insertions(+), 0 deletions(-)


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

diff --git a/includes/Query/FileNumericFeature.php 
b/includes/Query/FileNumericFeature.php
new file mode 100644
index 000..f0ef381
--- /dev/null
+++ b/includes/Query/FileNumericFeature.php
@@ -0,0 +1,94 @@
+300 - size
+ * Selects only files of these specified features.
+ */
+class FileNumericFeature extends SimpleKeywordFeature {
+   /**
+* @return string
+*/
+   protected function getKeywordRegex() {
+   return 'file(size|bits)';
+   }
+
+   /**
+* @param SearchContext $context
+* @param string$key The keyword
+* @param string$value The value attached to the keyword with 
quotes stripped
+* @param string$quotedValue The original value in the search 
string, including quotes
+* if used
+* @param bool  $negated Is the search negated? Not used to 
generate the returned
+* AbstractQuery, that will be negated as necessary. Used for any 
other building/context
+* necessary.
+* @return array Two element array, first an AbstractQuery or null to 
apply to the
+*  query. Second a boolean indicating if the quotedValue should be 
kept in the search
+*  string.
+*/
+   protected function doApply( SearchContext $context, $key, $value, 
$quotedValue, $negated ) {
+
+   if ( $key === 'filesize' ) {
+   $field = 'file_size';
+   } else {
+   $field = 'file_bits';
+   }
+
+   // filesize treats no sign as >, since exact file size matches 
make no sense
+   $sign = $this->extractSign( $value, ( $key === 'filesize' ) ? 1 
: 0 );
+
+   if ( !is_numeric( $value ) ) {
+   return [ null, false ];
+   }
+   $number = intval( $value );
+
+   $context->setNamespaces( [ NS_FILE ] );
+
+   $filter = new Query\BoolQuery();
+   $filter->addFilter( $this->buildNumericQuery( $field, $sign, 
$number ) );
+   return [ $filter, false ];
+   }
+
+   /**
+* Extract sign prefix which can be < or > or nothing.
+* @param $value
+* @param int $default
+* @return int  0 is equal, 1 is more, -1 is less
+*/
+   protected function extractSign( &$value, $default = 0 ) {
+   if ( $value[0] == '>' || $value[0] == '<' ) {
+   $sign = ( $value[0] == '>' ) ? 1 : - 1;
+   $value = substr( $value, 1 );
+   } else {
+   return $default;
+   }
+   return $sign;
+   }
+
+   /**
+* Build a query which is either range match or exact match.
+* @param string $field
+* @param int$sign 0 is equal, 1 is more, -1 is less
+* @param$number number to compare to
+* @return Query\AbstractQuery
+*/
+   protected function buildNumericQuery( $field, $sign, $number ) {
+   if ( $sign ) {
+   if ( $sign < 0 ) {
+   $range = [ "lte" => $number ];
+   } else {
+   $range = [ "gte" => $number ];
+   }
+   return new Query\Range( $field, $range );
+   } else {
+   $query = new  Query\Match();
+   $query->setFieldQuery( $field, $number );
+   }
+   return $query;
+   }
+
+}
\ No newline at end of file
diff --git a/includes/Query/FileResolutionFeature.php 
b/includes/Query/FileResolutionFeature.php
new file mode 100644
index 000..345e511
--- /dev/null
+++ b/includes/Query/FileResolutionFeature.php
@@ -0,0 +1,67 @@
+800w,600h,700r
+ * 'w' is width, 'h' is height, 'r' is resolution which is sqrt(w*h)
+ * Selects only files of these specified features.
+ */
+class FileResolutionFeature extends FileNumericFeature {
+   /**
+* @return string
+*/
+   protected function getKeywordRegex() {
+   return 'fileres';
+   }
+
+   /**
+* @param SearchContext $context
+* @param string$key The keyword
+* @param string$value The value attached to the keyword with 
quotes stripped
+* @param 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Fix index_options on root field

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix index_options on root field
..


Fix index_options on root field

This problem was introduced in I49739a9 and breaks index_options
for root fields.

Change-Id: I1b42ea4d51b5d3bd80f8fbb8693c3f00800ad7da
---
M includes/Search/TextIndexField.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Search/TextIndexField.php 
b/includes/Search/TextIndexField.php
index 2b81529..2f307e3 100644
--- a/includes/Search/TextIndexField.php
+++ b/includes/Search/TextIndexField.php
@@ -175,7 +175,7 @@
protected function configureHighlighting( array &$field, array 
$subFields, $rootField = true ) {
if ( $this->mappingFlags & 
MappingConfigBuilder::OPTIMIZE_FOR_EXPERIMENTAL_HIGHLIGHTER ) {
if ( $this->checkFlag( self::SPEED_UP_HIGHLIGHTING ) ) {
-   if ( !$rootField ) {
+   if ( $rootField ) {
$field[ 'index_options' ] = 'offsets';
}
foreach ( $subFields as $fieldName ) {
@@ -186,7 +186,7 @@
}
} else {
// We use the FVH on all fields so turn on term vectors
-   if ( !$rootField ) {
+   if ( $rootField ) {
$field[ 'term_vector' ] = 
'with_positions_offsets';
}
foreach ( $subFields as $fieldName ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b42ea4d51b5d3bd80f8fbb8693c3f00800ad7da
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse 
Gerrit-Reviewer: Cindy-the-browser-test-bot 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Manybubbles 
Gerrit-Reviewer: Smalyshev 
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]: One more Configuration call needing staticization

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: One more Configuration call needing staticization
..


One more Configuration call needing staticization

Change-Id: If3ba5792fcffa2736e064d8d093dc71cbcc37b5e
---
M sites/all/modules/queue2civicrm/banner_history/banner_history.module
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git 
a/sites/all/modules/queue2civicrm/banner_history/banner_history.module 
b/sites/all/modules/queue2civicrm/banner_history/banner_history.module
index 8492429..b3f4f11 100644
--- a/sites/all/modules/queue2civicrm/banner_history/banner_history.module
+++ b/sites/all/modules/queue2civicrm/banner_history/banner_history.module
@@ -74,7 +74,7 @@
watchdog( 'banner_history', 'Executing: banner_history_queue_consume' );
 
civicrm_initialize();
-$config = new Configuration();
+$config = Configuration::createForView();
 Context::initWithLogger( $config, 'banner_history' );
 
$queue = variable_get( 'banner_history_queue', 'banner-history' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If3ba5792fcffa2736e064d8d093dc71cbcc37b5e
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: MediaWiki theme: Fix SelectFileWidget's label visibility in ...

2016-09-15 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review.

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

Change subject: MediaWiki theme: Fix SelectFileWidget's label visibility in IE11
..

MediaWiki theme: Fix SelectFileWidget's label visibility in IE11

After the MIME type information is gone, we can handle this issue
differently and let filename `span` act as block element, ensuring both -
label visibility in IE11 and ellipsis as text-overflow on long
filenames

Bug: T127267
Change-Id: I7603de235bab47572d4167d260cf0b13ce7ebc35
---
M src/themes/mediawiki/widgets.less
1 file changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/60/311060/1

diff --git a/src/themes/mediawiki/widgets.less 
b/src/themes/mediawiki/widgets.less
index 80d3a92..5ea8a5c 100644
--- a/src/themes/mediawiki/widgets.less
+++ b/src/themes/mediawiki/widgets.less
@@ -242,12 +242,17 @@
.oo-ui-box-sizing( border-box );
display: block;
right: @size-icon + 0.5em; // With close, no indicator
-   line-height: 2.3;
margin: 0;
-   overflow: hidden;
-   white-space: nowrap;
-   text-overflow: ellipsis;
padding-left: 0.5em;
+   line-height: 2.3;
+   white-space: nowrap;
+   }
+
+   // Addressing overflowing (long) filenames
+   &-fileName {
+   display: block;
+   overflow: hidden;
+   text-overflow: ellipsis;
}
 
&-clearButton {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7603de235bab47572d4167d260cf0b13ce7ebc35
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: VolkerE 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet Panel: Speed up role formatting

2016-09-15 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Puppet Panel:  Speed up role formatting
..


Puppet Panel:  Speed up role formatting

These format functions are really the responsiblity of the view,
but moving them into the model (puppet_roles.py) allows us to
cache the formatted role properties.  This should save us a tiny
bit of render time.

Bug: T91990
Change-Id: I1af176860e6c0ac42012f2a0bd8c349f19c74e11
---
M modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
M modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
2 files changed, 23 insertions(+), 40 deletions(-)

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



diff --git a/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py 
b/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
index 5a64a3e..69bf466 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
@@ -18,6 +18,9 @@
 
 from django.conf import settings
 from django.core.cache import cache
+from django.utils.html import escape
+from django.utils.safestring import mark_safe
+from django.utils.translation import ugettext_lazy as _
 
 logging.basicConfig()
 LOG = logging.getLogger(__name__)
@@ -27,18 +30,22 @@
 #  for our Horizon table-of-roles UI
 class PuppetClass():
 name = None
+html_name = ""
 docs = ""
 applied = False
 params = []
+formatted_params = ""
 raw_params = {}
 filter_tags = []
 instance = None
 
 def __init__(self, name):
 self.name = name
-self.docs = ""
+self.html_name = ""
+self.docs = _('(No docs available)')
 self.applied = False
 self.params = []
+self.formatted_params = ""
 self.raw_params = {}
 self.filter_tags = []
 self.instance = None
@@ -51,6 +58,12 @@
 def mark_applied(self, paramdict):
 self.applied = True
 self.params = paramdict
+if paramdict:
+keysanddefaults = []
+for param in self.params.items():
+keysanddefaults.append("%s: %s" % param)
+self.formatted_params = ";\n".join(keysanddefaults)
+
 return self
 
 
@@ -99,6 +112,13 @@
 newdoc += "%s\n" % line
 obj.docs = newdoc
 
+simplename = obj.name.split('role::')[1]
+html = '%s ' % (
+escape(simplename),
+escape(obj.docs)
+)
+obj.html_name = mark_safe(html)
+
 roles.append(obj)
 
 cache.set(key, roles, 300)
diff --git a/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py 
b/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
index ab6310b..38f1d0a 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
@@ -19,43 +19,10 @@
 from django.core import urlresolvers
 from django.utils.translation import ugettext_lazy as _
 
-from django.utils.html import escape
-from django.utils.safestring import mark_safe
-
 from horizon import tables
-
-import puppet_roles
 
 logging.basicConfig()
 LOG = logging.getLogger(__name__)
-
-
-def get_formatted_name(classrecord):
-name = classrecord.name.split('role::')[1]
-title = get_docs_for_class(name)
-html = '%s ' % (
-escape(name),
-escape(title)
-)
-return mark_safe(html)
-
-
-def get_formatted_params(classrecord):
-if classrecord.params:
-keysanddefaults = []
-for param in classrecord.params.items():
-keysanddefaults.append("%s: %s" % param)
-return(";\n".join(keysanddefaults))
-
-
-def get_docs_for_class(classname):
-allroles = puppet_roles.available_roles()
-for role in allroles:
-if role.name.split('role::')[1] == classname:
-if role.docs:
-return role.docs
-break
-return _('(No docs available)')
 
 
 class RemoveRole(tables.LinkAction):
@@ -142,9 +109,9 @@
 
 class PuppetTable(tables.DataTable):
 applied = tables.Column('applied', verbose_name=_('Applied'), status=True)
-name = tables.Column(get_formatted_name,
+name = tables.Column('html_name',
  verbose_name=_('Name'))
-params = tables.Column(get_formatted_params,
+params = tables.Column('formatted_params',
verbose_name=_('Parameters'),
sortable=False)
 instance = tables.Column('instance',
@@ -167,7 +134,3 @@
 
 def get_object_id(self, datum):
 return datum.name
-
-def render_to_response(self, context, **response_kwargs):
-LOG.warn("render_to_response 2: %s" %
- self.request.GET.get('format', 'html'))

-- 
To 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move database contants to their own file

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Move database contants to their own file
..

Move database contants to their own file

Change-Id: I47e067687bbce7b89e02a0e732ee27368beddb61
---
M includes/Defines.php
A includes/libs/rdbms/defines.php
2 files changed, 36 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/59/311059/1

diff --git a/includes/Defines.php b/includes/Defines.php
index ab02a8e..0a0a849 100644
--- a/includes/Defines.php
+++ b/includes/Defines.php
@@ -24,29 +24,6 @@
  * @defgroup Constants MediaWiki constants
  */
 
-/**@{
- * Database related constants
- */
-define( 'DBO_DEBUG', 1 );
-define( 'DBO_NOBUFFER', 2 );
-define( 'DBO_IGNORE', 4 );
-define( 'DBO_TRX', 8 ); // automatically start transaction on first query
-define( 'DBO_DEFAULT', 16 );
-define( 'DBO_PERSISTENT', 32 );
-define( 'DBO_SYSDBA', 64 ); // for oracle maintenance
-define( 'DBO_DDLMODE', 128 ); // when using schema files: mostly for Oracle
-define( 'DBO_SSL', 256 );
-define( 'DBO_COMPRESS', 512 );
-/**@}*/
-
-/**@{
- * Valid database indexes
- * Operation-based indexes
- */
-define( 'DB_REPLICA', -1 ); # Read from a replica (or only server)
-define( 'DB_MASTER', -2 );# Write to master (or only server)
-/**@}*/
-
 # Obsolete aliases
 define( 'DB_SLAVE', -1 );
 
@@ -185,16 +162,7 @@
 define( 'EDIT_INTERNAL', 128 );
 /**@}*/
 
-/**@{
- * Flags for Database::makeList()
- * These are also available as Database class constants
- */
-define( 'LIST_COMMA', 0 );
-define( 'LIST_AND', 1 );
-define( 'LIST_SET', 2 );
-define( 'LIST_NAMES', 3 );
-define( 'LIST_OR', 4 );
-/**@}*/
+require_once __DIR__ . '/libs/rdbms/defines.php';
 
 /**
  * Unicode and normalisation related
diff --git a/includes/libs/rdbms/defines.php b/includes/libs/rdbms/defines.php
new file mode 100644
index 000..48baa3c
--- /dev/null
+++ b/includes/libs/rdbms/defines.php
@@ -0,0 +1,35 @@
+https://gerrit.wikimedia.org/r/311059
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47e067687bbce7b89e02a0e732ee27368beddb61
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: use @OnClick for SearchFragment listeners

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: use @OnClick for SearchFragment listeners
..


Hygiene: use @OnClick for SearchFragment listeners

Change-Id: I14af19ea104d36424d86e31cea1edbc75080b2d4
---
M app/src/main/java/org/wikipedia/search/SearchFragment.java
1 file changed, 12 insertions(+), 16 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/search/SearchFragment.java 
b/app/src/main/java/org/wikipedia/search/SearchFragment.java
index 3573c9f..ed2e58d 100644
--- a/app/src/main/java/org/wikipedia/search/SearchFragment.java
+++ b/app/src/main/java/org/wikipedia/search/SearchFragment.java
@@ -39,6 +39,7 @@
 
 import butterknife.BindView;
 import butterknife.ButterKnife;
+import butterknife.OnClick;
 import butterknife.Unbinder;
 
 public class SearchFragment extends Fragment implements BackPressedHandler,
@@ -118,7 +119,7 @@
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 app = WikipediaApp.getInstance();
-funnel = new SearchFunnel(WikipediaApp.getInstance(), 
SearchInvokeSource.of(invokeSource.code()));
+funnel = new SearchFunnel(app, 
SearchInvokeSource.of(invokeSource.code()));
 }
 
 @Override
@@ -132,15 +133,6 @@
 app = WikipediaApp.getInstance();
 View view = inflater.inflate(R.layout.fragment_search, container, 
false);
 unbinder = ButterKnife.bind(this, view);
-
-searchContainer.setOnClickListener(new View.OnClickListener() {
-@Override
-public void onClick(View view) {
-// Give the root container view an empty click handler, so 
that click events won't
-// get passed down to any underlying views (e.g. a 
PageFragment on top of which
-// this fragment is shown)
-}
-});
 
 FragmentManager childFragmentManager = getChildFragmentManager();
 recentSearchesFragment = 
(RecentSearchesFragment)childFragmentManager.findFragmentById(
@@ -332,6 +324,16 @@
 updateZeroChrome();
 }
 
+@OnClick(R.id.search_container) void onSearchContainerClick() {
+// Give the root container view an empty click handler, so that click 
events won't
+// get passed down to any underlying views (e.g. a PageFragment on top 
of which
+// this fragment is shown)
+}
+
+@OnClick(R.id.search_lang_button_container) void onLangButtonClick() {
+showLangPreferenceDialog();
+}
+
 /**
  * Show a particular panel, which can be one of:
  * - PANEL_RECENT_SEARCHES
@@ -390,12 +392,6 @@
 private void initLangButton() {
 langButton.setText(app.getAppOrSystemLanguageCode().toUpperCase());
 formatLangButtonText();
-langButtonContainer.setOnClickListener(new View.OnClickListener() {
-@Override
-public void onClick(View v) {
-showLangPreferenceDialog();
-}
-});
 FeedbackUtil.setToolbarButtonLongPressToast(langButtonContainer);
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I14af19ea104d36424d86e31cea1edbc75080b2d4
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
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...CirrusSearch[master]: Augmenting search results

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Augmenting search results
..


Augmenting search results

Change-Id: I244c40b603acdc1e57d761472ce8180941a6a430
Depends-On: Ia5413a7846cc961026a2dc3542b619493bc76a23
Bug: T117493
---
M includes/Search/ResultSet.php
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Search/ResultSet.php b/includes/Search/ResultSet.php
index 2e34af7..446e657 100644
--- a/includes/Search/ResultSet.php
+++ b/includes/Search/ResultSet.php
@@ -247,7 +247,9 @@
$current = $this->result->current();
if ( $current ) {
$this->result->next();
-   return new Result( $this->result, $current, 
$this->interwikiPrefix );
+   $result = new Result( $this->result, $current, 
$this->interwikiPrefix );
+   $this->augmentResult( $result );
+   return $result;
}
return false;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I244c40b603acdc1e57d761472ce8180941a6a430
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Cindy-the-browser-test-bot 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Manybubbles 
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]: Infrastructure for augmenting search results

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Infrastructure for augmenting search results
..


Infrastructure for augmenting search results

Bug: T117493
Change-Id: Ia5413a7846cc961026a2dc3542b619493bc76a23
---
M autoload.php
M docs/hooks.txt
A includes/search/AugmentPageProps.php
A includes/search/PerRowAugmentor.php
A includes/search/ResultAugmentor.php
A includes/search/ResultSetAugmentor.php
M includes/search/SearchEngine.php
M includes/search/SearchNearMatchResultSet.php
M includes/search/SearchResult.php
M includes/search/SearchResultSet.php
M includes/search/SqlSearchResultSet.php
M includes/specials/SpecialSearch.php
M tests/phpunit/includes/search/SearchEngineTest.php
13 files changed, 303 insertions(+), 10 deletions(-)

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



diff --git a/autoload.php b/autoload.php
index 96c8190..9fd83eb 100644
--- a/autoload.php
+++ b/autoload.php
@@ -153,6 +153,7 @@
'AtomFeed' => __DIR__ . '/includes/Feed.php',
'AtomicSectionUpdate' => __DIR__ . 
'/includes/deferred/AtomicSectionUpdate.php',
'AttachLatest' => __DIR__ . '/maintenance/attachLatest.php',
+   'AugmentPageProps' => __DIR__ . '/includes/search/AugmentPageProps.php',
'AuthManagerSpecialPage' => __DIR__ . 
'/includes/specialpage/AuthManagerSpecialPage.php',
'AuthPlugin' => __DIR__ . '/includes/AuthPlugin.php',
'AuthPluginUser' => __DIR__ . '/includes/AuthPlugin.php',
@@ -1043,6 +1044,7 @@
'PatrolLog' => __DIR__ . '/includes/logging/PatrolLog.php',
'PatrolLogFormatter' => __DIR__ . 
'/includes/logging/PatrolLogFormatter.php',
'Pbkdf2Password' => __DIR__ . '/includes/password/Pbkdf2Password.php',
+   'PerRowAugmentor' => __DIR__ . '/includes/search/PerRowAugmentor.php',
'PermissionsError' => __DIR__ . 
'/includes/exception/PermissionsError.php',
'PhpHttpRequest' => __DIR__ . '/includes/HttpFunctions.php',
'PhpXmlBugTester' => __DIR__ . '/includes/installer/PhpBugTests.php',
@@ -1182,6 +1184,8 @@
'ResourceLoaderUserTokensModule' => __DIR__ . 
'/includes/resourceloader/ResourceLoaderUserTokensModule.php',
'ResourceLoaderWikiModule' => __DIR__ . 
'/includes/resourceloader/ResourceLoaderWikiModule.php',
'RestbaseVirtualRESTService' => __DIR__ . 
'/includes/libs/virtualrest/RestbaseVirtualRESTService.php',
+   'ResultAugmentor' => __DIR__ . '/includes/search/ResultAugmentor.php',
+   'ResultSetAugmentor' => __DIR__ . 
'/includes/search/ResultSetAugmentor.php',
'ResultWrapper' => __DIR__ . 
'/includes/libs/rdbms/database/resultwrapper/ResultWrapper.php',
'RevDelArchiveItem' => __DIR__ . 
'/includes/revisiondelete/RevDelArchiveItem.php',
'RevDelArchiveList' => __DIR__ . 
'/includes/revisiondelete/RevDelArchiveList.php',
diff --git a/docs/hooks.txt b/docs/hooks.txt
index a7fb873..ae0770b 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -2699,6 +2699,13 @@
 $output: ParserOutput that is produced from the page
 $engine: SearchEngine for which the indexing is intended
 
+'SearchResultsAugment': Allows extension to add its code to the list of search
+result augmentors.
+&$setAugmentors: List of whole-set augmentor objects, must implement 
ResultSetAugmentor
+&$rowAugmentors: List of per-row augmentor objects, must implement 
ResultAugmentor.
+Note that lists should be in the format name => object and the names in both 
lists should
+be distinct.
+
 'SecondaryDataUpdates': Allows modification of the list of DataUpdates to
 perform when page content is modified. Currently called by
 AbstractContent::getSecondaryDataUpdates.
diff --git a/includes/search/AugmentPageProps.php 
b/includes/search/AugmentPageProps.php
new file mode 100644
index 000..29bd463
--- /dev/null
+++ b/includes/search/AugmentPageProps.php
@@ -0,0 +1,20 @@
+propnames = $propnames;
+   }
+
+   public function augmentAll( SearchResultSet $resultSet ) {
+   $titles = $resultSet->extractTitles();
+   return PageProps::getInstance()->getProperties( $titles, 
$this->propnames );
+   }
+}
diff --git a/includes/search/PerRowAugmentor.php 
b/includes/search/PerRowAugmentor.php
new file mode 100644
index 000..8eb8b17
--- /dev/null
+++ b/includes/search/PerRowAugmentor.php
@@ -0,0 +1,38 @@
+rowAugmentor = $augmentor;
+   }
+
+   /**
+* Produce data to augment search result set.
+* @param SearchResultSet $resultSet
+* @return array Data for all results
+*/
+   public function augmentAll( SearchResultSet $resultSet ) {
+   $data = [];
+   foreach ( $resultSet->extractResults() as $result ) {
+   $id = $result->getTitle()->getArticleID();
+   if ( !$id ) {
+   continue;
+   }
+   

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: refactor SearchFragment

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: refactor SearchFragment
..


Hygiene: refactor SearchFragment

• Move SearchFragment.InvokeSource to separate file, SearchInvokeSource.
  This enum was at home in SearchFragment but is large and independent.

• Move SearchFragment variables to the top of the class.

• Group public SearchFragment methods at the top of the class.

• Make showLangPreferenceDialog() private because it can be.

No functional changes intended.

Change-Id: Ice0531d005db762aee6e49d49a8e638a2839cb4e
---
M app/src/main/java/org/wikipedia/MainFragment.java
M app/src/main/java/org/wikipedia/analytics/SearchFunnel.java
M app/src/main/java/org/wikipedia/page/PageActivity.java
M app/src/main/java/org/wikipedia/search/SearchFragment.java
A app/src/main/java/org/wikipedia/search/SearchInvokeSource.java
5 files changed, 133 insertions(+), 130 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/MainFragment.java 
b/app/src/main/java/org/wikipedia/MainFragment.java
index 93fe21e..3830523 100644
--- a/app/src/main/java/org/wikipedia/MainFragment.java
+++ b/app/src/main/java/org/wikipedia/MainFragment.java
@@ -47,6 +47,7 @@
 import org.wikipedia.readinglist.AddToReadingListDialog;
 import org.wikipedia.readinglist.ReadingListsFragment;
 import org.wikipedia.search.SearchFragment;
+import org.wikipedia.search.SearchInvokeSource;
 import org.wikipedia.search.SearchResultsFragment;
 import org.wikipedia.settings.Prefs;
 import org.wikipedia.settings.SettingsActivity;
@@ -136,7 +137,7 @@
 && resultCode == Activity.RESULT_OK && data != null
 && 
data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS) != null) {
 String searchQuery = 
data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS).get(0);
-openSearchFromIntent(searchQuery, 
SearchFragment.InvokeSource.VOICE);
+openSearchFromIntent(searchQuery, SearchInvokeSource.VOICE);
 } else if (requestCode == Constants.ACTIVITY_REQUEST_GALLERY
 && resultCode == 
GalleryActivity.ACTIVITY_RESULT_FILEPAGE_SELECT) {
 startActivity(data);
@@ -213,16 +214,16 @@
 && Constants.PLAIN_TEXT_MIME_TYPE.equals(intent.getType())) {
 funnel.logShareIntent();
 openSearchFromIntent(intent.getStringExtra(Intent.EXTRA_TEXT),
-SearchFragment.InvokeSource.INTENT_SHARE);
+SearchInvokeSource.INTENT_SHARE);
 } else if (Intent.ACTION_PROCESS_TEXT.equals(intent.getAction())
 && Constants.PLAIN_TEXT_MIME_TYPE.equals(intent.getType())
 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
 funnel.logProcessTextIntent();
 
openSearchFromIntent(intent.getStringExtra(Intent.EXTRA_PROCESS_TEXT),
-SearchFragment.InvokeSource.INTENT_PROCESS_TEXT);
+SearchInvokeSource.INTENT_PROCESS_TEXT);
 } else if (intent.hasExtra(Constants.INTENT_SEARCH_FROM_WIDGET)) {
 funnel.logSearchWidgetTap();
-openSearchFromIntent(null, SearchFragment.InvokeSource.WIDGET);
+openSearchFromIntent(null, SearchInvokeSource.WIDGET);
 } else if (lastPageViewedWithin(1)) {
 startActivity(PageActivity.newIntent(getContext()));
 }
@@ -251,7 +252,7 @@
 }
 
 @Override public void onFeedSearchRequested() {
-searchFragment.setInvokeSource(SearchFragment.InvokeSource.FEED_BAR);
+searchFragment.setInvokeSource(SearchInvokeSource.FEED_BAR);
 searchFragment.openSearch();
 }
 
@@ -438,7 +439,7 @@
 }
 
 public void openSearchFromIntent(@Nullable final String query,
-  final SearchFragment.InvokeSource 
source) {
+  final SearchInvokeSource source) {
 tabLayout.post(new Runnable() {
 @Override
 public void run() {
diff --git a/app/src/main/java/org/wikipedia/analytics/SearchFunnel.java 
b/app/src/main/java/org/wikipedia/analytics/SearchFunnel.java
index 63f2844..08a7748 100644
--- a/app/src/main/java/org/wikipedia/analytics/SearchFunnel.java
+++ b/app/src/main/java/org/wikipedia/analytics/SearchFunnel.java
@@ -4,14 +4,14 @@
 
 import org.json.JSONObject;
 import org.wikipedia.WikipediaApp;
-import org.wikipedia.search.SearchFragment;
+import org.wikipedia.search.SearchInvokeSource;
 
 public class SearchFunnel extends Funnel {
 private static final String SCHEMA_NAME = "MobileWikiAppSearch";
 private static final int REVISION = 15729321;
-private SearchFragment.InvokeSource source;
+private SearchInvokeSource source;
 
-public SearchFunnel(WikipediaApp app, SearchFragment.InvokeSource source) {
+public 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Null View listener in SearchFragment.onDestroyView

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Null View listener in SearchFragment.onDestroyView
..


Null View listener in SearchFragment.onDestroyView

Change-Id: I913be47d9deb04b228521b3dfc97bc835a566f93
---
M app/src/main/java/org/wikipedia/search/SearchFragment.java
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/search/SearchFragment.java 
b/app/src/main/java/org/wikipedia/search/SearchFragment.java
index a769274..4321e1d 100644
--- a/app/src/main/java/org/wikipedia/search/SearchFragment.java
+++ b/app/src/main/java/org/wikipedia/search/SearchFragment.java
@@ -173,6 +173,8 @@
 
 @Override
 public void onDestroyView() {
+searchView.setOnCloseListener(null);
+searchView.setOnQueryTextListener(null);
 unbinder.unbind();
 unbinder = null;
 super.onDestroyView();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I913be47d9deb04b228521b3dfc97bc835a566f93
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
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]: Hygiene: use @BindView for SearchFragment View

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: use @BindView for SearchFragment View
..


Hygiene: use @BindView for SearchFragment View

Change-Id: If395bfe424376385633b17fcea91c5693dac2b05
---
M app/src/main/java/org/wikipedia/search/SearchFragment.java
1 file changed, 2 insertions(+), 4 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/search/SearchFragment.java 
b/app/src/main/java/org/wikipedia/search/SearchFragment.java
index 99689df..a769274 100644
--- a/app/src/main/java/org/wikipedia/search/SearchFragment.java
+++ b/app/src/main/java/org/wikipedia/search/SearchFragment.java
@@ -98,14 +98,14 @@
 private Unbinder unbinder;
 
 private WikipediaApp app;
-private EditText searchEditText;
+@BindView(android.support.v7.appcompat.R.id.search_src_text) EditText 
searchEditText;
 private SearchFunnel funnel;
 private InvokeSource invokeSource = InvokeSource.TOOLBAR;
 
 /**
  * Whether the Search fragment is currently showing.
  */
-private boolean isSearchActive = false;
+private boolean isSearchActive;
 
 /**
  * The last search term that the user entered. This will be passed into
@@ -354,8 +354,6 @@
 searchView.setOnQueryTextListener(searchQueryListener);
 searchView.setOnCloseListener(searchCloseListener);
 
-searchEditText = (EditText) searchView
-
.findViewById(android.support.v7.appcompat.R.id.search_src_text);
 // reset its background
 searchEditText.setBackgroundColor(Color.TRANSPARENT);
 // make the search frame match_parent

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If395bfe424376385633b17fcea91c5693dac2b05
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
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]: Fix Fragment crash when leaving GalleryActivity

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix Fragment crash when leaving GalleryActivity
..


Fix Fragment crash when leaving GalleryActivity

The GalleryActivity manipulates Fragments in strange ways. Undo the
performance changs in 3c6e0b5. The Activity no longer crashes but
loses the currently viewed image until the Activity is closed.

Bug: T145700
Bug: T145802
Change-Id: Id2aaaf8537fe123029e881ecaee97515e17a8acf
---
M app/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java 
b/app/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java
index 5690b9a..00e81ea 100644
--- a/app/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java
+++ b/app/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java
@@ -10,7 +10,7 @@
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentStatePagerAdapter;
+import android.support.v4.app.FragmentPagerAdapter;
 import android.support.v4.app.FragmentTransaction;
 import android.support.v4.view.ViewPager;
 import android.support.v7.widget.Toolbar;
@@ -570,7 +570,7 @@
  * Each media item will be represented by a GalleryItemFragment, which 
will be instantiated
  * lazily, and then cached for future use.
  */
-private class GalleryItemAdapter extends FragmentStatePagerAdapter {
+private class GalleryItemAdapter extends FragmentPagerAdapter {
 private GalleryCollection galleryCollection;
 private SparseArray fragmentArray;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2aaaf8537fe123029e881ecaee97515e17a8acf
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Niedzielski 
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]: Fix two NPEs in nearby

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix two NPEs in nearby
..


Fix two NPEs in nearby

• Respect Fragment / View lifecyels per 56a5e7a:

Call MapView.onDestroy in Fragment.onDestroyView()

After switching to Butter Knife in 715b322, the MapView's lifecycle
was properly accounted for as Fragment.onCreateView() to
onDestroyView(). In 8b63ffb, a null check was added to
Fragment.onDestroy() where MapView.onDestroy() was called per
documentation. However, this can't be correct because MapView will
always be null at this time. Move the call to
Fragment.onDestroyView() instead of checking for null.

• Android lifecycles are nuttier than chunky peanut butter. The docs[0]
  stress that onSaveInstanceState() may be called at any time before
  onDestroy(). This means the View hierarchy may have been destroyed and
  nulled by onSaveInstanceState() invocation and must be checked before
  used.

[0] 
https://developer.android.com/reference/android/support/v4/app/Fragment.html#onSaveInstanceState(android.os.Bundle)

Bug: T145705
Change-Id: I3f1e493bbab8b5b1973b87affe82d3e29801d45a
---
M app/src/main/java/org/wikipedia/nearby/NearbyFragment.java
1 file changed, 5 insertions(+), 3 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/nearby/NearbyFragment.java 
b/app/src/main/java/org/wikipedia/nearby/NearbyFragment.java
index 0a7990e..232dac9 100644
--- a/app/src/main/java/org/wikipedia/nearby/NearbyFragment.java
+++ b/app/src/main/java/org/wikipedia/nearby/NearbyFragment.java
@@ -123,18 +123,20 @@
 }
 
 @Override
-public void onDestroy() {
+public void onDestroyView() {
 mapView.onDestroy();
 mapboxMap = null;
 unbinder.unbind();
 unbinder = null;
-super.onDestroy();
+super.onDestroyView();
 }
 
 @Override
 public void onSaveInstanceState(Bundle outState) {
 super.onSaveInstanceState(outState);
-mapView.onSaveInstanceState(outState);
+if (mapView != null) {
+mapView.onSaveInstanceState(outState);
+}
 if (lastResult != null) {
 outState.putParcelable(NEARBY_CURRENT_LOCATION, currentLocation);
 outState.putParcelable(NEARBY_LAST_RESULT, lastResult);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3f1e493bbab8b5b1973b87affe82d3e29801d45a
Gerrit-PatchSet: 2
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
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]: Hygiene: remove dead code in FeaturedImageCard

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: remove dead code in FeaturedImageCard
..


Hygiene: remove dead code in FeaturedImageCard

Change-Id: I6b155e2931f5710f8ab58d4d3267707bf095f225
---
M app/src/main/java/org/wikipedia/feed/image/FeaturedImageCard.java
1 file changed, 1 insertion(+), 8 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCard.java 
b/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCard.java
index 2417660..120a5c5 100644
--- a/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCard.java
+++ b/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCard.java
@@ -7,8 +7,8 @@
 import org.wikipedia.R;
 import org.wikipedia.Site;
 import org.wikipedia.WikipediaApp;
-import org.wikipedia.feed.model.UtcDate;
 import org.wikipedia.feed.model.Card;
+import org.wikipedia.feed.model.UtcDate;
 import org.wikipedia.util.DateUtil;
 
 public class FeaturedImageCard extends Card {
@@ -63,13 +63,6 @@
 @Nullable
 public String description() {
 return featuredImage.description();
-}
-
-//Expose the language of the returned description in case we want to hide 
it if it doesn't match
-//the request Site language
-@Nullable
-public String descriptionLang() {
-return featuredImage.descriptionLang();
 }
 
 @Override

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6b155e2931f5710f8ab58d4d3267707bf095f225
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
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]: Thoroughly fix feed card equals contracts

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Thoroughly fix feed card equals contracts
..


Thoroughly fix feed card equals contracts

2cb18da patched BecauseYouReadCard.equals() but missed other omissions.
This patch fixes all cases and leverages Card.equals() and hashCode()
inherited from the reflective BaseModel. A future patch may benefit from
implementing a marker pattern on Cards that are dismissable.

Change-Id: I0b91d1cd61e645469326182fa85ffc1fa6817b58
---
M app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCard.java
M app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCard.java
M app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCard.java
M app/src/main/java/org/wikipedia/feed/image/FeaturedImageCard.java
M app/src/main/java/org/wikipedia/feed/model/Card.java
M app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java
M app/src/main/java/org/wikipedia/feed/news/NewsListCard.java
M app/src/main/java/org/wikipedia/feed/random/RandomCard.java
8 files changed, 12 insertions(+), 13 deletions(-)

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



diff --git 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCard.java 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCard.java
index 02bd76f..a980dab 100644
--- 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCard.java
+++ 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCard.java
@@ -51,11 +51,7 @@
 }
 
 @Override
-public int hashCode() {
+protected int dismissHashCode() {
 return entry.getTitle().hashCode();
-}
-
-@Override public boolean equals(Object other) {
-return entry.getTitle().equals(other);
 }
 }
\ No newline at end of file
diff --git 
a/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCard.java 
b/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCard.java
index 2f2fd6c..54840d6 100644
--- 
a/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCard.java
+++ 
b/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCard.java
@@ -42,7 +42,7 @@
 }
 
 @Override
-public int hashCode() {
+protected int dismissHashCode() {
 return entry.getTitle().hashCode();
 }
 }
\ No newline at end of file
diff --git 
a/app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCard.java 
b/app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCard.java
index 91fb52b..65c0c99 100644
--- a/app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCard.java
+++ b/app/src/main/java/org/wikipedia/feed/featured/FeaturedArticleCard.java
@@ -77,7 +77,7 @@
 }
 
 @Override
-public int hashCode() {
+protected int dismissHashCode() {
 return page.title().hashCode();
 }
 }
diff --git a/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCard.java 
b/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCard.java
index 1ed0b49..2417660 100644
--- a/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCard.java
+++ b/app/src/main/java/org/wikipedia/feed/image/FeaturedImageCard.java
@@ -73,7 +73,7 @@
 }
 
 @Override
-public int hashCode() {
+protected int dismissHashCode() {
 return featuredImage.title().hashCode();
 }
 }
diff --git a/app/src/main/java/org/wikipedia/feed/model/Card.java 
b/app/src/main/java/org/wikipedia/feed/model/Card.java
index 6f6a085..27fb306 100644
--- a/app/src/main/java/org/wikipedia/feed/model/Card.java
+++ b/app/src/main/java/org/wikipedia/feed/model/Card.java
@@ -22,8 +22,11 @@
 return null;
 }
 
-// TODO: enforce a contract for subclasses of Card to implement hashCode()
 public String getHideKey() {
-return Long.toString(FeedRecyclerAdapter.getCardType(this) + 
hashCode());
+return Long.toString(FeedRecyclerAdapter.getCardType(this) + 
dismissHashCode());
+}
+
+protected int dismissHashCode() {
+return hashCode();
 }
 }
\ No newline at end of file
diff --git 
a/app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java 
b/app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java
index fc0669a..a2143db 100644
--- a/app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java
+++ b/app/src/main/java/org/wikipedia/feed/mostread/MostReadListCard.java
@@ -51,7 +51,7 @@
 }
 
 @Override
-public int hashCode() {
+protected int dismissHashCode() {
 return (int) TimeUnit.MILLISECONDS.toDays(articles.date().getTime());
 }
 }
diff --git a/app/src/main/java/org/wikipedia/feed/news/NewsListCard.java 
b/app/src/main/java/org/wikipedia/feed/news/NewsListCard.java
index 47832a3..267c9bc 100644
--- a/app/src/main/java/org/wikipedia/feed/news/NewsListCard.java
+++ 

[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Revert "Update DonationInterface submodule"

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert "Update DonationInterface submodule"
..


Revert "Update DonationInterface submodule"

This reverts commit 609c1e5f03ddcd9d72f562d7911cf77cc459371b.

Change-Id: I88e9cb1c30bf9745a1f8a5ebe6c6c4437295e0ac
---
M extensions/DonationInterface
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 8725fd4..8d17a05 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
@@ -1 +1 @@
-Subproject commit 8725fd441c074fb90e37bb294d350669e6665260
+Subproject commit 8d17a058e6d37f4b09aeb57ae83cc53cc4735130

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I88e9cb1c30bf9745a1f8a5ebe6c6c4437295e0ac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_27
Gerrit-Owner: Awight 
Gerrit-Reviewer: Awight 
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]: Add one more level for GlobalTitleFail logging

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add one more level for GlobalTitleFail logging
..


Add one more level for GlobalTitleFail logging

htmlspecialchars/Message->__toString/Message->toString/Message->parseText/MessageCache->parse
is useless without the caller of htmlspecialchars().

Change-Id: I2dad5a487225a11b98149610f1c775057f8baad2
---
M includes/cache/MessageCache.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index d254d3d..e871855 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -1089,7 +1089,7 @@
if ( !$title || !$title instanceof Title ) {
global $wgTitle;
wfDebugLog( 'GlobalTitleFail', __METHOD__ . ' called by 
' .
-   wfGetAllCallers( 5 ) . ' with no title set.' );
+   wfGetAllCallers( 6 ) . ' with no title set.' );
$title = $wgTitle;
}
// Sometimes $wgTitle isn't set either...

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2dad5a487225a11b98149610f1c775057f8baad2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Aaron Schulz 
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...golden[master]: Fix bugs in clickthrough rate

2016-09-15 Thread Chelsyx (Code Review)
Chelsyx has submitted this change and it was merged.

Change subject: Fix bugs in clickthrough rate
..


Fix bugs in clickthrough rate

Bug: 138107
Change-Id: I35c37a5024b2f5a8637aae853f2f20e15b5e75c9
---
M portal/portal.R
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/portal/portal.R b/portal/portal.R
index eec1ffa..f5ae958 100644
--- a/portal/portal.R
+++ b/portal/portal.R
@@ -130,12 +130,12 @@
 dplyr::group_by(session) %>%
 dplyr::mutate(visit = cumsum(type == "landing")) %>%
 dplyr::group_by(date, country, session, visit) %>%
-dplyr::summarize(dummy_clt = sum(type=="clickthrough")>1) %>%
+dplyr::summarize(dummy_clt = sum(type=="clickthrough")>0) %>%
 dplyr::group_by(country) %>%
 dplyr::summarize(n_visit = n(), ctr_visit = round(sum(dummy_clt)/n(), 4))
   ctr_session <- data_w_countryname %>%
 dplyr::group_by(date, country, session) %>%
-dplyr::summarize(dummy_clt = sum(type=="clickthrough")>1) %>%
+dplyr::summarize(dummy_clt = sum(type=="clickthrough")>0) %>%
 dplyr::group_by(country) %>%
 dplyr::summarize(n_session = n(), ctr_session = round(sum(dummy_clt)/n(), 
4)) 
   all_country_data <- data_w_countryname %>%

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I35c37a5024b2f5a8637aae853f2f20e15b5e75c9
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/discovery/golden
Gerrit-Branch: master
Gerrit-Owner: Chelsyx 
Gerrit-Reviewer: Chelsyx 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: One more Configuration call needing staticization

2016-09-15 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: One more Configuration call needing staticization
..

One more Configuration call needing staticization

Change-Id: If3ba5792fcffa2736e064d8d093dc71cbcc37b5e
---
M sites/all/modules/queue2civicrm/banner_history/banner_history.module
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/58/311058/1

diff --git 
a/sites/all/modules/queue2civicrm/banner_history/banner_history.module 
b/sites/all/modules/queue2civicrm/banner_history/banner_history.module
index 8492429..b3f4f11 100644
--- a/sites/all/modules/queue2civicrm/banner_history/banner_history.module
+++ b/sites/all/modules/queue2civicrm/banner_history/banner_history.module
@@ -74,7 +74,7 @@
watchdog( 'banner_history', 'Executing: banner_history_queue_consume' );
 
civicrm_initialize();
-$config = new Configuration();
+$config = Configuration::createForView();
 Context::initWithLogger( $config, 'banner_history' );
 
$queue = variable_get( 'banner_history_queue', 'banner-history' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3ba5792fcffa2736e064d8d093dc71cbcc37b5e
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet Panel: Speed up role formatting

2016-09-15 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Puppet Panel:  Speed up role formatting
..

Puppet Panel:  Speed up role formatting

These format functions are really the responsiblity of the view,
but moving them into the model (puppet_roles.py) allows us to
cache the formatted role properties.  This should save us a tiny
bit of render time.

Bug: T91990
Change-Id: I1af176860e6c0ac42012f2a0bd8c349f19c74e11
---
M modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
M modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
2 files changed, 21 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/57/311057/1

diff --git a/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py 
b/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
index 12e41fb..69bf466 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
@@ -18,6 +18,8 @@
 
 from django.conf import settings
 from django.core.cache import cache
+from django.utils.html import escape
+from django.utils.safestring import mark_safe
 from django.utils.translation import ugettext_lazy as _
 
 logging.basicConfig()
@@ -28,18 +30,22 @@
 #  for our Horizon table-of-roles UI
 class PuppetClass():
 name = None
+html_name = ""
 docs = ""
 applied = False
 params = []
+formatted_params = ""
 raw_params = {}
 filter_tags = []
 instance = None
 
 def __init__(self, name):
 self.name = name
+self.html_name = ""
 self.docs = _('(No docs available)')
 self.applied = False
 self.params = []
+self.formatted_params = ""
 self.raw_params = {}
 self.filter_tags = []
 self.instance = None
@@ -52,6 +58,12 @@
 def mark_applied(self, paramdict):
 self.applied = True
 self.params = paramdict
+if paramdict:
+keysanddefaults = []
+for param in self.params.items():
+keysanddefaults.append("%s: %s" % param)
+self.formatted_params = ";\n".join(keysanddefaults)
+
 return self
 
 
@@ -100,6 +112,13 @@
 newdoc += "%s\n" % line
 obj.docs = newdoc
 
+simplename = obj.name.split('role::')[1]
+html = '%s ' % (
+escape(simplename),
+escape(obj.docs)
+)
+obj.html_name = mark_safe(html)
+
 roles.append(obj)
 
 cache.set(key, roles, 300)
diff --git a/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py 
b/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
index fab2e6e..38f1d0a 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
@@ -19,31 +19,10 @@
 from django.core import urlresolvers
 from django.utils.translation import ugettext_lazy as _
 
-from django.utils.html import escape
-from django.utils.safestring import mark_safe
-
 from horizon import tables
 
 logging.basicConfig()
 LOG = logging.getLogger(__name__)
-
-
-def get_formatted_name(classrecord):
-name = classrecord.name.split('role::')[1]
-title = classrecord.docs
-html = '%s ' % (
-escape(name),
-escape(title)
-)
-return mark_safe(html)
-
-
-def get_formatted_params(classrecord):
-if classrecord.params:
-keysanddefaults = []
-for param in classrecord.params.items():
-keysanddefaults.append("%s: %s" % param)
-return(";\n".join(keysanddefaults))
 
 
 class RemoveRole(tables.LinkAction):
@@ -130,9 +109,9 @@
 
 class PuppetTable(tables.DataTable):
 applied = tables.Column('applied', verbose_name=_('Applied'), status=True)
-name = tables.Column(get_formatted_name,
+name = tables.Column('html_name',
  verbose_name=_('Name'))
-params = tables.Column(get_formatted_params,
+params = tables.Column('formatted_params',
verbose_name=_('Parameters'),
sortable=False)
 instance = tables.Column('instance',
@@ -155,7 +134,3 @@
 
 def get_object_id(self, datum):
 return datum.name
-
-def render_to_response(self, context, **response_kwargs):
-LOG.warn("render_to_response 2: %s" %
- self.request.GET.get('format', 'html'))

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

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

[MediaWiki-commits] [Gerrit] mediawiki...OAuth[master]: Fix gender in Echo messages

2016-09-15 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Fix gender in Echo messages
..

Fix gender in Echo messages

Change-Id: I265d20dd9df1790eaee44a26cd5fc9919ecc38ba
---
M i18n/en.json
1 file changed, 10 insertions(+), 10 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index d6a0704..daa1053 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -253,17 +253,17 @@
"echo-category-title-oauth-admin": "OAuth admin",
"echo-pref-tooltip-oauth-admin": "Notify me about events related to 
reviewing OAuth applications",
"notification-oauth-app-propose-title": "$1 {{GENDER:$1|proposed}} a 
new OAuth app: $2",
-   "notification-oauth-app-update-title": "$1 {{GENDER:$2|updated}} the 
OAuth app $2",
-   "notification-oauth-app-approve-title": "$1 {{GENDER:$2|approved}} 
{{GENDER:$3|your}} OAuth app ($2)",
-   "notification-oauth-app-reject-title": "$1 {{GENDER:$2|rejected}} 
{{GENDER:$3|your}} OAuth app ($2)",
-   "notification-oauth-app-disable-title": "$1 {{GENDER:$2|disabled}} 
{{GENDER:$3|your}} OAuth app ($2)",
-   "notification-oauth-app-reenable-title": "$1 {{GENDER:$2|reenabled}} 
{{GENDER:$3|your}} OAuth app ($2)",
+   "notification-oauth-app-update-title": "$1 {{GENDER:$1|updated}} the 
OAuth app $2",
+   "notification-oauth-app-approve-title": "$1 {{GENDER:$1|approved}} 
{{GENDER:$3|your}} OAuth app ($2)",
+   "notification-oauth-app-reject-title": "$1 {{GENDER:$1|rejected}} 
{{GENDER:$3|your}} OAuth app ($2)",
+   "notification-oauth-app-disable-title": "$1 {{GENDER:$1|disabled}} 
{{GENDER:$3|your}} OAuth app ($2)",
+   "notification-oauth-app-reenable-title": "$1 {{GENDER:$1|reenabled}} 
{{GENDER:$3|your}} OAuth app ($2)",
"notification-oauth-app-propose-subject": "$1 {{GENDER:$1|proposed}} a 
new OAuth app on {{SITENAME}}",
-   "notification-oauth-app-update-subject": "$1 {{GENDER:$2|updated}} an 
OAuth app on {{SITENAME}}",
-   "notification-oauth-app-approve-subject": "$1 {{GENDER:$2|approved}} 
{{GENDER:$3|your}} OAuth app on {{SITENAME}}",
-   "notification-oauth-app-reject-subject": "$1 {{GENDER:$2|rejected}} 
{{GENDER:$3|your}} OAuth app on {{SITENAME}}",
-   "notification-oauth-app-disable-subject": "$1 {{GENDER:$2|disabled}} 
{{GENDER:$3|your}} OAuth app on {{SITENAME}}",
-   "notification-oauth-app-reenable-subject": "$1 {{GENDER:$2|reenabled}} 
{{GENDER:$3|your}} OAuth app on {{SITENAME}}",
+   "notification-oauth-app-update-subject": "$1 {{GENDER:$1|updated}} an 
OAuth app on {{SITENAME}}",
+   "notification-oauth-app-approve-subject": "$1 {{GENDER:$1|approved}} 
{{GENDER:$3|your}} OAuth app on {{SITENAME}}",
+   "notification-oauth-app-reject-subject": "$1 {{GENDER:$1|rejected}} 
{{GENDER:$3|your}} OAuth app on {{SITENAME}}",
+   "notification-oauth-app-disable-subject": "$1 {{GENDER:$1|disabled}} 
{{GENDER:$3|your}} OAuth app on {{SITENAME}}",
+   "notification-oauth-app-reenable-subject": "$1 {{GENDER:$1|reenabled}} 
{{GENDER:$3|your}} OAuth app on {{SITENAME}}",
"notification-oauth-app-propose-primary-link": "Review app",
"notification-oauth-app-update-primary-link": "Review app",
"notification-oauth-app-approve-primary-link": "View app",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I265d20dd9df1790eaee44a26cd5fc9919ecc38ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 

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


[MediaWiki-commits] [Gerrit] wikimedia...golden[master]: Fix bugs in clickthrough rate

2016-09-15 Thread Chelsyx (Code Review)
Chelsyx has uploaded a new change for review.

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

Change subject: Fix bugs in clickthrough rate
..

Fix bugs in clickthrough rate

Bug: 138107
Change-Id: I35c37a5024b2f5a8637aae853f2f20e15b5e75c9
---
M portal/portal.R
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/golden 
refs/changes/55/311055/1

diff --git a/portal/portal.R b/portal/portal.R
index eec1ffa..f5ae958 100644
--- a/portal/portal.R
+++ b/portal/portal.R
@@ -130,12 +130,12 @@
 dplyr::group_by(session) %>%
 dplyr::mutate(visit = cumsum(type == "landing")) %>%
 dplyr::group_by(date, country, session, visit) %>%
-dplyr::summarize(dummy_clt = sum(type=="clickthrough")>1) %>%
+dplyr::summarize(dummy_clt = sum(type=="clickthrough")>0) %>%
 dplyr::group_by(country) %>%
 dplyr::summarize(n_visit = n(), ctr_visit = round(sum(dummy_clt)/n(), 4))
   ctr_session <- data_w_countryname %>%
 dplyr::group_by(date, country, session) %>%
-dplyr::summarize(dummy_clt = sum(type=="clickthrough")>1) %>%
+dplyr::summarize(dummy_clt = sum(type=="clickthrough")>0) %>%
 dplyr::group_by(country) %>%
 dplyr::summarize(n_session = n(), ctr_session = round(sum(dummy_clt)/n(), 
4)) 
   all_country_data <- data_w_countryname %>%

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35c37a5024b2f5a8637aae853f2f20e15b5e75c9
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/discovery/golden
Gerrit-Branch: master
Gerrit-Owner: Chelsyx 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Revert "Update DonationInterface submodule"

2016-09-15 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Revert "Update DonationInterface submodule"
..

Revert "Update DonationInterface submodule"

This reverts commit 609c1e5f03ddcd9d72f562d7911cf77cc459371b.

Change-Id: I88e9cb1c30bf9745a1f8a5ebe6c6c4437295e0ac
---
M extensions/DonationInterface
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/54/311054/1

diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 8725fd4..8d17a05 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
@@ -1 +1 @@
-Subproject commit 8725fd441c074fb90e37bb294d350669e6665260
+Subproject commit 8d17a058e6d37f4b09aeb57ae83cc53cc4735130

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88e9cb1c30bf9745a1f8a5ebe6c6c4437295e0ac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_27
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Split out ConvertableTimestamp class

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Split out ConvertableTimestamp class
..

Split out ConvertableTimestamp class

* Make TimestampException a regular exception.
* Make DatabaseBase use ConvertableTimestamp.

Change-Id: I849737c9c187e8e0c6e080887ec0656e034f80d2
---
M autoload.php
M includes/GlobalFunctions.php
M includes/MWTimestamp.php
M includes/db/Database.php
D includes/exception/TimestampException.php
A includes/libs/time/ConvertableTimestamp.php
A includes/libs/time/TimestampException.php
A includes/libs/time/defines.php
8 files changed, 331 insertions(+), 297 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/53/311053/1

diff --git a/autoload.php b/autoload.php
index 96c8190..8fc621a 100644
--- a/autoload.php
+++ b/autoload.php
@@ -280,6 +280,7 @@
'ConvertExtensionToRegistration' => __DIR__ . 
'/maintenance/convertExtensionToRegistration.php',
'ConvertLinks' => __DIR__ . '/maintenance/convertLinks.php',
'ConvertUserOptions' => __DIR__ . '/maintenance/convertUserOptions.php',
+   'ConvertableTimestamp' => __DIR__ . 
'/includes/libs/time/ConvertableTimestamp.php',
'ConverterRule' => __DIR__ . '/languages/ConverterRule.php',
'Cookie' => __DIR__ . '/includes/libs/Cookie.php',
'CookieJar' => __DIR__ . '/includes/libs/CookieJar.php',
@@ -1410,7 +1411,7 @@
'ThumbnailRenderJob' => __DIR__ . 
'/includes/jobqueue/jobs/ThumbnailRenderJob.php',
'TidyUpBug37714' => __DIR__ . '/maintenance/tidyUpBug37714.php',
'TiffHandler' => __DIR__ . '/includes/media/Tiff.php',
-   'TimestampException' => __DIR__ . 
'/includes/exception/TimestampException.php',
+   'TimestampException' => __DIR__ . 
'/includes/libs/time/TimestampException.php',
'Timing' => __DIR__ . '/includes/libs/Timing.php',
'Title' => __DIR__ . '/includes/Title.php',
'TitleArray' => __DIR__ . '/includes/TitleArray.php',
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 0e59653..9f71cf2 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1992,56 +1992,7 @@
 
 # Autodetect, convert and provide timestamps of various types
 
-/**
- * Unix time - the number of seconds since 1970-01-01 00:00:00 UTC
- */
-define( 'TS_UNIX', 0 );
-
-/**
- * MediaWiki concatenated string timestamp (MMDDHHMMSS)
- */
-define( 'TS_MW', 1 );
-
-/**
- * MySQL DATETIME (-MM-DD HH:MM:SS)
- */
-define( 'TS_DB', 2 );
-
-/**
- * RFC 2822 format, for E-mail and HTTP headers
- */
-define( 'TS_RFC2822', 3 );
-
-/**
- * ISO 8601 format with no timezone: 1986-02-09T20:00:00Z
- *
- * This is used by Special:Export
- */
-define( 'TS_ISO_8601', 4 );
-
-/**
- * An Exif timestamp (:MM:DD HH:MM:SS)
- *
- * @see http://exif.org/Exif2-2.PDF The Exif 2.2 spec, see page 28 for the
- *   DateTime tag and page 36 for the DateTimeOriginal and
- *   DateTimeDigitized tags.
- */
-define( 'TS_EXIF', 5 );
-
-/**
- * Oracle format time.
- */
-define( 'TS_ORACLE', 6 );
-
-/**
- * Postgres format time.
- */
-define( 'TS_POSTGRES', 7 );
-
-/**
- * ISO 8601 basic format with no timezone: 19860209T20Z.  This is used by 
ResourceLoader
- */
-define( 'TS_ISO_8601_BASIC', 9 );
+require "$IP/includes/libs/time/defines.php";
 
 /**
  * Get a timestamp string in one of various formats
diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php
index defdc96..62eca8a 100644
--- a/includes/MWTimestamp.php
+++ b/includes/MWTimestamp.php
@@ -28,173 +28,7 @@
  *
  * @since 1.20
  */
-class MWTimestamp {
-   /**
-* Standard gmdate() formats for the different timestamp types.
-*/
-   private static $formats = [
-   TS_UNIX => 'U',
-   TS_MW => 'YmdHis',
-   TS_DB => 'Y-m-d H:i:s',
-   TS_ISO_8601 => 'Y-m-d\TH:i:s\Z',
-   TS_ISO_8601_BASIC => 'Ymd\THis\Z',
-   TS_EXIF => 'Y:m:d H:i:s', // This shouldn't ever be used, but 
is included for completeness
-   TS_RFC2822 => 'D, d M Y H:i:s',
-   TS_ORACLE => 'd-m-Y H:i:s.00', // Was 'd-M-y h.i.s A' . ' 
+00:00' before r51500
-   TS_POSTGRES => 'Y-m-d H:i:s',
-   ];
-
-   /**
-* The actual timestamp being wrapped (DateTime object).
-* @var DateTime
-*/
-   public $timestamp;
-
-   /**
-* Make a new timestamp and set it to the specified time,
-* or the current time if unspecified.
-*
-* @since 1.20
-*
-* @param bool|string|int|float|DateTime $timestamp Timestamp to set, 
or false for current time
-*/
-   public function __construct( $timestamp = false ) {
-   if ( $timestamp instanceof DateTime ) {
-   $this->timestamp = $timestamp;
-   } else {
-  

[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_23]: Add missing global $wgUseXVO to RawAction.php

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add missing global $wgUseXVO to RawAction.php
..


Add missing global $wgUseXVO to RawAction.php

Bug: T136129
Change-Id: Id89bb33b05743322882cabc7a7f021bc689cb9bf
---
M includes/actions/RawAction.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Chad: Looks good to me, approved
  Legoktm: Looks good to me, approved
  GreenReaper: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php
index f394e13..62a9f5f 100644
--- a/includes/actions/RawAction.php
+++ b/includes/actions/RawAction.php
@@ -48,7 +48,7 @@
}
 
function onView() {
-   global $wgSquidMaxage, $wgForcedRawSMaxage;
+   global $wgSquidMaxage, $wgForcedRawSMaxage, $wgUseXVO;
 
$this->getOutput()->disable();
$request = $this->getRequest();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id89bb33b05743322882cabc7a7f021bc689cb9bf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_23
Gerrit-Owner: Paladox 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: GreenReaper 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Reedy 
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]: Add one more level for GlobalTitleFail logging

2016-09-15 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Add one more level for GlobalTitleFail logging
..

Add one more level for GlobalTitleFail logging

htmlspecialchars/Message->__toString/Message->toString/Message->parseText/MessageCache->parse
is useless without the caller of htmlspecialchars().

Change-Id: I2dad5a487225a11b98149610f1c775057f8baad2
---
M includes/cache/MessageCache.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/52/311052/1

diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index d254d3d..e871855 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -1089,7 +1089,7 @@
if ( !$title || !$title instanceof Title ) {
global $wgTitle;
wfDebugLog( 'GlobalTitleFail', __METHOD__ . ' called by 
' .
-   wfGetAllCallers( 5 ) . ' with no title set.' );
+   wfGetAllCallers( 6 ) . ' with no title set.' );
$title = $wgTitle;
}
// Sometimes $wgTitle isn't set either...

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2dad5a487225a11b98149610f1c775057f8baad2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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...RelatedArticles[master]: Hygiene: don't load a module unless necessary

2016-09-15 Thread Bmansurov (Code Review)
Bmansurov has uploaded a new change for review.

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

Change subject: Hygiene: don't load a module unless necessary
..

Hygiene: don't load a module unless necessary

Move logic that loads related articles in the footer to PHP from JS.
This prevents us from shipping a JS module to a client and not showing
related articles.

Also make sure not to load related articles in footer on Special:Mobilediff.

Bug: T144047
Change-Id: I73e39ee6b1223699cd8ac739902315d163d98c3b
---
M includes/FooterHooks.php
M resources/ext.relatedArticles.readMore.bootstrap/index.js
2 files changed, 42 insertions(+), 42 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RelatedArticles 
refs/changes/51/311051/1

diff --git a/includes/FooterHooks.php b/includes/FooterHooks.php
index 6248b37..c6d4cc0 100644
--- a/includes/FooterHooks.php
+++ b/includes/FooterHooks.php
@@ -49,6 +49,22 @@
}
 
/**
+* Check whether the output page is a diff page
+*
+* @param OutputPage $out
+* @return bool
+*/
+   private static function isDiffPage( OutputPage $out ) {
+   $request = $out->getRequest();
+   $type = $request->getText( 'type' );
+   $diff = $request->getText( 'diff' );
+   $oldId = $request->getText( 'oldid' );
+   $isSpecialMobileDiff = $out->getTitle()->isSpecial( 
'MobileDiff' );
+
+   return $type === 'revision' || $diff || $oldId || 
$isSpecialMobileDiff;
+   }
+
+   /**
 * Handler for the BeforePageDisplay hook.
 *
 * Adds the ext.relatedArticles.readMore.bootstrap module
@@ -60,7 +76,11 @@
 * SkinMinervaBeta
 *   On desktop, the beta feature has been enabled
 *   The page is in mainspace
+*   The action is 'view'
+*   The page is not the Main Page
 *   The page is not a disambiguation page
+*   The page is not a diff page
+*   The skin is not Minerva stable
 * 
 *
 * @param OutputPage $out
@@ -72,15 +92,23 @@
$showReadMore = $config->get( 'RelatedArticlesShowInFooter' );
 
$title = $out->getContext()->getTitle();
+   $action = $out->getRequest()->getText( 'action' );
 
if (
$showReadMore &&
$title->inNamespace( NS_MAIN ) &&
+   // T120735
+   $action === 'view' &&
!$title->isMainPage() &&
-   !self::isDisambiguationPage( $title )
+   !self::isDisambiguationPage( $title ) &&
+   !self::isDiffPage( $out )
) {
if (
-   get_class( $skin ) === 'SkinMinervaBeta' ||
+   (
+   // any skin except minerva stable
+   // FIXME: right now both Minerva stable 
and beta report their names as 'minerva'
+   get_class( $skin ) === 
'SkinMinervaBeta' || $skin->getSkinName() !== 'minerva'
+   ) ||
(
class_exists( 'BetaFeatures' ) &&
BetaFeatures::isFeatureEnabled( 
$out->getUser(), 'read-more' )
diff --git a/resources/ext.relatedArticles.readMore.bootstrap/index.js 
b/resources/ext.relatedArticles.readMore.bootstrap/index.js
index e906776..2b9b560 100644
--- a/resources/ext.relatedArticles.readMore.bootstrap/index.js
+++ b/resources/ext.relatedArticles.readMore.bootstrap/index.js
@@ -1,8 +1,6 @@
 ( function ( $, mw ) {
 
-   var config = mw.config.get( [ 'skin', 'wgNamespaceNumber', 'wgMFMode',
-   'wgIsMainPage', 'wgAction' ] ),
-   relatedPages = new mw.relatedPages.RelatedPagesGateway(
+   var relatedPages = new mw.relatedPages.RelatedPagesGateway(
new mw.Api(),
mw.config.get( 'wgPageName' ),
mw.config.get( 'wgRelatedArticles' ),
@@ -41,43 +39,17 @@
}
}
 
-   /**
-* Is the current page a diff page?
-*
-* @ignore
-* @return {boolean}
-*/
-   function isDiffPage() {
-   var queryParams = new mw.Uri( window.location.href ).query;
-
-   return !!(
-   queryParams.type === 'revision' ||
-   queryParams.hasOwnProperty( 'diff' ) ||
-   queryParams.hasOwnProperty( 'oldid' )
-   );
+   // Add container to DOM for checking distance on scroll
+   // If a skin has marked up a footer content area prepend it there
+   if ( $( 

[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Avoid global state in ContributionsToolLinks if possible

2016-09-15 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Avoid global state in ContributionsToolLinks if possible
..

Avoid global state in ContributionsToolLinks if possible

Change-Id: I4fe92ae6947de798d7e7c7dfa8e3b44b5bfa5a1c
---
M AbuseFilter.hooks.php
1 file changed, 11 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter 
refs/changes/49/311049/1

diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php
index c4ed274..2233f0f 100644
--- a/AbuseFilter.hooks.php
+++ b/AbuseFilter.hooks.php
@@ -683,15 +683,21 @@
 * @param $id
 * @param $nt Title
 * @param $tools
+* @param SpecialPage|null $sp for context in newer MW versions
 * @return bool
 */
-   public static function onContributionsToolLinks( $id, $nt, &$tools ) {
-   global $wgUser;
-   if ( $wgUser->isAllowed( 'abusefilter-log' ) ) {
+   public static function onContributionsToolLinks( $id, $nt, &$tools, 
SpecialPage $sp = null ) {
+   if ( $sp ) {
+   $context = $sp->getContext();
+   } else {
+   // Fallback to main context
+   $context = RequestContext::getMain();
+   }
+   if ( $context->getUser()->isAllowed( 'abusefilter-log' ) ) {
$tools[] = Linker::link(
SpecialPage::getTitleFor( 'AbuseLog' ),
-   wfMessage( 'abusefilter-log-linkoncontribs' 
)->text(),
-   array( 'title' => wfMessage( 
'abusefilter-log-linkoncontribs-text' )->parse() ),
+   $context->msg( 'abusefilter-log-linkoncontribs' 
)->text(),
+   array( 'title' => $context->msg( 
'abusefilter-log-linkoncontribs-text' )->parse() ),
array( 'wpSearchUser' => $nt->getText() )
);
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4fe92ae6947de798d7e7c7dfa8e3b44b5bfa5a1c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
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]: Verify bundledNotifications data is an array before running ...

2016-09-15 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review.

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

Change subject: Verify bundledNotifications data is an array before running 
.map()
..

Verify bundledNotifications data is an array before running .map()

Bug: T145825
Change-Id: Ibdf17c58fe88e3e2547dde62cd4d3d06e089cbc8
---
M modules/controller/mw.echo.Controller.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/controller/mw.echo.Controller.js 
b/modules/controller/mw.echo.Controller.js
index 59cb771..69e93bb 100644
--- a/modules/controller/mw.echo.Controller.js
+++ b/modules/controller/mw.echo.Controller.js
@@ -315,7 +315,7 @@

notifData.sources[ source ]
);
}
-   } else if ( 
newNotifData.bundledNotifications ) {
+   } else if ( Array.isArray( 
newNotifData.bundledNotifications ) ) {
// local bundle
newNotifData.modelName 
= 'bundle_' + notifData.id;
itemModel = new 
mw.echo.dm.BundleNotificationItem(

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Remove $wgCollectionStyleVersion

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove $wgCollectionStyleVersion
..


Remove $wgCollectionStyleVersion

It was probably more useful when it was used for CSS and Javascript.
A single PNG not so much.

Change-Id: Ieefcdbc6c72c2a2377c64d9db3d3c5d2a74f7f62
---
M Collection.hooks.php
M Collection.php
2 files changed, 1 insertion(+), 5 deletions(-)

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



diff --git a/Collection.hooks.php b/Collection.hooks.php
index 9f4916c..39902ab 100644
--- a/Collection.hooks.php
+++ b/Collection.hooks.php
@@ -197,7 +197,6 @@
 * @return string
 */
public static function renderBookCreatorBox( $title, $mode = '' ) {
-   global $wgCollectionStyleVersion;
global $wgOut, $wgExtensionAssetsPath, $wgRequest;
 
$imagePath = "$wgExtensionAssetsPath/Collection/images";
@@ -218,7 +217,7 @@
 
$html .= Xml::element( 'img',
array(
-   'src' => 
"$imagePath/Open_book.png?$wgCollectionStyleVersion",
+   'src' => "$imagePath/Open_book.png",
'alt' => '',
'width' => '80',
'height' => '45',
diff --git a/Collection.php b/Collection.php
index 9501c16..1002400 100644
--- a/Collection.php
+++ b/Collection.php
@@ -46,9 +46,6 @@
 
 # Configuration:
 
-/** Bump the version number every time you change any of the JavaScript files 
*/
-$wgCollectionStyleVersion = 9;
-
 /** URL of mw-serve render server */
 $wgCollectionMWServeURL = 'http://tools.pediapress.com/mw-serve/';
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieefcdbc6c72c2a2377c64d9db3d3c5d2a74f7f62
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Collection
Gerrit-Branch: master
Gerrit-Owner: Chad 
Gerrit-Reviewer: C. Scott Ananian 
Gerrit-Reviewer: MaxSem 
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]: ruby-httpclient callers: Use the operating system's certific...

2016-09-15 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: ruby-httpclient callers: Use the operating system's certificate 
store
..

ruby-httpclient callers: Use the operating system's certificate store

Rather than ruby-httpclient's cacert.p7s which doesn't even have the root used
to sign Let's Encrypt CAs (DST Root CA X3).

Bug: T145808
Change-Id: I310dd4040639cc56d2b7d49c48b86321ecbb220c
---
M modules/wmflib/lib/hiera/httpcache.rb
M modules/wmflib/lib/hiera/mwcache.rb
2 files changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/48/311048/1

diff --git a/modules/wmflib/lib/hiera/httpcache.rb 
b/modules/wmflib/lib/hiera/httpcache.rb
index 70a65f8..270c449 100644
--- a/modules/wmflib/lib/hiera/httpcache.rb
+++ b/modules/wmflib/lib/hiera/httpcache.rb
@@ -8,6 +8,12 @@
   config = Config[:httpyaml]
   @url_prefix = config[:url_prefix]
   @http = HTTPClient.new(:agent_name => 'HieraHttpCache/0.1')
+
+  # Use the operating system's certificate store, not ruby-httpclient's 
cacert.p7s which doesn't
+  # even have the root used to sign Let's Encrypt CAs (DST Root CA X3)
+  @http.ssl_config.clear_cert_store
+  @http.ssl_config.set_default_paths
+
   @stat_ttl = config[:cache_ttl] || 60
   if defined? @http.ssl_config.ssl_version
 @http.ssl_config.ssl_version = 'TLSv1'
diff --git a/modules/wmflib/lib/hiera/mwcache.rb 
b/modules/wmflib/lib/hiera/mwcache.rb
index 94d4b1b..7826806 100644
--- a/modules/wmflib/lib/hiera/mwcache.rb
+++ b/modules/wmflib/lib/hiera/mwcache.rb
@@ -12,6 +12,12 @@
   @httphost = config[:host] || 'https://wikitech.wikimedia.org'
   @endpoint = config[:endpoint] || '/w/api.php'
   @http = HTTPClient.new(:agent_name => 'HieraMwCache/0.1')
+
+  # Use the operating system's certificate store, not ruby-httpclient's 
cacert.p7s which doesn't
+  # even have the root used to sign Let's Encrypt CAs (DST Root CA X3)
+  @http.ssl_config.clear_cert_store
+  @http.ssl_config.set_default_paths
+
   @stat_ttl = config[:cache_ttl] || 60
   if defined? @http.ssl_config.ssl_version
 @http.ssl_config.ssl_version = 'TLSv1'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I310dd4040639cc56d2b7d49c48b86321ecbb220c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface submodule

2016-09-15 Thread Awight (Code Review)
Awight has submitted this change and it was merged.

Change subject: Update DonationInterface submodule
..


Update DonationInterface submodule

Change-Id: I0b9be5ba6fa505951fb1393c00c9d462d15d5fc4
---
M extensions/DonationInterface
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 8d17a05..8725fd4 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
@@ -1 +1 @@
-Subproject commit 8d17a058e6d37f4b09aeb57ae83cc53cc4735130
+Subproject commit 8725fd441c074fb90e37bb294d350669e6665260

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b9be5ba6fa505951fb1393c00c9d462d15d5fc4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_27
Gerrit-Owner: Awight 
Gerrit-Reviewer: Awight 
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...Collection[master]: Remove $wgCollectionStyleVersion

2016-09-15 Thread Chad (Code Review)
Chad has uploaded a new change for review.

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

Change subject: Remove $wgCollectionStyleVersion
..

Remove $wgCollectionStyleVersion

It was probably more useful when it was used for CSS and Javascript.
A single PNG not so much.

Change-Id: Ieefcdbc6c72c2a2377c64d9db3d3c5d2a74f7f62
---
M Collection.hooks.php
M Collection.php
2 files changed, 1 insertion(+), 5 deletions(-)


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

diff --git a/Collection.hooks.php b/Collection.hooks.php
index 9f4916c..39902ab 100644
--- a/Collection.hooks.php
+++ b/Collection.hooks.php
@@ -197,7 +197,6 @@
 * @return string
 */
public static function renderBookCreatorBox( $title, $mode = '' ) {
-   global $wgCollectionStyleVersion;
global $wgOut, $wgExtensionAssetsPath, $wgRequest;
 
$imagePath = "$wgExtensionAssetsPath/Collection/images";
@@ -218,7 +217,7 @@
 
$html .= Xml::element( 'img',
array(
-   'src' => 
"$imagePath/Open_book.png?$wgCollectionStyleVersion",
+   'src' => "$imagePath/Open_book.png",
'alt' => '',
'width' => '80',
'height' => '45',
diff --git a/Collection.php b/Collection.php
index 9501c16..1002400 100644
--- a/Collection.php
+++ b/Collection.php
@@ -46,9 +46,6 @@
 
 # Configuration:
 
-/** Bump the version number every time you change any of the JavaScript files 
*/
-$wgCollectionStyleVersion = 9;
-
 /** URL of mw-serve render server */
 $wgCollectionMWServeURL = 'http://tools.pediapress.com/mw-serve/';
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface submodule

2016-09-15 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Update DonationInterface submodule
..

Update DonationInterface submodule

Change-Id: I0b9be5ba6fa505951fb1393c00c9d462d15d5fc4
---
M extensions/DonationInterface
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 8d17a05..8725fd4 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
@@ -1 +1 @@
-Subproject commit 8d17a058e6d37f4b09aeb57ae83cc53cc4735130
+Subproject commit 8725fd441c074fb90e37bb294d350669e6665260

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b9be5ba6fa505951fb1393c00c9d462d15d5fc4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_27
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Revert "Live hack to dump configuration"

2016-09-15 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Revert "Live hack to dump configuration"
..

Revert "Live hack to dump configuration"

This reverts commit af19422065c08669269179019fea1e7c208d8a7e.

Change-Id: I815c71ae0f95006966b67ee238542d7a518c3cc4
---
M Core/Listeners/ListenerBase.php
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/45/311045/1

diff --git a/Core/Listeners/ListenerBase.php b/Core/Listeners/ListenerBase.php
index 6eb3de5..98a95e9 100644
--- a/Core/Listeners/ListenerBase.php
+++ b/Core/Listeners/ListenerBase.php
@@ -25,8 +25,6 @@
 
public function __construct() {
$this->c = Context::get()->getConfiguration();
-// Livehack: Dump configuration
-Logger::info( json_encode( $this->c->val( 'data-store/verified' ) ) );
$this->inflightStore = $this->c->object( 'data-store/inflight' 
);
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I815c71ae0f95006966b67ee238542d7a518c3cc4
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Livehack to not use APC

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Livehack to not use APC
..


Livehack to not use APC

Change-Id: I244233583accedcee0c2ca0eea7e652ee492e330
---
M Core/Configuration.php
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/Core/Configuration.php b/Core/Configuration.php
index 313dec7..ae8674e 100644
--- a/Core/Configuration.php
+++ b/Core/Configuration.php
@@ -237,6 +237,8 @@
}
 
protected function hasApc() {
+// livehack: no.
+return false;
static $useApc = null;
if ( $useApc === null ) {
$useApc = extension_loaded( 'apc' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I244233583accedcee0c2ca0eea7e652ee492e330
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 
Gerrit-Reviewer: Ejegg 
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]: Avoid a wfMessage() call

2016-09-15 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Avoid a wfMessage() call
..

Avoid a wfMessage() call

Change-Id: I83d5e8235548a62f154b83ae4a3a284fa97fd9ce
---
M frontend/FlaggedRevsUI.hooks.php
1 file changed, 5 insertions(+), 4 deletions(-)


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

diff --git a/frontend/FlaggedRevsUI.hooks.php b/frontend/FlaggedRevsUI.hooks.php
index fcd07bc..0abe3be 100644
--- a/frontend/FlaggedRevsUI.hooks.php
+++ b/frontend/FlaggedRevsUI.hooks.php
@@ -427,7 +427,7 @@
} elseif ( isset( $row->fr_quality ) ) {
if ( !( $row->rev_deleted & Revision::DELETED_TEXT ) ) {
# Add link to stable version of *this* rev, if 
any
-   list( $link, $class ) = self::markHistoryRow( 
$title, $row );
+   list( $link, $class ) = self::markHistoryRow( 
$history, $title, $row );
# Space out and demark the stable revision
if ( $revId == $history->fr_stableRevId && 
$history->fr_pendingRevs ) {
$liClasses[] = 'fr-hist-stable-margin';
@@ -443,11 +443,12 @@
 
/**
 * Make stable version link and return the css
+* @param IContextSource $ctx
 * @param Title $title
-* @param Row $row, from history page
+* @param stdClass $row, from history page
 * @return array (string,string)
 */
-   protected static function markHistoryRow( Title $title, $row ) {
+   protected static function markHistoryRow( IContextSource $ctx, Title 
$title, $row ) {
if ( !isset( $row->fr_quality ) ) {
return array( "", "" ); // not reviewed
}
@@ -470,7 +471,7 @@
}
$name = isset( $row->reviewer ) ?
$row->reviewer : User::whoIs( $row->fr_user );
-   $link = wfMessage( $msg, $title->getPrefixedDBkey(), 
$row->rev_id, $name )->parse();
+   $link = $ctx->msg( $msg, $title->getPrefixedDBkey(), 
$row->rev_id, $name )->parse();
$link = "[$link]";
return array( $link, $liCss );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83d5e8235548a62f154b83ae4a3a284fa97fd9ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
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/core[master]: EditPage: Generate all messages using $this->context so we h...

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: EditPage: Generate all messages using $this->context so we have 
titles
..


EditPage: Generate all messages using $this->context so we have titles

Change-Id: I5ba13f1677e1a1b4160e14357a483b5e1f11ea1c
---
M includes/EditPage.php
1 file changed, 58 insertions(+), 56 deletions(-)

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



diff --git a/includes/EditPage.php b/includes/EditPage.php
index 9d329e8..606b4cd 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -578,7 +578,7 @@
) {
$this->displayViewSourcePage(
$this->getContentObject(),
-   wfMessage(
+   $this->context->msg(
'contentmodelediterror',
$revision->getContentModel(),
$this->contentModel
@@ -715,7 +715,7 @@
Hooks::run( 'EditPage::showReadOnlyForm:initial', [ $this, 
&$wgOut ] );
 
$wgOut->setRobotPolicy( 'noindex,nofollow' );
-   $wgOut->setPageTitle( wfMessage(
+   $wgOut->setPageTitle( $this->context->msg(
'viewsource-title',
$this->getContextTitle()->getPrefixedText()
) );
@@ -1178,12 +1178,12 @@
if ( $firstrev 
&& $firstrev->getId() == $undo ) {

$userText = $undorev->getUserText();
if ( 
$userText === '' ) {
-   
$undoSummary = wfMessage(
+   
$undoSummary = $this->context->msg(

'undo-summary-username-hidden',

$undo

)->inContentLanguage()->text();
} else {
-   
$undoSummary = wfMessage(
+   
$undoSummary = $this->context->msg(

'undo-summary',

$undo,

$userText
@@ -1192,7 +1192,7 @@
if ( 
$this->summary === '' ) {

$this->summary = $undoSummary;
} else {
-   
$this->summary = $undoSummary . wfMessage( 'colon-separator' )
+   
$this->summary = $undoSummary . $this->context->msg( 'colon-separator' )

->inContentLanguage()->text() . $this->summary;
}

$this->undidRev = $undo;
@@ -1210,7 +1210,7 @@
// Messages: undo-success, 
undo-failure, undo-norev, undo-nochange
$class = ( $undoMsg == 'success' ? '' : 
'error ' ) . "mw-undo-{$undoMsg}";
$this->editFormPageTop .= 
$wgOut->parse( "" .
-   wfMessage( 'undo-' . $undoMsg 
)->plain() . '', true, /* interface */true );
+   $this->context->msg( 'undo-' . 
$undoMsg )->plain() . '', true, /* interface */true );
}
 
if ( $content === false ) {
@@ -1674,7 +1674,7 @@
// passed.
if ( $this->summary === '' ) {
$cleanSectionTitle = 
$wgParser->stripSectionName( $this->sectiontitle );
-   return wfMessage( 'newsectionsummary' )
+ 

[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Livehack to not use APC

2016-09-15 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Livehack to not use APC
..

Livehack to not use APC

Change-Id: I244233583accedcee0c2ca0eea7e652ee492e330
---
M Core/Configuration.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/43/311043/1

diff --git a/Core/Configuration.php b/Core/Configuration.php
index 313dec7..ae8674e 100644
--- a/Core/Configuration.php
+++ b/Core/Configuration.php
@@ -237,6 +237,8 @@
}
 
protected function hasApc() {
+// livehack: no.
+return false;
static $useApc = null;
if ( $useApc === null ) {
$useApc = extension_loaded( 'apc' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I244233583accedcee0c2ca0eea7e652ee492e330
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Set a Title on context-created messages

2016-09-15 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: resourceloader: Set a Title on context-created messages
..

resourceloader: Set a Title on context-created messages

Ensure that messages created using ResourceLoaderContext::msg() have a
title set so they don't trigger the GlobalTitleFail log. We use a dummy
title since there is no real title we can use here, and the cache
doesn't vary on a title anyways. This particular title was picked
especially for Roan.

This patch should quiet the GlobalTitleFail logs for
MFResourceLoaderParsedMessageModule and VisualEditorDataModule.

Change-Id: I502faa22776e1cb34a6ef17be96567f121c80081
---
M includes/resourceloader/ResourceLoaderContext.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/42/311042/1

diff --git a/includes/resourceloader/ResourceLoaderContext.php 
b/includes/resourceloader/ResourceLoaderContext.php
index 30fe3ae..4a2f759 100644
--- a/includes/resourceloader/ResourceLoaderContext.php
+++ b/includes/resourceloader/ResourceLoaderContext.php
@@ -219,7 +219,11 @@
 */
public function msg() {
return call_user_func_array( 'wfMessage', func_get_args() )
-   ->inLanguage( $this->getLanguage() );
+   ->inLanguage( $this->getLanguage() )
+   // Use a dummy title because there is no real title
+   // for this endpoint, and the cache won't vary on it
+   // anyways.
+   ->title( Title::newFromText( 'Dwimmerlaik' ) );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I502faa22776e1cb34a6ef17be96567f121c80081
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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] operations/puppet[production]: Puppet Panel: Speed up loading of role documentation

2016-09-15 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Puppet Panel:  Speed up loading of role documentation
..

Puppet Panel:  Speed up loading of role documentation

Bug: T91990
Change-Id: I0f2dd7ca64e358a48babb1aeb228d353672d58f6
---
M modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
M modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
2 files changed, 3 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/41/311041/1

diff --git a/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py 
b/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
index 5a64a3e..12e41fb 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py
@@ -18,6 +18,7 @@
 
 from django.conf import settings
 from django.core.cache import cache
+from django.utils.translation import ugettext_lazy as _
 
 logging.basicConfig()
 LOG = logging.getLogger(__name__)
@@ -36,7 +37,7 @@
 
 def __init__(self, name):
 self.name = name
-self.docs = ""
+self.docs = _('(No docs available)')
 self.applied = False
 self.params = []
 self.raw_params = {}
diff --git a/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py 
b/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
index ab6310b..fab2e6e 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/puppet_tables.py
@@ -24,15 +24,13 @@
 
 from horizon import tables
 
-import puppet_roles
-
 logging.basicConfig()
 LOG = logging.getLogger(__name__)
 
 
 def get_formatted_name(classrecord):
 name = classrecord.name.split('role::')[1]
-title = get_docs_for_class(name)
+title = classrecord.docs
 html = '%s ' % (
 escape(name),
 escape(title)
@@ -46,16 +44,6 @@
 for param in classrecord.params.items():
 keysanddefaults.append("%s: %s" % param)
 return(";\n".join(keysanddefaults))
-
-
-def get_docs_for_class(classname):
-allroles = puppet_roles.available_roles()
-for role in allroles:
-if role.name.split('role::')[1] == classname:
-if role.docs:
-return role.docs
-break
-return _('(No docs available)')
 
 
 class RemoveRole(tables.LinkAction):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f2dd7ca64e358a48babb1aeb228d353672d58f6
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...ConfirmEdit[master]: HTMLFancyCaptchaField: Avoid wfMessage()

2016-09-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: HTMLFancyCaptchaField: Avoid wfMessage()
..


HTMLFancyCaptchaField: Avoid wfMessage()

Change-Id: I5d9b1376c8d951dbc3744ee20a09301c55958fdb
---
M FancyCaptcha/HTMLFancyCaptchaField.php
1 file changed, 5 insertions(+), 4 deletions(-)

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



diff --git a/FancyCaptcha/HTMLFancyCaptchaField.php 
b/FancyCaptcha/HTMLFancyCaptchaField.php
index a80e1bb..fe8e7da 100644
--- a/FancyCaptcha/HTMLFancyCaptchaField.php
+++ b/FancyCaptcha/HTMLFancyCaptchaField.php
@@ -40,7 +40,7 @@
$captchaReload = Html::element(
'small',
[ 'class' => 'confirmedit-captcha-reload 
fancycaptcha-reload' ],
-   wfMessage( 'fancycaptcha-reload-text' )->text()
+   $this->mParent->msg( 'fancycaptcha-reload-text' 
)->text()
);
} else {
$captchaReload = '';
@@ -56,7 +56,7 @@
'autocomplete' => 'off',
'autocorrect' => 'off',
'autocapitalize' => 'off',
-   'placeholder' => wfMessage( 
'fancycaptcha-imgcaptcha-ph' )
+   'placeholder' => $this->mParent->msg( 
'fancycaptcha-imgcaptcha-ph' )->text()
];
$attribs += $this->getAttributes( [ 'tabindex', 'required', 
'autofocus' ] );
 
@@ -74,7 +74,7 @@
// use raw element, the message will contain a link
$html .= Html::rawElement( 'small', [
'class' => 'mw-createacct-captcha-assisted'
-   ], wfMessage( 'createacct-imgcaptcha-help' )->parse() );
+   ], $this->mParent->msg( 'createacct-imgcaptcha-help' 
)->parse() );
}
 
$html .= Html::closeElement( 'div' );
@@ -85,7 +85,8 @@
public function getLabel() {
// slight abuse of what getLabel() should mean; $mLabel is used 
for the pre-label text
// as the actual label is always the same
-   return wfMessage( 'captcha-label' )->text() . ' ' . wfMessage( 
'fancycaptcha-captcha' )->text();
+   return $this->mParent->msg( 'captcha-label' )->text() . ' '
+   . $this->mParent->msg( 'fancycaptcha-captcha' )->text();
}
 
public function getLabelHtml( $cellAttributes = [] ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5d9b1376c8d951dbc3744ee20a09301c55958fdb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Chad 
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...SmashPig[deployment]: Live hack to dump configuration

2016-09-15 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged.

Change subject: Live hack to dump configuration
..


Live hack to dump configuration

Change-Id: I956caf3362cc5c286a0a51cd7cf73018909e8906
---
M Core/Listeners/ListenerBase.php
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/Core/Listeners/ListenerBase.php b/Core/Listeners/ListenerBase.php
index 98a95e9..6eb3de5 100644
--- a/Core/Listeners/ListenerBase.php
+++ b/Core/Listeners/ListenerBase.php
@@ -25,6 +25,8 @@
 
public function __construct() {
$this->c = Context::get()->getConfiguration();
+// Livehack: Dump configuration
+Logger::info( json_encode( $this->c->val( 'data-store/verified' ) ) );
$this->inflightStore = $this->c->object( 'data-store/inflight' 
);
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I956caf3362cc5c286a0a51cd7cf73018909e8906
Gerrit-PatchSet: 3
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Ejegg 
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...SmashPig[master]: Backwards compatibility with old config key

2016-09-15 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Backwards compatibility with old config key
..

Backwards compatibility with old config key

Change-Id: I4670011eac900de3c18ae8d9c65426d6b0deccb2
---
M Core/Configuration.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/40/311040/1

diff --git a/Core/Configuration.php b/Core/Configuration.php
index 313dec7..ba11c52 100644
--- a/Core/Configuration.php
+++ b/Core/Configuration.php
@@ -355,6 +355,9 @@
$arguments = array();
if ( $this->nodeExists( $node . '/constructor-parameters' ) ) {
$arguments = $this->val( $node . 
'/constructor-parameters' );
+   } elseif ( $this->nodeExists( $node . '/inst-args' ) ) {
+   // Check legacy key.
+   $arguments = $this->val( $node . '/inst-args' );
}
 
$reflectedObj = new \ReflectionClass( $className );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4670011eac900de3c18ae8d9c65426d6b0deccb2
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Live hack: try restoring inst-args for one thing

2016-09-15 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Live hack: try restoring inst-args for one thing
..

Live hack: try restoring inst-args for one thing

Change-Id: I920e8f2cdda39feda5b015c802f7b4ca7cb5a44d
---
A PaymentProviders/Amazon/Tests/phpunit/QueueTest.php
M SmashPig.yaml
2 files changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/39/311039/1

diff --git a/PaymentProviders/Amazon/Tests/phpunit/QueueTest.php 
b/PaymentProviders/Amazon/Tests/phpunit/QueueTest.php
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/PaymentProviders/Amazon/Tests/phpunit/QueueTest.php
diff --git a/SmashPig.yaml b/SmashPig.yaml
index 8f0f69d..7ab3d6f 100644
--- a/SmashPig.yaml
+++ b/SmashPig.yaml
@@ -97,6 +97,9 @@
 constructor-parameters:
 -
 - verified-stomp
+inst-args:
+-
+- verified-stomp
 
 verified-stomp:
 class: SmashPig\Core\DataStores\StompDataStore

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I920e8f2cdda39feda5b015c802f7b4ca7cb5a44d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove wfRandomString() dependency in DatabaseBase

2016-09-15 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Remove wfRandomString() dependency in DatabaseBase
..

Remove wfRandomString() dependency in DatabaseBase

Change-Id: I9a889e120bd665683e53dfbc8729a7c484ea507c
---
M includes/db/Database.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/311038/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index 3fa1335..7c39da0 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -2907,7 +2907,7 @@
$this->mTrxAutomatic = ( $mode === self::TRANSACTION_INTERNAL );
$this->mTrxAutomaticAtomic = false;
$this->mTrxAtomicLevels = [];
-   $this->mTrxShortId = wfRandomString( 12 );
+   $this->mTrxShortId = sprintf( "%06x" , mt_rand( 0, 0xff ) );
$this->mTrxWriteDuration = 0.0;
$this->mTrxWriteQueryCount = 0;
$this->mTrxWriteAdjDuration = 0.0;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a889e120bd665683e53dfbc8729a7c484ea507c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Live hack to dump configuration

2016-09-15 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Live hack to dump configuration
..

Live hack to dump configuration

Change-Id: I956caf3362cc5c286a0a51cd7cf73018909e8906
---
M Core/Listeners/ListenerBase.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/36/311036/1

diff --git a/Core/Listeners/ListenerBase.php b/Core/Listeners/ListenerBase.php
index 98a95e9..af4aa9c 100644
--- a/Core/Listeners/ListenerBase.php
+++ b/Core/Listeners/ListenerBase.php
@@ -25,6 +25,8 @@
 
public function __construct() {
$this->c = Context::get()->getConfiguration();
+// Livehack: Dump configuration
+Logger::info( json_encode( $this->c->val( '/' ) ) );
$this->inflightStore = $this->c->object( 'data-store/inflight' 
);
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I956caf3362cc5c286a0a51cd7cf73018909e8906
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] mediawiki...PerformanceInspector[master]: Show detailed list of unused CSS selectors

2016-09-15 Thread Phedenskog (Code Review)
Phedenskog has uploaded a new change for review.

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

Change subject: Show detailed list of unused CSS selectors
..

Show detailed list of unused CSS selectors

Work in progress.

Bug: T140669

Change-Id: I1ff8e2a3938c7674a382ded60c8cb3de2a394894
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/collectors/ext.PerformanceInspector.modulescss.js
M modules/css/ext.PerformanceInspector.css
M modules/templates/modulescss.mustache
6 files changed, 168 insertions(+), 14 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PerformanceInspector 
refs/changes/37/311037/1

diff --git a/extension.json b/extension.json
index fae312e..b5ca4c7 100644
--- a/extension.json
+++ b/extension.json
@@ -61,6 +61,8 @@

"performanceinspector-modules-css-column-allselectors",

"performanceinspector-modules-css-column-matchedselectors",

"performanceinspector-modules-css-column-percentmatched",
+   "performanceinspector-modules-css-column-url",
+   "performanceinspector-modules-css-show-details",

"performanceinspector-modules-localstorage-name",

"performanceinspector-modules-localstorage-label",

"performanceinspector-modules-localstorage-disabled",
@@ -106,6 +108,7 @@
"performanceinspector-newpp-value-and-limit",

"performanceinspector-modules-localstorage-description",
"performanceinspector-modules-css-description",
+   
"performanceinspector-modules-css-url-description",

"performanceinspector-modules-module-description",
"performanceinspector-newpp-description",

"performanceinspector-newpp-timingprofile-description",
diff --git a/i18n/en.json b/i18n/en.json
index e4b1d74..cfed325 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -20,6 +20,9 @@
"performanceinspector-modules-css-column-allselectors": "allSelectors",
"performanceinspector-modules-css-column-matchedselectors": 
"matchedselectors",
"performanceinspector-modules-css-column-percentmatched": 
"percentMatched",
+   "performanceinspector-modules-css-column-url": "URL",
+   "performanceinspector-modules-css-url-description": "For each CSS URL 
with styles, count the number of selectors, and count how many match against 
some element currently in the DOM.",
+   "performanceinspector-modules-css-show-details": "Show details",
 
"performanceinspector-modules-localstorage-name": "Local storage",
"performanceinspector-modules-localstorage-label": "Local storage",
@@ -64,7 +67,7 @@
"performanceinspector-newpp-dynamic-content": "Dynamic content",
"performanceinspector-newpp-cachereport": "Parser cache",
"performanceinspector-modules-localstorage-description": "How many 
ResourceLoader modules were loaded from local storage.",
-   "performanceinspector-modules-css-description": "For each 
ResourceLoader module with styles, count the number of selectors, and count how 
many match against some element currently in the DOM",
+   "performanceinspector-modules-css-description": "For each 
ResourceLoader module with styles, count the number of selectors, and count how 
many match against some element currently in the DOM.",
"performanceinspector-modules-module-description": "The ResourceLoader 
modules used by this page.",
"performanceinspector-newpp-description": "Information collected when 
the page was parsed in the backend. Most users will get a cached copy where the 
page is already parsed.",
"performanceinspector-newpp-timingprofile-description": "Time spent 
parsing the templates for this page.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b72f099..10b52ad 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -19,6 +19,8 @@
"performanceinspector-modules-css-column-allselectors": "The column 
name for allSelectors in the CSS section",
"performanceinspector-modules-css-column-matchedselectors": "The column 
name for matchedselectors in the CSS section",
"performanceinspector-modules-css-column-percentmatched": "The column 
name for percentMatched in the CSS section",
+   "performanceinspector-modules-css-column-url": "The column name for a 
CSS fetched from a URL in the CSS section",
+   "performanceinspector-modules-css-show-details": "The name of the link 
to show more details about unnused CSS",
"performanceinspector-modules-localstorage-name": "The heading for the 
Local storage section",

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Change-Prop: Switch to new events.

2016-09-15 Thread Ppchelko (Code Review)
Ppchelko has uploaded a new change for review.

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

Change subject: Change-Prop: Switch to new events.
..

Change-Prop: Switch to new events.

Old events were deprecated and not produced
any more, we need to listen to the new events.

Change-Id: I6c157df1d3ba731294bff1609c6612c57ffe7077
---
M puppet/modules/changeprop/templates/config.yaml.erb
1 file changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/35/311035/1

diff --git a/puppet/modules/changeprop/templates/config.yaml.erb 
b/puppet/modules/changeprop/templates/config.yaml.erb
index 957bc94..bfdd332 100644
--- a/puppet/modules/changeprop/templates/config.yaml.erb
+++ b/puppet/modules/changeprop/templates/config.yaml.erb
@@ -99,7 +99,7 @@
 redirect: false
 
   page_edit:
-topic: mediawiki.revision_create
+topic: mediawiki.revision-create
 retry_on:
   status:
 - '5xx'
@@ -115,62 +115,62 @@
 redirect: false
 
   revision_visibility_change:
-topic: mediawiki.revision_visibility_set
+topic: mediawiki.revision-visibility-set
 ignore:
   status:
 - 403
 - 412
 exec:
   method: get
-  uri: '<%= @restbase_uri 
%>/{{message.meta.domain}}/v1/page/revision/{{message.revision_id}}'
+  uri: '<%= @restbase_uri 
%>/{{message.meta.domain}}/v1/page/revision/{{message.rev_id}}'
   headers:
 cache-control: no-cache
   query:
 redirect: false
 
   page_delete:
-topic: mediawiki.page_delete
+topic: mediawiki.page-delete
 ignore:
   status:
 - 404 # 404 is a normal response for page deletion
 - 412
 exec:
   method: get
-  uri: '<%= @restbase_uri 
%>/{{message.meta.domain}}/v1/page/title/{message.title}'
+  uri: '<%= @restbase_uri 
%>/{{message.meta.domain}}/v1/page/title/{message.page_title}'
   headers:
 cache-control: no-cache
   query:
 redirect: false
 
   page_restore:
-topic: mediawiki.page_restore
+topic: mediawiki.page-undelete
 exec:
   method: get
-  uri: '<%= @restbase_uri 
%>/{{message.meta.domain}}/v1/page/html/{message.title}'
+  uri: '<%= @restbase_uri 
%>/{{message.meta.domain}}/v1/page/html/{message.page_title}'
   headers:
 cache-control: no-cache
   query:
 redirect: false
 
   page_move:
-topic: mediawiki.page_move
+topic: mediawiki.page-move
 exec:
   - method: get
-uri: '<%= @restbase_uri 
%>/{{message.meta.domain}}/v1/page/html/{message.new_title}/{{message.new_revision_id}}'
+uri: '<%= @restbase_uri 
%>/{{message.meta.domain}}/v1/page/html/{message.page_title}/{{message.rev_id}}'
 headers:
   cache-control: no-cache
   if-unmodified-since: '{{date(message.meta.dt)}}'
 query:
   redirect: false
   - method: get
-uri: '<%= @restbase_uri 
%>/{{message.meta.domain}}/v1/page/title/{message.old_title}'
+uri: '<%= @restbase_uri 
%>/{{message.meta.domain}}/v1/page/title/{message.prior_state.page_title}'
 headers:
   cache-control: no-cache
 query:
   redirect: false
 
   transclusion_update:
-topic: mediawiki.revision_create
+topic: mediawiki.revision-create
 exec:
   method: 'post'
   uri: '/sys/links/transcludes/{message.page_title}'
@@ -178,7 +178,7 @@
 
   on_transclusion_update:
 concurrency: 10
-topic: resource_change
+topic: change-prop.transcludes.continue
 match:
   meta:
 uri: '/https?:\/\/[^\/]+\/wiki\/(?.+)/'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c157df1d3ba731294bff1609c6612c57ffe7077
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Ppchelko 

[MediaWiki-commits] [Gerrit] mediawiki...ConfirmEdit[master]: HTMLFancyCaptchaField: Avoid wfMessage()

2016-09-15 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: HTMLFancyCaptchaField: Avoid wfMessage()
..

HTMLFancyCaptchaField: Avoid wfMessage()

Change-Id: I5d9b1376c8d951dbc3744ee20a09301c55958fdb
---
M FancyCaptcha/HTMLFancyCaptchaField.php
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ConfirmEdit 
refs/changes/34/311034/1

diff --git a/FancyCaptcha/HTMLFancyCaptchaField.php 
b/FancyCaptcha/HTMLFancyCaptchaField.php
index a80e1bb..fe8e7da 100644
--- a/FancyCaptcha/HTMLFancyCaptchaField.php
+++ b/FancyCaptcha/HTMLFancyCaptchaField.php
@@ -40,7 +40,7 @@
$captchaReload = Html::element(
'small',
[ 'class' => 'confirmedit-captcha-reload 
fancycaptcha-reload' ],
-   wfMessage( 'fancycaptcha-reload-text' )->text()
+   $this->mParent->msg( 'fancycaptcha-reload-text' 
)->text()
);
} else {
$captchaReload = '';
@@ -56,7 +56,7 @@
'autocomplete' => 'off',
'autocorrect' => 'off',
'autocapitalize' => 'off',
-   'placeholder' => wfMessage( 
'fancycaptcha-imgcaptcha-ph' )
+   'placeholder' => $this->mParent->msg( 
'fancycaptcha-imgcaptcha-ph' )->text()
];
$attribs += $this->getAttributes( [ 'tabindex', 'required', 
'autofocus' ] );
 
@@ -74,7 +74,7 @@
// use raw element, the message will contain a link
$html .= Html::rawElement( 'small', [
'class' => 'mw-createacct-captcha-assisted'
-   ], wfMessage( 'createacct-imgcaptcha-help' )->parse() );
+   ], $this->mParent->msg( 'createacct-imgcaptcha-help' 
)->parse() );
}
 
$html .= Html::closeElement( 'div' );
@@ -85,7 +85,8 @@
public function getLabel() {
// slight abuse of what getLabel() should mean; $mLabel is used 
for the pre-label text
// as the actual label is always the same
-   return wfMessage( 'captcha-label' )->text() . ' ' . wfMessage( 
'fancycaptcha-captcha' )->text();
+   return $this->mParent->msg( 'captcha-label' )->text() . ' '
+   . $this->mParent->msg( 'fancycaptcha-captcha' )->text();
}
 
public function getLabelHtml( $cellAttributes = [] ) {

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

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

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


  1   2   3   4   5   6   >