[MediaWiki-commits] [Gerrit] Validate cmstarthexsortkey/cmendhexsortkey to be valid hex - change (mediawiki/core)

2014-10-26 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review.

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

Change subject: Validate cmstarthexsortkey/cmendhexsortkey to be valid hex
..

Validate cmstarthexsortkey/cmendhexsortkey to be valid hex

Avoids: Warning: pack(): Type H: illegal hex digit N in
\includes\api\ApiQueryCategoryMembers.php on line 146

Bug: 40809
Change-Id: I1dd732ccec8e6991d0ceac443226f5c7e59fd853
---
M includes/api/ApiQueryCategoryMembers.php
1 file changed, 18 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/18/168818/1

diff --git a/includes/api/ApiQueryCategoryMembers.php 
b/includes/api/ApiQueryCategoryMembers.php
index 5b4a766..3f514c6 100644
--- a/includes/api/ApiQueryCategoryMembers.php
+++ b/includes/api/ApiQueryCategoryMembers.php
@@ -48,6 +48,15 @@
}
 
/**
+* @param string $hexSortkey
+* @return bool
+*/
+   private function validateHexSortkey( $hexSortkey ) {
+   // A hex sortkey has an unbound number of 2 letter pairs
+   return preg_match( '/^(?:[a-f0-9]{2})*$/', $hexSortkey );
+   }
+
+   /**
 * @param ApiPageSet $resultPageSet
 * @return void
 */
@@ -128,6 +137,9 @@
$queryTypes = array_slice( $queryTypes, 
$contTypeIndex );
 
// Add a WHERE clause for sortkey and from
+   if ( !$this-validateHexSortkey( $cont[1] ) ) {
+   $this-dieUsage( 'The hexsortkey 
provided is not valid', 'invalidhexsortkey' );
+   }
// pack( H*, $foo ) is used to convert hex 
back to binary
$escSortkey = $this-getDB()-addQuotes( pack( 
'H*', $cont[1] ) );
$from = intval( $cont[2] );
@@ -143,6 +155,9 @@
if ( $params['startsortkeyprefix'] !== null ) {
$startsortkey = 
Collation::singleton()-getSortkey( $params['startsortkeyprefix'] );
} elseif ( $params['starthexsortkey'] !== null 
) {
+   if ( !$this-validateHexSortkey( 
$params['starthexsortkey'] ) ) {
+   $this-dieUsage( 'The 
hexsortkey provided is not valid', 'invalidhexsortkey' );
+   }
$startsortkey = pack( 'H*', 
$params['starthexsortkey'] );
} else {
$this-logFeatureUsage( 
'list=categorymemberscmstartsortkey' );
@@ -151,6 +166,9 @@
if ( $params['endsortkeyprefix'] !== null ) {
$endsortkey = 
Collation::singleton()-getSortkey( $params['endsortkeyprefix'] );
} elseif ( $params['endhexsortkey'] !== null ) {
+   if ( !$this-validateHexSortkey( 
$params['endhexsortkey'] ) ) {
+   $this-dieUsage( 'The 
hexsortkey provided is not valid', 'invalidhexsortkey' );
+   }
$endsortkey = pack( 'H*', 
$params['endhexsortkey'] );
} else {
$this-logFeatureUsage( 
'list=categorymemberscmendsortkey' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1dd732ccec8e6991d0ceac443226f5c7e59fd853
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender umherirrender_de...@web.de

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


[MediaWiki-commits] [Gerrit] Fetch list of extensions from API list=extdistrepos - change (labs...extdist)

2014-10-26 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Fetch list of extensions from API list=extdistrepos
..

Fetch list of extensions from API list=extdistrepos

Change-Id: I41a993d80d23acf8cd45dc69f81c2f1325b47735
---
M nightly.py
1 file changed, 8 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/extdist 
refs/changes/19/168819/1

diff --git a/nightly.py b/nightly.py
index 313a405..ec0a6a6 100644
--- a/nightly.py
+++ b/nightly.py
@@ -93,10 +93,15 @@
 should not be called directly
 
 logging.debug('Fetching list of all extensions...')
-req = urllib.urlopen(get_extension_list())
-text = req.read()
+data = {
+'action': 'query',
+'list': 'extdistrepos',
+'format': 'json'
+}
+req = urllib.urlopen(conf.API_URL, urllib.urlencode(data))
+j = json.loads(req.read())
 req.close()
-return text
+return '\n'.join(j['query']['extdistrepos']['extensions'])
 
 
 def get_all_extensions(update=False):
@@ -121,12 +126,6 @@
 if conf.get('SUPPORTED_VERSIONS') is None:
 conf.SUPPORTED_VERSIONS = get_extension_config()['versions']
 return conf.SUPPORTED_VERSIONS
-
-
-def get_extension_list():
-if conf.get('EXT_LIST') is None:
-conf.EXT_LIST = get_extension_config()['extension-list']
-return conf.EXT_LIST
 
 
 def fetch_extension_config():

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41a993d80d23acf8cd45dc69f81c2f1325b47735
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/extdist
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com

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


[MediaWiki-commits] [Gerrit] Revert Add SVG versions of toolbar icons - change (mediawiki...WikiEditor)

2014-10-26 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

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

Change subject: Revert Add SVG versions of toolbar icons
..

Revert Add SVG versions of toolbar icons

There were issues with shadows, and the sprite creating weird
offsetted buttons on Chrome.
Subsequent attempts have been incomplete at solving these, so
reverting this and hoping that the next person to attempt a conversion
to SVG is more successful.

This reverts commit e027051c58a8e76b1d254fde8ed62421f3740f32.

Bug: 35342
Change-Id: Id296899a2c3746957c17068ab17ca8266f6ff0d3
---
D modules/images/toolbar/button-sprite.svg
D modules/images/toolbar/format-big.svg
D modules/images/toolbar/format-bold-A.svg
D modules/images/toolbar/format-bold-B.svg
D modules/images/toolbar/format-bold-F.svg
D modules/images/toolbar/format-bold-G.svg
D modules/images/toolbar/format-bold-N.svg
D modules/images/toolbar/format-bold-P.svg
D modules/images/toolbar/format-bold-V.svg
D modules/images/toolbar/format-bold.svg
D modules/images/toolbar/format-indent.svg
D modules/images/toolbar/format-italic-A.svg
D modules/images/toolbar/format-italic-C.svg
D modules/images/toolbar/format-italic-K.svg
D modules/images/toolbar/format-italic-i.svg
D modules/images/toolbar/format-italic.svg
D modules/images/toolbar/format-olist.svg
D modules/images/toolbar/format-small.svg
D modules/images/toolbar/format-subscript.svg
D modules/images/toolbar/format-superscript.svg
D modules/images/toolbar/format-ulist.svg
D modules/images/toolbar/insert-file.svg
D modules/images/toolbar/insert-gallery.svg
D modules/images/toolbar/insert-ilink.svg
D modules/images/toolbar/insert-link.svg
D modules/images/toolbar/insert-newline.svg
D modules/images/toolbar/insert-nowiki.svg
D modules/images/toolbar/insert-redirect.svg
D modules/images/toolbar/insert-reference.svg
D modules/images/toolbar/insert-signature.svg
D modules/images/toolbar/insert-table.svg
D modules/images/toolbar/insert-xlink.svg
D modules/images/toolbar/search-replace.svg
M modules/jquery.wikiEditor.toolbar.css
34 files changed, 1 insertion(+), 7,798 deletions(-)


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


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id296899a2c3746957c17068ab17ca8266f6ff0d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
Gerrit-Branch: master
Gerrit-Owner: TheDJ hartman.w...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Fix missing edit preview - change (mediawiki...MobileFrontend)

2014-10-26 Thread Florianschmidtwelzow (Code Review)
Florianschmidtwelzow has uploaded a new change for review.

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

Change subject: Fix missing edit preview
..

Fix missing edit preview

Add a new line to section.hogan, too.

Bug: 72522
Change-Id: I16edec975a16a87f1f426d84dd126ac8aa83d90e
---
M javascripts/modules/editor/EditorOverlay.js
M templates/section.hogan
2 files changed, 3 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/22/168822/1

diff --git a/javascripts/modules/editor/EditorOverlay.js 
b/javascripts/modules/editor/EditorOverlay.js
index 03eb8b1..dc08ed2 100644
--- a/javascripts/modules/editor/EditorOverlay.js
+++ b/javascripts/modules/editor/EditorOverlay.js
@@ -5,7 +5,6 @@
$.inArray( mw.config.get( 'wgNamespaceNumber' ), 
mw.config.get( 'wgVisualEditorConfig' ).namespaces )  -1 
mw.config.get( 'wgTranslatePageTranslation' ) !== 
'translation' 
mw.config.get( 'wgPageContentModel' ) === 'wikitext',
-   Section = M.require( 'Section' ),
EditorApi = M.require( 'modules/editor/EditorApi' ),
AbuseFilterPanel = M.require( 'modules/editor/AbuseFilterPanel' 
),
EditorOverlay;
@@ -140,11 +139,9 @@
this.api.getPreview( params ).done( function ( 
parsedText, parsedSectionLine ) {
// On desktop edit summaries strip tags. Mimic 
this behavior on mobile devices
self.sectionLine = $( 'div/' ).html( 
parsedSectionLine ).text();
-   new Section( {
-   el: self.$preview,
-   content: parsedText
// bug 49218: stop links from being clickable 
(note user can still hold down to navigate to them)
-   } ).$( 'a' ).on( 'click', false );
+   self.$preview.html( parsedText ).find( 'a' 
).on( 'click', false );
+
// Emit event so we can perform enhancements to 
page
M.emit( 'edit-preview', self );
} ).fail( function () {
diff --git a/templates/section.hogan b/templates/section.hogan
index e9c0ea0..75af10f 100644
--- a/templates/section.hogan
+++ b/templates/section.hogan
@@ -1 +1 @@
-h{{level}} id={{anchor}}{{{line}}}/h{{level}}{{{text}}}
\ No newline at end of file
+h{{level}} id={{anchor}}{{{line}}}/h{{level}}{{{text}}}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16edec975a16a87f1f426d84dd126ac8aa83d90e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow florian.schmidt.wel...@t-online.de

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


[MediaWiki-commits] [Gerrit] EditorApi: Check for sections - change (mediawiki...MobileFrontend)

2014-10-26 Thread Florianschmidtwelzow (Code Review)
Florianschmidtwelzow has uploaded a new change for review.

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

Change subject: EditorApi: Check for sections
..

EditorApi: Check for sections

Don't try to access an undefined object.

Bug: 72521
Change-Id: I8b88bda22e2219cf65233fd6f0a6ee15444fac3d
---
M javascripts/modules/editor/EditorApi.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/23/168823/1

diff --git a/javascripts/modules/editor/EditorApi.js 
b/javascripts/modules/editor/EditorApi.js
index 5585797..c0faf59 100644
--- a/javascripts/modules/editor/EditorApi.js
+++ b/javascripts/modules/editor/EditorApi.js
@@ -192,7 +192,7 @@
if ( resp  resp.parse  resp.parse.text ) {
// section 0 haven't a section name so 
skip
if ( self.sectionId !== 0 
-   resp.parse.sections 
+   resp.parse.sections[0] !== 
undefined 
resp.parse.sections[0].line !== 
undefined
) {
sectionLine = 
resp.parse.sections[0].line;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b88bda22e2219cf65233fd6f0a6ee15444fac3d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow florian.schmidt.wel...@t-online.de

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


[MediaWiki-commits] [Gerrit] Added d3 js chart loaded with celerity/javelin - change (phabricator...Sprint)

2014-10-26 Thread Christopher Johnson (WMDE) (Code Review)
Christopher Johnson (WMDE) has uploaded a new change for review.

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

Change subject: Added d3 js chart loaded with celerity/javelin
..

Added d3 js chart loaded with celerity/javelin

Change-Id: I03e0755911d583678e1607d509af9ad848747029
---
M src/query/SprintQuery.php
M src/view/BurndownDataView.php
M src/view/SprintReportBurndownView.php
3 files changed, 308 insertions(+), 173 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/phabricator/extensions/Sprint 
refs/changes/24/168824/1

diff --git a/src/query/SprintQuery.php b/src/query/SprintQuery.php
index b8c9aae..c312643 100644
--- a/src/query/SprintQuery.php
+++ b/src/query/SprintQuery.php
@@ -22,6 +22,13 @@
 return $this;
   }
 
+  public function getViewerHandles($request, array $phids) {
+return id(new PhabricatorHandleQuery())
+-setViewer($request-getUser())
+-withPHIDs($phids)
+-execute();
+  }
+
   public function getAuxFields() {
 $field_list = PhabricatorCustomField::getObjectFields($this-project, 
PhabricatorCustomField::ROLE_EDIT);
 $field_list-setViewer($this-viewer);
diff --git a/src/view/BurndownDataView.php b/src/view/BurndownDataView.php
index ee05124..5e962df 100644
--- a/src/view/BurndownDataView.php
+++ b/src/view/BurndownDataView.php
@@ -40,7 +40,7 @@
 
   public function render() {
 
-$chart = $this-buildBurnDownChart();
+$chart = $this-buildC3Chart();
 $tasks_table = $this-buildTasksTable();
 $burndown_table = $this-buildBurnDownTable();
 $event_table = $this-buildEventTable();
@@ -78,7 +78,6 @@
 
 
 $data = array(array(
-pht('Date'),
 pht('Total Points'),
 pht('Remaining Points'),
 pht('Ideal Points'),
@@ -91,7 +90,6 @@
 $future = new DateTime($date-getDate())  id(new 
DateTime())-setTime(0, 0);
   }
   $data[] = array(
-  $date-getDate(),
   $future ? null : $date-points_total,
   $future ? null : $date-points_remaining,
   $date-points_ideal_remaining,
@@ -99,9 +97,25 @@
   );
 
 }
+$data = $this-transposeArray($data);
 return $data;
-
   }
+
+  private function transposeArray($array) {
+$transposed_array = array();
+if ($array) {
+  foreach ($array as $row_key = $row) {
+if (is_array($row)  !empty($row)) { //check to see if there is a 
second dimension
+  foreach ($row as $column_key = $element) {
+$transposed_array[$column_key][$row_key] = $element;
+  }
+} else {
+  $transposed_array[0][$row_key] = $row;
+}
+  }
+ return $transposed_array;
+ }
+   }
 
   // Now loop through the events and build the data for each day
   private function buildDailyData($events, $start, $end) {
@@ -198,6 +212,39 @@
 }
   }
 
+  private function buildC3Chart() {
+$this-data = $this-buildChartDataSet();
+$totalpoints = $this-data[0];
+$remainingpoints = $this-data[1];
+$idealpoints = $this-data[2];
+$pointstoday = $this-data[3];
+$timeseries = array_keys($this-dates);
+
+require_celerity_resource('d3');
+require_celerity_resource('c3-css');
+require_celerity_resource('c3');
+
+$id = 'chart';
+Javelin::initBehavior('c3-chart', array(
+'hardpoint' = $id,
+'timeseries' = $timeseries,
+'totalpoints' = $totalpoints,
+'remainingpoints' = $remainingpoints,
+'idealpoints' =   $idealpoints,
+'pointstoday' =   $pointstoday
+));
+
+$chart= id(new PHUIObjectBoxView())
+-setHeaderText(pht('Burndown for ' . $this-project-getName()))
+ -appendChild(phutil_tag('div',
+array(
+'id' = 'chart',
+'style' = 'width: 100%; height:400px'
+), ''));
+
+return $chart;
+  }
+
   private function buildBurnDownChart() {
 
 $this-data = $this-buildChartDataSet();
diff --git a/src/view/SprintReportBurndownView.php 
b/src/view/SprintReportBurndownView.php
index 5494d82..eda52eb 100644
--- a/src/view/SprintReportBurndownView.php
+++ b/src/view/SprintReportBurndownView.php
@@ -16,198 +16,265 @@
 
   public function render() {
 
-  $handle = null;
+$filter = $this-BuildFilter();
+$chart = $this-buildBurnDownChart();
+$table = $this-buildStatsTable();
+return array($filter, $chart, $table);
+  }
 
-  $project_phid = $this-request-getStr('project');
-  if ($project_phid) {
-$phids = array($project_phid);
-$handles = $this-loadViewerHandles($phids);
-$handle = $handles[$project_phid];
-  }
+  private function getXactionData($project_phid) {
+ $query = id(new SprintQuery())
+-setPHID($project_phid);
+  $data = $query-getXactionData(ManiphestTransaction::TYPE_STATUS);
+return $data;
+  }
 
-  $query = id(new SprintQuery())
+  private function buildFilter() {
+$handle = null;

[MediaWiki-commits] [Gerrit] Remove code in ViewEntityAction, duplicating Article::isCurr... - change (mediawiki...Wikibase)

2014-10-26 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Remove code in ViewEntityAction, duplicating 
Article::isCurrent()
..

Remove code in ViewEntityAction, duplicating Article::isCurrent()

also improved code that checks if viewing a diff

Change-Id: If2e6758f113dd0897d5aab67b84a4377cce6ac65
---
M repo/includes/actions/ViewEntityAction.php
1 file changed, 9 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/25/168825/1

diff --git a/repo/includes/actions/ViewEntityAction.php 
b/repo/includes/actions/ViewEntityAction.php
index 96a47f9..f5f304b 100644
--- a/repo/includes/actions/ViewEntityAction.php
+++ b/repo/includes/actions/ViewEntityAction.php
@@ -132,25 +132,18 @@
 * of the page's current revision.
 */
private function isEditable() {
-   $article = $this-getArticle();
-
-   if ( !$article-getPage()-exists() ) {
-   // showing non-existing entity
-   return false;
-   }
-
-   if ( $article-getOldID()  0
- ( $article-getOldID() !== 
$article-getPage()-getLatest() ) ) {
-   // showing old content
-   return false;
-   }
-
-   if ( $this-getRequest()-getCheck( 'diff' ) ) {
-   // showing a diff
+   if ( !$this-getArticle()-isCurrent() || $this-isDiff() ) {
return false;
}
 
return true;
+   }
+
+   /**
+* @return boolean
+*/
+   private function isDiff() {
+   return $this-getRequest()-getCheck( 'diff' );
}
 
/**
@@ -178,7 +171,6 @@
$editable = $permissionStatus-isOK();
}
 
-   // View it!
$parserOptions = 
$this-getArticle()-getPage()-makeParserOptions( 
$this-getContext()-getUser() );
 
if ( !$editable ) {
@@ -204,7 +196,7 @@
}
 
// Create and set the title.
-   if ( $this-getRequest()-getCheck( 'diff' ) ) {
+   if ( $this-isDiff() ) {
// Escaping HTML characters in order to retain original 
label that may contain HTML
// characters. This prevents having characters 
evaluated or stripped via
// OutputPage::setPageTitle:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2e6758f113dd0897d5aab67b84a4377cce6ac65
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com

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


[MediaWiki-commits] [Gerrit] Added d3 js chart loaded with celerity/javelin - change (phabricator...Sprint)

2014-10-26 Thread Christopher Johnson (WMDE) (Code Review)
Christopher Johnson (WMDE) has submitted this change and it was merged.

Change subject: Added d3 js chart loaded with celerity/javelin
..


Added d3 js chart loaded with celerity/javelin

Change-Id: I03e0755911d583678e1607d509af9ad848747029
---
M src/query/SprintQuery.php
M src/view/BurndownDataView.php
M src/view/SprintReportBurndownView.php
3 files changed, 308 insertions(+), 173 deletions(-)

Approvals:
  Christopher Johnson (WMDE): Verified; Looks good to me, approved



diff --git a/src/query/SprintQuery.php b/src/query/SprintQuery.php
index b8c9aae..c312643 100644
--- a/src/query/SprintQuery.php
+++ b/src/query/SprintQuery.php
@@ -22,6 +22,13 @@
 return $this;
   }
 
+  public function getViewerHandles($request, array $phids) {
+return id(new PhabricatorHandleQuery())
+-setViewer($request-getUser())
+-withPHIDs($phids)
+-execute();
+  }
+
   public function getAuxFields() {
 $field_list = PhabricatorCustomField::getObjectFields($this-project, 
PhabricatorCustomField::ROLE_EDIT);
 $field_list-setViewer($this-viewer);
diff --git a/src/view/BurndownDataView.php b/src/view/BurndownDataView.php
index ee05124..5e962df 100644
--- a/src/view/BurndownDataView.php
+++ b/src/view/BurndownDataView.php
@@ -40,7 +40,7 @@
 
   public function render() {
 
-$chart = $this-buildBurnDownChart();
+$chart = $this-buildC3Chart();
 $tasks_table = $this-buildTasksTable();
 $burndown_table = $this-buildBurnDownTable();
 $event_table = $this-buildEventTable();
@@ -78,7 +78,6 @@
 
 
 $data = array(array(
-pht('Date'),
 pht('Total Points'),
 pht('Remaining Points'),
 pht('Ideal Points'),
@@ -91,7 +90,6 @@
 $future = new DateTime($date-getDate())  id(new 
DateTime())-setTime(0, 0);
   }
   $data[] = array(
-  $date-getDate(),
   $future ? null : $date-points_total,
   $future ? null : $date-points_remaining,
   $date-points_ideal_remaining,
@@ -99,9 +97,25 @@
   );
 
 }
+$data = $this-transposeArray($data);
 return $data;
-
   }
+
+  private function transposeArray($array) {
+$transposed_array = array();
+if ($array) {
+  foreach ($array as $row_key = $row) {
+if (is_array($row)  !empty($row)) { //check to see if there is a 
second dimension
+  foreach ($row as $column_key = $element) {
+$transposed_array[$column_key][$row_key] = $element;
+  }
+} else {
+  $transposed_array[0][$row_key] = $row;
+}
+  }
+ return $transposed_array;
+ }
+   }
 
   // Now loop through the events and build the data for each day
   private function buildDailyData($events, $start, $end) {
@@ -198,6 +212,39 @@
 }
   }
 
+  private function buildC3Chart() {
+$this-data = $this-buildChartDataSet();
+$totalpoints = $this-data[0];
+$remainingpoints = $this-data[1];
+$idealpoints = $this-data[2];
+$pointstoday = $this-data[3];
+$timeseries = array_keys($this-dates);
+
+require_celerity_resource('d3');
+require_celerity_resource('c3-css');
+require_celerity_resource('c3');
+
+$id = 'chart';
+Javelin::initBehavior('c3-chart', array(
+'hardpoint' = $id,
+'timeseries' = $timeseries,
+'totalpoints' = $totalpoints,
+'remainingpoints' = $remainingpoints,
+'idealpoints' =   $idealpoints,
+'pointstoday' =   $pointstoday
+));
+
+$chart= id(new PHUIObjectBoxView())
+-setHeaderText(pht('Burndown for ' . $this-project-getName()))
+ -appendChild(phutil_tag('div',
+array(
+'id' = 'chart',
+'style' = 'width: 100%; height:400px'
+), ''));
+
+return $chart;
+  }
+
   private function buildBurnDownChart() {
 
 $this-data = $this-buildChartDataSet();
diff --git a/src/view/SprintReportBurndownView.php 
b/src/view/SprintReportBurndownView.php
index 5494d82..eda52eb 100644
--- a/src/view/SprintReportBurndownView.php
+++ b/src/view/SprintReportBurndownView.php
@@ -16,198 +16,265 @@
 
   public function render() {
 
-  $handle = null;
+$filter = $this-BuildFilter();
+$chart = $this-buildBurnDownChart();
+$table = $this-buildStatsTable();
+return array($filter, $chart, $table);
+  }
 
-  $project_phid = $this-request-getStr('project');
-  if ($project_phid) {
-$phids = array($project_phid);
-$handles = $this-loadViewerHandles($phids);
-$handle = $handles[$project_phid];
-  }
+  private function getXactionData($project_phid) {
+ $query = id(new SprintQuery())
+-setPHID($project_phid);
+  $data = $query-getXactionData(ManiphestTransaction::TYPE_STATUS);
+return $data;
+  }
 
-  $query = id(new SprintQuery())
+  private function buildFilter() {
+$handle = null;
+$project_phid = $this-request-getStr('project');

[MediaWiki-commits] [Gerrit] upload.py: Allow to ignore warnings - change (pywikibot/core)

2014-10-26 Thread Martineznovo (Code Review)
Martineznovo has uploaded a new change for review.

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

Change subject: upload.py: Allow to ignore warnings
..

upload.py: Allow to ignore warnings

Added the option -ignorewarn to ignore specific warnings, or all warnings,
using the same logic as the abortonwarn. Useful for batch uploads of files
to replace existing ones.

The UploadRobot already had a boolean ignoreWarning variable in
constructor, which has been extended to allow an array of warning
codes to ignore.

The message shown when a warning is found has been extended to display the
warning code, so the user can know what warning code use to ignore or
abort it.

Change-Id: Idf9e562f5a4fbae8184718c66cedc90042379e81
---
M scripts/upload.py
1 file changed, 28 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/26/168826/1

diff --git a/scripts/upload.py b/scripts/upload.py
index 69127b0..d9c827f 100755
--- a/scripts/upload.py
+++ b/scripts/upload.py
@@ -10,7 +10,9 @@
   -noverify Do not ask for verification of the upload description if one
 is given
   -abortonwarn: Abort upload on the specified warning type. If no warning type
-is specified abort on all warnings.
+is specified, aborts on any warning.
+  -ignorewarn:  Ignores specified upload warnings. If no warning type is
+specified, ignores all warnings. Use with caution
   -chunked: Upload the file in chunks (more overhead, but restartable). If
 no value is specified the chunk size is 1 MiB. The value must
 be a number which can be preceded by a suffix. The units are:
@@ -71,7 +73,8 @@
 
 @param ignoreWarning: Set this to True if you want to upload even if
 another file would be overwritten or another mistake would be
-risked.
+risked. You can also set it to an array of warning codes to
+selectively ignore specific warnings.
 
 
 self.url = url
@@ -240,6 +243,13 @@
 else:
 return warn_code in self.aborts
 
+def ignore_on_warn(self, warn_code):
+Determine if the warning message should be ignored.
+if self.ignoreWarning is True:
+return True
+else:
+return warn_code in self.ignoreWarning
+
 def upload_image(self, debug=False):
 Upload the image at self.url to the target wiki.
 
@@ -257,23 +267,28 @@
 pywikibot.output(u'Uploading file to %s via API' % site)
 
 try:
+apiIgnoreWarnings = False
+if self.ignoreWarning == True:
+apiIgnoreWarnings = True
 if self.uploadByUrl:
 site.upload(imagepage, source_url=self.url,
-ignore_warnings=self.ignoreWarning)
+ignore_warnings=apiIgnoreWarnings)
 else:
 if :// in self.url:
 temp = self.read_file_content()
 else:
 temp = self.url
 site.upload(imagepage, source_filename=temp,
-ignore_warnings=self.ignoreWarning,
+ignore_warnings=apiIgnoreWarnings,
 chunk_size=self.chunk_size)
 
 except pywikibot.data.api.UploadWarning as warn:
 pywikibot.output(
-u'We got a warning message: {0}'.format(warn.message))
+u'We got a warning message: {0} - {1}'.format(warn.code, 
warn.message))
 if self.abort_on_warn(warn.code):
 answer = N
+elif self.ignore_on_warn(warn.code):
+answer = y
 else:
 answer = pywikibot.inputChoice(uDo you want to ignore?,
['Yes', 'No'], ['y', 'N'], 'N')
@@ -338,6 +353,7 @@
 useFilename = None
 verifyDescription = True
 aborts = set()
+ignorewarn = set()
 chunk_size = 0
 chunk_size_regex = r'^-chunked(?::(\d+(?:\.\d+)?)[ \t]*(k|ki|m|mi)?b?)?$'
 chunk_size_regex = re.compile(chunk_size_regex, re.I)
@@ -357,6 +373,11 @@
 aborts.add(arg[len('-abortonwarn:'):])
 else:
 aborts = True
+elif arg.startswith('-ignorewarn'):
+if len(arg)  len('-ignorewarn:') and ignorewarn is not True:
+ignorewarn.add(arg[len('-ignorewarn:'):])
+else:
+ignorewarn = True
 elif arg.startswith('-chunked'):
 match = chunk_size_regex.match(arg)
 if match:
@@ -389,7 +410,8 @@
 bot = UploadRobot(url, description=description, useFilename=useFilename,
   keepFilename=keepFilename,
   verifyDescription=verifyDescription,
-   

[MediaWiki-commits] [Gerrit] Add ViewEntityAction tests for diff and old revision - change (mediawiki...Wikibase)

2014-10-26 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Add ViewEntityAction tests for diff and old revision
..

Add ViewEntityAction tests for diff and old revision

Smoke test that if requesting a diff or old revision,
that there are no edit links, and if a diff, it is
indeed showing a diff.

Change-Id: I5e5908fb29302e378c8dcc40110fdbb6152a9916
---
M repo/tests/phpunit/includes/actions/ViewEntityActionTest.php
1 file changed, 47 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/27/168827/1

diff --git a/repo/tests/phpunit/includes/actions/ViewEntityActionTest.php 
b/repo/tests/phpunit/includes/actions/ViewEntityActionTest.php
index 36282ab..4a0d4b6 100644
--- a/repo/tests/phpunit/includes/actions/ViewEntityActionTest.php
+++ b/repo/tests/phpunit/includes/actions/ViewEntityActionTest.php
@@ -62,19 +62,61 @@
 */
public function testShow( $handle, $regex ) {
$page = $this-getTestItemPage( $handle );
-   $action = $this-createAction( view, $page );
-
-   $action-show();
-   $html = $action-getOutput()-getHTML();
+   $html = $this-executeViewAction( $page, array() );
 
$this-assertRegExp( $regex, $html );
+   }
+
+   public function testShowDiff() {
+   $page = $this-getTestItemPage( 'Berlin' );
+
+   $latest = $page-getRevision();
+   $previous = $latest-getPrevious();
+
+   $params = array(
+   'diff' = $latest-getId(),
+   'oldid' = $previous-getId()
+   );
+
+   $html = $this-executeViewAction( $page, $params );
+
+   $this-assertRegExp( '/diff-currentversion-title/', $html, 'is 
diff view' );
+   $this-assertNotRegExp( '/wikibase-edittoolbar-container/', 
$html, 'no edit toolbar' );
+   }
+
+   public function testShowOldRevision_hasNoEditLinks() {
+   $page = $this-getTestItemPage( 'Berlin' );
+
+   $latest = $page-getRevision();
+   $previous = $latest-getPrevious();
+
+   $params = array(
+   'oldid' = $previous-getId()
+   );
+
+   $html = $this-executeViewAction( $page, $params );
+
+   $this-assertNotRegExp( '/wikibase-edittoolbar-container/', 
$html, 'no edit toolbar' );
+   }
+
+   /**
+* @param WikiPage $page
+* @param string[] $params
+*
+* @return string
+*/
+   private function executeViewAction( WikiPage $page, array $params ) {
+   $action = $this-createAction( 'view', $page, $params );
+   $action-show();
+
+   return $action-getOutput()-getHTML();
}
 
public function testShow404() {
$id = new ItemId( 'q1122334455' );
$title = 
WikibaseRepo::getDefaultInstance()-getEntityContentFactory()-getTitleForId( 
$id );
$page = new WikiPage( $title );
-   $action = $this-createAction( view, $page );
+   $action = $this-createAction( 'view', $page );
 
/* @var \FauxResponse $response */
$response = $action-getRequest()-response();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e5908fb29302e378c8dcc40110fdbb6152a9916
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com

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


[MediaWiki-commits] [Gerrit] Remove full stop in description message - change (mediawiki...chameleon)

2014-10-26 Thread Siebrand (Code Review)
Siebrand has uploaded a new change for review.

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

Change subject: Remove full stop in description message
..

Remove full stop in description message

Description messages do not end with a full stop.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/chameleon 
refs/changes/28/168828/1

diff --git a/i18n/en.json b/i18n/en.json
index 7d1738f..6245e10 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -5,7 +5,7 @@
]
},
skinname-chameleon: Chameleon,
-   chameleon-desc: The Chameleon skin.,
+   chameleon-desc: The Chameleon skin,
chameleon-loggedin: You are logged in as $1.,
chameleon-notloggedin: You are not logged in,
chameleon-newmessages: You have new messages.,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I54cb6f28c959f5b7a38c21e193de9b0dd2d692c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/chameleon
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl

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


[MediaWiki-commits] [Gerrit] Remove full stop in description message - change (mediawiki...Modern)

2014-10-26 Thread Siebrand (Code Review)
Siebrand has uploaded a new change for review.

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

Change subject: Remove full stop in description message
..

Remove full stop in description message

Description messages do not end with a full stop.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Modern 
refs/changes/29/168829/1

diff --git a/i18n/en.json b/i18n/en.json
index 398e532..a22435e 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -2,5 +2,5 @@
modern.css: /* CSS placed here will affect users of the Modern skin 
*/,
modern.js: /* Any JavaScript here will be loaded for users using the 
Modern skin */,
skinname-modern: Modern,
-   modern-desc: A blue/grey theme with sidebar and top bar. Derived 
from MonoBook.
+   modern-desc: A blue/grey theme with sidebar and top bar. Derived 
from MonoBook
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I463739f1323987f31797387f710a3feef0dbc42a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Modern
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl

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


[MediaWiki-commits] [Gerrit] Split ViewEntityAction labelText code into several methods - change (mediawiki...Wikibase)

2014-10-26 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Split ViewEntityAction labelText code into several methods
..

Split ViewEntityAction labelText code into several methods

Change-Id: I165720eed483299c1472eb160154ca3b96231eaf
---
M repo/includes/actions/ViewEntityAction.php
1 file changed, 59 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/30/168830/1

diff --git a/repo/includes/actions/ViewEntityAction.php 
b/repo/includes/actions/ViewEntityAction.php
index f5f304b..7160d7c 100644
--- a/repo/includes/actions/ViewEntityAction.php
+++ b/repo/includes/actions/ViewEntityAction.php
@@ -5,6 +5,7 @@
 use Article;
 use ContentHandler;
 use LogEventsList;
+use OutputPage;
 use SpecialPage;
 use ViewAction;
 use Wikibase\Repo\Content\EntityHandler;
@@ -154,11 +155,11 @@
 * @param EntityContent $content
 */
protected function displayEntityContent( EntityContent $content ) {
-   $out = $this-getOutput();
+   $outputPage = $this-getOutput();
$editable = $this-isEditable();
 
// NOTE: page-wide property, independent of user permissions
-   $out-addJsConfigVars( 'wbIsEditView', $editable );
+   $outputPage-addJsConfigVars( 'wbIsEditView', $editable );
 
if ( $editable  !$content-isRedirect() ) {
$permissionChecker = $this-getPermissionChecker();
@@ -181,38 +182,71 @@
$this-getArticle()-setParserOptions( $parserOptions );
$this-getArticle()-view();
 
+   $this-applyLabelToTitleText( $outputPage, $content );
+   }
+
+   /**
+* @param OutputPage $outputPage
+*/
+   private function applyLabelToTitleText( OutputPage $outputPage, 
EntityContent $content ) {
+   // Figure out which label to use for title.
+   $labelText = $this-getLabelText( $content );
+
+   if ( $this-isDiff() ) {
+   $this-setPageTitle( $outputPage, $labelText );
+   } else {
+   $this-setHTMLTitle( $outputPage, $labelText );
+   }
+   }
+
+   /**
+* @param OutputPage $outputPage
+* @param string $labelText
+*/
+   private function setPageTitle( OutputPage $outputPage, $labelText ) {
+   // Escaping HTML characters in order to retain original label 
that may contain HTML
+   // characters. This prevents having characters evaluated or 
stripped via
+   // OutputPage::setPageTitle:
+   $outputPage-setPageTitle(
+   $this-msg(
+   'difference-title'
+   // This should be something like the following,
+   // $labelLang-getDirMark() . $labelText . 
$wgLang-getDirMark()
+   // or should set the attribute of the h1 to 
correct direction.
+   // Still note that the direction is auto so 
guessing should
+   // give the right direction in most cases.
+   )-rawParams( htmlspecialchars( $labelText ) )
+   );
+   }
+
+   /**
+* @param OutputPage $outputPage
+* @param string $labelText
+*/
+   private function setHTMLTitle( OutputPage $outputPage, $labelText ) {
+   // Prevent replacing {{...}} by using rawParams() instead of 
params():
+   $outputPage-setHTMLTitle( $this-msg( 'pagetitle' 
)-rawParams( $labelText ) );
+   }
+
+   /**
+* @param EntityContent $content
+*
+* @return string
+*/
+   private function getLabelText( EntityContent $content ) {
// Figure out which label to use for title.
$languageFallbackChain = $this-getLanguageFallbackChain();
$labelData = null;
 
if ( !$content-isRedirect() ) {
-   $labelData = 
$languageFallbackChain-extractPreferredValueOrAny( 
$content-getEntity()-getLabels() );
+   $labels = $content-getEntity()-getLabels();
+   $labelData = 
$languageFallbackChain-extractPreferredValueOrAny( $labels );
}
 
if ( $labelData ) {
-   $labelText = $labelData['value'];
+   return $labelData['value'];
} else {
-   $labelText = 
$content-getEntityId()-getSerialization();
-   }
-
-   // Create and set the title.
-   if ( $this-isDiff() ) {
-   // Escaping HTML characters in order to retain original 
label that may contain HTML
-   // characters. 

[MediaWiki-commits] [Gerrit] Localisation updates from https://translatewiki.net. - change (mediawiki/core)

2014-10-26 Thread Siebrand (Code Review)
Siebrand has uploaded a new change for review.

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

Change subject: Localisation updates from https://translatewiki.net.
..

Localisation updates from https://translatewiki.net.

Change-Id: I1c1be5f954c274bb2479cd7068d32562db05b670
---
M languages/messages/MessagesMai.php
1 file changed, 18 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/34/168834/1

diff --git a/languages/messages/MessagesMai.php 
b/languages/messages/MessagesMai.php
index 09ae5a6..abba540 100644
--- a/languages/messages/MessagesMai.php
+++ b/languages/messages/MessagesMai.php
@@ -26,3 +26,21 @@
 
 $fallback = 'hi';
 
+$namespaceNames = array(
+   NS_MEDIA= 'मेडिया',
+   NS_SPECIAL  = 'विशेष',
+   NS_TALK = 'वार्ता',
+   NS_USER = 'प्रयोगकर्ता',
+   NS_USER_TALK= 'प्रयोगकर्ता_वार्ता',
+   NS_PROJECT_TALK = '$1_वार्ता',
+   NS_FILE = 'फाइल',
+   NS_FILE_TALK= 'फाइल_वार्ता',
+   NS_MEDIAWIKI= 'मेडियाविकि',
+   NS_MEDIAWIKI_TALK   = 'मेडियाविकि_वार्ता',
+   NS_TEMPLATE = 'आकृति',
+   NS_TEMPLATE_TALK= 'आकृति_वार्ता',
+   NS_HELP = 'मद्दत',
+   NS_HELP_TALK= 'मद्दत_वार्ता',
+   NS_CATEGORY = 'श्रेणी',
+   NS_CATEGORY_TALK= 'श्रेणी_वार्ता',
+);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c1be5f954c274bb2479cd7068d32562db05b670
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl

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


[MediaWiki-commits] [Gerrit] Semiautomatically compare and synchronise JS and PHP docs - change (oojs/ui)

2014-10-26 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Semiautomatically compare and synchronise JS and PHP docs
..

Semiautomatically compare and synchronise JS and PHP docs

I wrote two Ruby scripts to compare the documentation, reviewed their
output and tweaked all of the files to match as well as possible.

I intend to use them further to generate some data for unit testing.

== docparser.rb ==

A quick documentation parser for our JS and PHP code, mostly
compatible with JSDuck and Doxygen syntaxes we use. Generates a JSON
file containing most of the interesting information for a set of
files. Run with -h for usage instructions and examples.

It has pretty much no error handling, so please write the docs
correctly ;) Some of the syntax errors I found running it are fixed in
previous commit I50fd658b, probably some more in this one.

* Supported keywords: constructor, class, method, property, var,
  event, extends, mixins, param, cfg, return, private, static, ignore
* Unsupported keywords: abstract, inheritable, deprecated, singleton,
  throws, chainable, fires, localdoc, inheritdoc

== doccomparer.rb ==

A quick documentation comparison tool for our JS and PHP code, using
docparser.rb. Generates a pretty-printed comparison of documentation
for two sets of files. Run with -h for usage instructions and examples.

Includes some hacks to lower the number of false positives where JS
and PHP language features, inheritance hierarchy or doc format
capabilities differ. (See #smart_compare_process and
#sanitize_description.)

Example output snippet:

  FieldLayout: JS/PHP
Basic:
Methods:
#constructor: MISMATCH
config: MISMATCH
help: PHP missing
onFieldDisable: PHP missing
onLabelClick: PHP missing
Properties:
align: JS missing

So FieldLayout is missing documentation for the 'help' configuration
option in PHP (which is unimplemented right now), several event-handling
methods in PHP, and the 'align' property (we don't have JS non-static
properties documented at all right now).

One notable issue is that having a static and non-static property with
the same name is not handled, and several JS classes depend on that.
We should probably avoid it, as it's not allowed in PHP.

Bug: 72455
Change-Id: If9115dd5ac5dc7fb355abd03bb016a436eb3fca1
---
A bin/doccomparer.rb
A bin/docparser.rb
M php/OoUiElement.php
M php/OoUiLayout.php
M php/OoUiTheme.php
M php/OoUiWidget.php
M php/elements/OoUiButtonElement.php
M php/elements/OoUiFlaggedElement.php
M php/elements/OoUiGroupElement.php
M php/elements/OoUiIconElement.php
M php/elements/OoUiIndicatorElement.php
M php/elements/OoUiLabelElement.php
M php/elements/OoUiTitledElement.php
M php/layouts/OoUiFieldLayout.php
M php/layouts/OoUiFieldsetLayout.php
M php/layouts/OoUiFormLayout.php
M php/layouts/OoUiGridLayout.php
M php/layouts/OoUiPanelLayout.php
M php/themes/OoUiMediaWikiTheme.php
M php/widgets/OoUiButtonGroupWidget.php
M php/widgets/OoUiButtonInputWidget.php
M php/widgets/OoUiButtonWidget.php
M php/widgets/OoUiCheckboxInputWidget.php
M php/widgets/OoUiIconWidget.php
M php/widgets/OoUiIndicatorWidget.php
M php/widgets/OoUiInputWidget.php
M php/widgets/OoUiLabelWidget.php
M php/widgets/OoUiTextInputWidget.php
M src/Element.js
M src/Theme.js
M src/elements/ButtonElement.js
M src/elements/FlaggedElement.js
M src/elements/GroupElement.js
M src/elements/IconElement.js
M src/elements/IndicatorElement.js
M src/elements/LabelElement.js
M src/elements/TitledElement.js
M src/layouts/FieldLayout.js
M src/layouts/FieldsetLayout.js
M src/themes/mediawiki/MediaWikiTheme.js
M src/widgets/ButtonGroupWidget.js
M src/widgets/ButtonInputWidget.js
M src/widgets/CheckboxInputWidget.js
M src/widgets/InputWidget.js
M src/widgets/TextInputWidget.js
45 files changed, 587 insertions(+), 127 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/35/168835/1

diff --git a/bin/doccomparer.rb b/bin/doccomparer.rb
new file mode 100644
index 000..da1c7c9
--- /dev/null
+++ b/bin/doccomparer.rb
@@ -0,0 +1,156 @@
+require 'pp'
+require_relative 'docparser'
+
+# convert [ {name: 'foo'}, … ] to { foo: {name: 'foo'}, … }
+def reindex arg
+   if arg.is_a?(Array)  arg.all?{|v| v.is_a? Hash }
+   Hash[ arg.map{|v| [ v[:name], reindex(v) ] } ]
+   elsif arg.is_a? Hash
+   arg.each_pair{|k, v| arg[k] = reindex(v) }
+   else
+   arg
+   end
+end
+
+def indent text, tabs
+   text == '' ? text : text.gsub(/^/, '  '*tabs)
+end
+
+# whitespace-insensitive strings
+def canonicalize value
+   if value.is_a? String
+   value.strip.gsub(/\s+/, ' ')
+   elsif value.is_a? Array
+   value.map{|v| canonicalize v }
+   elsif value.is_a? Hash
+   value.each_pair{|k, v| value[k] = canonicalize v }
+   

[MediaWiki-commits] [Gerrit] Localisation updates from https://translatewiki.net. - change (mediawiki/core)

2014-10-26 Thread Siebrand (Code Review)
Siebrand has uploaded a new change for review.

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

Change subject: Localisation updates from https://translatewiki.net.
..

Localisation updates from https://translatewiki.net.

Change-Id: I7d8ecd624b63c3323afd159600d8cca3806a7760
---
M languages/messages/MessagesAng.php
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/168836/1

diff --git a/languages/messages/MessagesAng.php 
b/languages/messages/MessagesAng.php
index aa1d9d1..2f86c78 100644
--- a/languages/messages/MessagesAng.php
+++ b/languages/messages/MessagesAng.php
@@ -11,8 +11,11 @@
 $namespaceNames = array(
NS_SPECIAL  = 'Syndrig',
NS_TALK = 'Mōtung',
-   NS_FILE = 'Biliþ',
-   NS_FILE_TALK= 'Biliþmōtung',
+   NS_USER = 'Brūcend',
+   NS_USER_TALK= 'Brūcendmōtung',
+   NS_FILE = 'Ymele',
+   NS_FILE_TALK= 'Ymelmōtung',
+   NS_MEDIAWIKI_TALK   = 'MediaWikimōtung',
NS_TEMPLATE = 'Bysen',
NS_TEMPLATE_TALK= 'Bysenmōtung',
NS_HELP = 'Help',
@@ -26,8 +29,9 @@
'Motung'= NS_TALK,
'Brucend'   = NS_USER,
'Brucendmotung' = NS_USER_TALK,
-   'Biliþgesprec'  = NS_FILE_TALK,
+   'Biliþ' = NS_FILE,
'Biliþmotung'   = NS_FILE_TALK,
+   'Biliþmōtung'   = NS_FILE_TALK,
'Bysengesprec'  = NS_TEMPLATE_TALK,
'Bysenmotung'   = NS_TEMPLATE_TALK,
'Helpgesprec'   = NS_HELP_TALK,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d8ecd624b63c3323afd159600d8cca3806a7760
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl

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


[MediaWiki-commits] [Gerrit] Bug 72527 - CircularRedirect exception throws another exception - change (pywikibot/core)

2014-10-26 Thread Mpaa (Code Review)
Mpaa has uploaded a new change for review.

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

Change subject: Bug 72527 - CircularRedirect exception throws another exception
..

Bug 72527 - CircularRedirect exception throws another exception

CircularRedirect needs a page as input param.

Change-Id: I65cc58a1568b922336fcf5c85651cdc4172444d2
---
M pywikibot/site.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/37/168837/1

diff --git a/pywikibot/site.py b/pywikibot/site.py
index 17611ee..86de719 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -2344,7 +2344,7 @@
 target_title = u'%(title)s%(section)s' % redirmap[title]
 if target_title == title or pages not in result['query']:
 # no pages element indicates a circular redirect
-raise pywikibot.CircularRedirect(target_title)
+raise pywikibot.CircularRedirect(page)
 pagedata = list(result['query']['pages'].values())[0]
 # there should be only one value in 'pages', and it is the target
 if self.sametitle(pagedata['title'], target_title):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65cc58a1568b922336fcf5c85651cdc4172444d2
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa mpaa.w...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add missing underscore - change (translatewiki)

2014-10-26 Thread Siebrand (Code Review)
Siebrand has uploaded a new change for review.

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

Change subject: Add missing underscore
..

Add missing underscore

Change-Id: I1887724ad68064ddfee94524f59cfba69993970d
---
M groups/Europeana/Europeana.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/38/168838/1

diff --git a/groups/Europeana/Europeana.yaml b/groups/Europeana/Europeana.yaml
index ac49b4a..004e800 100644
--- a/groups/Europeana/Europeana.yaml
+++ b/groups/Europeana/Europeana.yaml
@@ -24,6 +24,7 @@
   optional:
 - date.abbr_month_names.0
 - date.month_names.0
+- formtastic.labels.taxonomy_term.collection_day.*
 - number.currency.format.significant
 - number.currency.format.strip_insignificant_zeros
 - number.format.significant
@@ -32,7 +33,6 @@
 - number.human.format.delimiter
 - number.percentage.format.delimiter
 - number.precision.format.delimiter
-- formtastic.labels.taxonomy_term.collection day.*
   ignored:
 - dummy
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1887724ad68064ddfee94524f59cfba69993970d
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl

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


[MediaWiki-commits] [Gerrit] Update extension name and key name - change (translatewiki)

2014-10-26 Thread Siebrand (Code Review)
Siebrand has submitted this change and it was merged.

Change subject: Update extension name and key name
..


Update extension name and key name

Change-Id: I2f51e79c178f4450af9f5147eba45ec5f2a36ad0
---
M groups/check-blacklist.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/groups/check-blacklist.php b/groups/check-blacklist.php
index 74f2ca0..51d3545 100644
--- a/groups/check-blacklist.php
+++ b/groups/check-blacklist.php
@@ -203,10 +203,10 @@
)
),
array(
-   'group' = 'ext-citespecial',
+   'group' = 'ext-citethispage',
'check' = 'links',
'message' = array(
-   'cite_text', // Contains link parts that may need 
translation
+   'citethispage-content', // Contains link parts that may 
need translation
)
),
array(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2f51e79c178f4450af9f5147eba45ec5f2a36ad0
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add missing underscore - change (translatewiki)

2014-10-26 Thread Siebrand (Code Review)
Siebrand has submitted this change and it was merged.

Change subject: Add missing underscore
..


Add missing underscore

Change-Id: I1887724ad68064ddfee94524f59cfba69993970d
---
M groups/Europeana/Europeana.yaml
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/groups/Europeana/Europeana.yaml b/groups/Europeana/Europeana.yaml
index ac49b4a..004e800 100644
--- a/groups/Europeana/Europeana.yaml
+++ b/groups/Europeana/Europeana.yaml
@@ -24,6 +24,7 @@
   optional:
 - date.abbr_month_names.0
 - date.month_names.0
+- formtastic.labels.taxonomy_term.collection_day.*
 - number.currency.format.significant
 - number.currency.format.strip_insignificant_zeros
 - number.format.significant
@@ -32,7 +33,6 @@
 - number.human.format.delimiter
 - number.percentage.format.delimiter
 - number.precision.format.delimiter
-- formtastic.labels.taxonomy_term.collection day.*
   ignored:
 - dummy
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1887724ad68064ddfee94524f59cfba69993970d
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Checking for missing page does not need content object - change (mediawiki...Wikibase)

2014-10-26 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Checking for missing page does not need content object
..

Checking for missing page does not need content object

We can check via WikiPage, just as is done for non-entity
content, if trying to view a non-existing entity.

Change-Id: I3222cf1381431b6ca8969b5ea8566ad22f2fe803
---
M repo/includes/actions/ViewEntityAction.php
1 file changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/31/168831/1

diff --git a/repo/includes/actions/ViewEntityAction.php 
b/repo/includes/actions/ViewEntityAction.php
index 7160d7c..11af1a3 100644
--- a/repo/includes/actions/ViewEntityAction.php
+++ b/repo/includes/actions/ViewEntityAction.php
@@ -115,15 +115,15 @@
 * Parent is doing $this-checkCanExecute( $this-getUser() )
 */
public function show() {
-   $contentRetriever = new ContentRetriever();
-   $content = $contentRetriever-getContentForRequest(
-   $this-getRequest(),
-   $this-getArticle()
-   );
-
-   if ( is_null( $content ) ) {
+   if ( !$this-getArticle()-getPage()-exists() ) {
$this-displayMissingEntity();
} else {
+   $contentRetriever = new ContentRetriever();
+   $content = $contentRetriever-getContentForRequest(
+   $this-getRequest(),
+   $this-getArticle()
+   );
+
$this-displayEntityContent( $content );
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3222cf1381431b6ca8969b5ea8566ad22f2fe803
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add getPermissionForTitle method to use in ViewEntityAction - change (mediawiki...Wikibase)

2014-10-26 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Add getPermissionForTitle method to use in ViewEntityAction
..

Add getPermissionForTitle method to use in ViewEntityAction

Change-Id: Ia56f00ffc1338ab1320e5b38446240b3ee360519
---
M repo/includes/actions/ViewEntityAction.php
M repo/includes/content/EntityContentFactory.php
M repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
3 files changed, 58 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/32/168832/2

diff --git a/repo/includes/actions/ViewEntityAction.php 
b/repo/includes/actions/ViewEntityAction.php
index 11af1a3..a4900f6 100644
--- a/repo/includes/actions/ViewEntityAction.php
+++ b/repo/includes/actions/ViewEntityAction.php
@@ -163,11 +163,12 @@
 
if ( $editable  !$content-isRedirect() ) {
$permissionChecker = $this-getPermissionChecker();
-   $permissionStatus = 
$permissionChecker-getPermissionStatusForEntity(
+   $permissionStatus = 
$permissionChecker-getPermissionForTitle(
+   $this-getArticle()-getTitle(),
+   $content,
$this-getUser(),
-   'edit',
-   $content-getEntity(),
-   'quick' );
+   'edit'
+   );
 
$editable = $permissionStatus-isOK();
}
diff --git a/repo/includes/content/EntityContentFactory.php 
b/repo/includes/content/EntityContentFactory.php
index 218c43a..ff03275 100644
--- a/repo/includes/content/EntityContentFactory.php
+++ b/repo/includes/content/EntityContentFactory.php
@@ -11,6 +11,7 @@
 use User;
 use Wikibase\DataModel\Entity\Entity;
 use Wikibase\DataModel\Entity\EntityId;
+use Wikibase\EntityContent;
 use Wikibase\Lib\Store\EntityRedirect;
 use Wikibase\Lib\Store\EntityTitleLookup;
 use Wikibase\Repo\Store\EntityPermissionChecker;
@@ -189,8 +190,20 @@
}
 
/**
-* @see EntityPermissionChecker::getPermissionStatusForEntityId
+* @param User $user
+* @param string $permission
+* @param Title $entityPage
+* @param string $quick
 *
+* @return string[]
+*/
+   protected function getPermissionErrors( User $user, $permission, Title 
$entityPage, $quick = '' ) {
+   //XXX: would be nice to be able to pass the $short flag too,
+   // as used by getUserPermissionsErrorsInternal. But Title 
doesn't expose that.
+   return $entityPage-getUserPermissionsErrors( $permission, 
$user, $quick !== 'quick' );
+   }
+
+   /**
 * @param User $user
 * @param string $permission
 * @param Title $entityPage
@@ -202,10 +215,19 @@
 */
protected function getPermissionStatus( User $user, $permission, Title 
$entityPage, $quick = '' ) {
wfProfileIn( __METHOD__ );
+   $errors = $this-getPermissionErrors( $user, $permission, 
$entityPage, $quick );
+   $status = $this-getStatusForPermissionErrors( $errors );
 
-   //XXX: would be nice to be able to pass the $short flag too,
-   // as used by getUserPermissionsErrorsInternal. But Title 
doesn't expose that.
-   $errors = $entityPage-getUserPermissionsErrors( $permission, 
$user, $quick !== 'quick' );
+   wfProfileOut( __METHOD__ );
+   return $status;
+   }
+
+   /**
+* @param string[] $errors
+*
+* @return Status
+*/
+   protected function getStatusForPermissionErrors( array $errors ) {
$status = Status::newGood();
 
foreach ( $errors as $error ) {
@@ -301,4 +323,22 @@
return $status;
}
 
+   /**
+* @param Title $title
+* @param User $user
+* @param string $permission
+*
+* @return Status
+*/
+   public function getPermissionForTitle( Title $title, EntityContent 
$content, User $user, $permission ) {
+   $entityContentTitle = $this-getTitleForId( 
$content-getEntity()-getId() );
+
+   if ( $entityContentTitle-getFullText() !== 
$title-getFullText() ) {
+   throw new MWException( '$title does not match content' 
);
+   }
+
+   $errors = $title-getUserPermissionsErrors( $permission, $user, 
'quick' );
+   return $this-getStatusForPermissionErrors( $errors );
+   }
+
 }
diff --git a/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php 
b/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
index 460cb3f..f922d92 100644
--- 

[MediaWiki-commits] [Gerrit] Use Title::quickUserCan in ViewEntityAction - change (mediawiki...Wikibase)

2014-10-26 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Use Title::quickUserCan in ViewEntityAction
..

Use Title::quickUserCan in ViewEntityAction

this does exactly the same thing as what is done
in EntityPermissionChecker, but with the benefit that
no Entity is required! :)

We always and already have the Title in the action,
so let's use that and quickUserCan which is the
way this is done for non-Entity pages.

Change-Id: I8c3adbd70aedf3392d07883a83cc361b28f25ae3
---
M repo/includes/actions/ViewEntityAction.php
M repo/includes/content/EntityContentFactory.php
M repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
3 files changed, 0 insertions(+), 73 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/33/168833/4

diff --git a/repo/includes/actions/ViewEntityAction.php 
b/repo/includes/actions/ViewEntityAction.php
index a4900f6..febfd04 100644
--- a/repo/includes/actions/ViewEntityAction.php
+++ b/repo/includes/actions/ViewEntityAction.php
@@ -9,7 +9,6 @@
 use SpecialPage;
 use ViewAction;
 use Wikibase\Repo\Content\EntityHandler;
-use Wikibase\Repo\Store\EntityPermissionChecker;
 use Wikibase\Repo\WikibaseRepo;
 
 /**
@@ -27,11 +26,6 @@
 * @var LanguageFallbackChain
 */
protected $languageFallbackChain;
-
-   /**
-* @var EntityPermissionChecker
-*/
-   protected $permissionChecker;
 
/**
 * Get the language fallback chain.
@@ -59,29 +53,6 @@
 */
public function setLanguageFallbackChain( LanguageFallbackChain $chain 
) {
$this-languageFallbackChain = $chain;
-   }
-
-   /**
-* Get permission checker.
-* Uses the default WikibaseRepo instance to get the service if it was 
not previously set.
-*
-* @return EntityPermissionChecker
-*/
-   public function getPermissionChecker() {
-   if ( $this-permissionChecker === null ) {
-   $this-permissionChecker = 
WikibaseRepo::getDefaultInstance()-getEntityPermissionChecker();
-   }
-
-   return $this-permissionChecker;
-   }
-
-   /**
-* Set permission checker.
-*
-* @param EntityPermissionChecker $permissionChecker
-*/
-   public function setPermissionChecker( EntityPermissionChecker 
$permissionChecker ) {
-   $this-permissionChecker = $permissionChecker;
}
 
/**
@@ -161,24 +132,7 @@
// NOTE: page-wide property, independent of user permissions
$outputPage-addJsConfigVars( 'wbIsEditView', $editable );
 
-   if ( $editable  !$content-isRedirect() ) {
-   $permissionChecker = $this-getPermissionChecker();
-   $permissionStatus = 
$permissionChecker-getPermissionForTitle(
-   $this-getArticle()-getTitle(),
-   $content,
-   $this-getUser(),
-   'edit'
-   );
-
-   $editable = $permissionStatus-isOK();
-   }
-
$parserOptions = 
$this-getArticle()-getPage()-makeParserOptions( 
$this-getContext()-getUser() );
-
-   if ( !$editable ) {
-   // disable editing features (sections is a misnomer, 
it applies to the wikitext equivalent)
-   $parserOptions-setEditSection( $editable );
-   }
 
$this-getArticle()-setParserOptions( $parserOptions );
$this-getArticle()-view();
diff --git a/repo/includes/content/EntityContentFactory.php 
b/repo/includes/content/EntityContentFactory.php
index ff03275..a27ec76 100644
--- a/repo/includes/content/EntityContentFactory.php
+++ b/repo/includes/content/EntityContentFactory.php
@@ -323,22 +323,4 @@
return $status;
}
 
-   /**
-* @param Title $title
-* @param User $user
-* @param string $permission
-*
-* @return Status
-*/
-   public function getPermissionForTitle( Title $title, EntityContent 
$content, User $user, $permission ) {
-   $entityContentTitle = $this-getTitleForId( 
$content-getEntity()-getId() );
-
-   if ( $entityContentTitle-getFullText() !== 
$title-getFullText() ) {
-   throw new MWException( '$title does not match content' 
);
-   }
-
-   $errors = $title-getUserPermissionsErrors( $permission, $user, 
'quick' );
-   return $this-getStatusForPermissionErrors( $errors );
-   }
-
 }
diff --git a/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php 
b/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
index f922d92..460cb3f 100644
--- 

[MediaWiki-commits] [Gerrit] Get labels via ParserOutput in ViewEntityAction - change (mediawiki...Wikibase)

2014-10-26 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Get labels via ParserOutput in ViewEntityAction
..

Get labels via ParserOutput in ViewEntityAction

With this change, we no longer need EntityContent
in ViewEntityAction.

Content is only accessed if the page is being
purged or otherwise ParserOutput is not available
via ParserCache.

@todo - provide a nicer way to stash EntityId in
ParserOutput.

Change-Id: Ie5f26a7e9bbe2592429bfd9b4324e832a5a9b372
---
M repo/Wikibase.hooks.php
M repo/includes/EntityParserOutputGenerator.php
M repo/includes/actions/EditEntityAction.php
M repo/includes/actions/ViewEntityAction.php
M repo/tests/phpunit/includes/EntityParserOutputGeneratorTest.php
5 files changed, 63 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/40/168840/4

diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index e02daaa..fb44ffd 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -1081,6 +1081,12 @@
$out-setProperty( 'wikibase-view-chunks', 
$placeholders );
}
 
+   $labels = $parserOutput-getExtensionData( 
'wikibase-entity-labels' );
+
+   if ( $labels ) {
+   $out-setProperty( 'wikibase-entity-labels', $labels );
+   }
+
return true;
}
 
diff --git a/repo/includes/EntityParserOutputGenerator.php 
b/repo/includes/EntityParserOutputGenerator.php
index 2cecb92..379b689 100644
--- a/repo/includes/EntityParserOutputGenerator.php
+++ b/repo/includes/EntityParserOutputGenerator.php
@@ -3,6 +3,7 @@
 namespace Wikibase;
 
 use ParserOutput;
+use Wikibase\DataModel\Entity\Entity;
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\PropertyDataTypeLookup;
 use Wikibase\DataModel\SiteLinkList;
@@ -82,6 +83,7 @@
$pout-addJsConfigVars( $configVars );
 
$this-addSnaksToParserOutput( $pout, $entity-getAllSnaks() );
+   $this-addLabelsToParserOutput( $pout, $entity );
 
if ( $entity instanceof Item ) {
$this-addBadgesToParserOutput( $pout, 
$entity-getSiteLinkList() );
@@ -137,6 +139,11 @@
}
}
 
+   private function addLabelsToParserOutput( ParserOutput $pout, Entity 
$entity ) {
+   $labels = $entity-getFingerprint()-getLabels()-toTextArray();
+   $pout-setExtensionData( 'wikibase-entity-labels', $labels );
+   }
+
private function addBadgesToParserOutput( ParserOutput $pout, 
SiteLinkList $siteLinkList ) {
foreach ( $siteLinkList as $siteLink ) {
foreach ( $siteLink-getBadges() as $badge ) {
diff --git a/repo/includes/actions/EditEntityAction.php 
b/repo/includes/actions/EditEntityAction.php
index db69ee3..980f9fa 100644
--- a/repo/includes/actions/EditEntityAction.php
+++ b/repo/includes/actions/EditEntityAction.php
@@ -291,7 +291,7 @@
$this-getOutput()-setPageTitle(
$this-msg(
$restore ? 'wikibase-restore-title' : 
'wikibase-undo-title',
-   $this-getLabelText( $latestContent ),
+   $this-getLabelTextForContent( $latestContent ),
$olderRevision-getId(),
$newerRevision-getId()
)
@@ -348,7 +348,7 @@
 *
 * @return String
 */
-   public function getLabelText( EntityContent $content ) {
+   private function getLabelTextForContent( EntityContent $content ) {
$labelData = null;
 
// TODO: use a message like autoredircomment to represent the 
redirect.
diff --git a/repo/includes/actions/ViewEntityAction.php 
b/repo/includes/actions/ViewEntityAction.php
index febfd04..8fa777e 100644
--- a/repo/includes/actions/ViewEntityAction.php
+++ b/repo/includes/actions/ViewEntityAction.php
@@ -89,13 +89,7 @@
if ( !$this-getArticle()-getPage()-exists() ) {
$this-displayMissingEntity();
} else {
-   $contentRetriever = new ContentRetriever();
-   $content = $contentRetriever-getContentForRequest(
-   $this-getRequest(),
-   $this-getArticle()
-   );
-
-   $this-displayEntityContent( $content );
+   $this-displayEntityPage();
}
}
 
@@ -119,38 +113,50 @@
}
 
/**
-* Displays the entity content.
+* Displays the entity page.
 *
 * @since 0.1
-*
-* @param EntityContent $content
 */
-   protected function 

[MediaWiki-commits] [Gerrit] Sanitize herald effects so that for tasks submitted to a sec... - change (phabricator/extensions)

2014-10-26 Thread 20after4 (Code Review)
20after4 has uploaded a new change for review.

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

Change subject: Sanitize herald effects so that for tasks submitted to a secure 
project, the following must be enforced:
..

Sanitize herald effects so that for tasks submitted to a secure project, the 
following
must be enforced:

 * CC'd users must be a member of secure project
 * assignee must be a member of the secure project

Change-Id: Iceb26d4fac99eca1d52cacf2431a069ffe52fb84
---
M SecurityPolicyEnforcerAction.php
1 file changed, 79 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/phabricator/extensions 
refs/changes/07/168907/1

diff --git a/SecurityPolicyEnforcerAction.php b/SecurityPolicyEnforcerAction.php
index fde9f61..d599757 100644
--- a/SecurityPolicyEnforcerAction.php
+++ b/SecurityPolicyEnforcerAction.php
@@ -36,6 +36,7 @@
 
 /** @var ManiphestTask */
 $task = $object;
+$project = null;
 
 $viewer = PhabricatorUser::getOmnipotentUser();
 
@@ -150,7 +151,8 @@
 $enforce = true;
 
 //operations group
-$project_phids = array($this-getProjectPHID('operations'));
+$project = $this-getProjectByName('operations');
+$project_phids = array($project-getPHID());
 $policy = $this-createCustomPolicy(
   $task-getAuthorPHID(),
   $project_phids);
@@ -159,7 +161,8 @@
 
 break;
   case 'security-bug':
-$project_phids = array($this-getProjectPHID('security'));
+$project = $this-getProjectByName('security');
+$project_phids = array($project-getPHID());
 
 $policy = $this-createCustomPolicy(
   $task-getAuthorPHID(),
@@ -174,7 +177,9 @@
 $transactions = array();
 
 if ($enforce) {
-
+  if ($project !== null) {
+$this-sanityCheck($adapter, $project);
+  }
   if ($view_policy !== null) {
 $transactions[] = id(new ManiphestTransaction())
   -setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
@@ -220,9 +225,16 @@
* look up a project by name
*/
   protected function getProjectPHID($projectName) {
-static $phids = array();
-if (isset($phids[$projectName])){
-  return $phids[$projectName];
+return $this-getProjectByName($projectName)-getPHID();
+  }
+
+/**
+   * look up a project by name
+   */
+  protected function getProjectByName($projectName) {
+static $projects = array();
+if (isset($projects[$projectName])){
+  return $projects[$projectName];
 }
 
 $query = new PhabricatorProjectQuery();
@@ -234,33 +246,71 @@
   return null;
 }
 
-$phids[$projectName] = $project-getPHID();
-return $phids[$projectName];
+return $projects[$projectName] = $project;
   }
 
   protected function createCustomPolicy($user_phids, $project_phids) {
-  if (!is_array($user_phids)){
-$user_phids = array($user_phids);
-  }
-  if (!is_array($project_phids)) {
-$project_phids = array($project_phids);
-  }
+if (!is_array($user_phids)){
+  $user_phids = array($user_phids);
+}
+if (!is_array($project_phids)) {
+  $project_phids = array($project_phids);
+}
 
-  $policy = id(new PhabricatorPolicy())
--setRules(
+$policy = id(new PhabricatorPolicy())
+  -setRules(
+array(
   array(
-array(
-  'action' = PhabricatorPolicy::ACTION_ALLOW,
-  'rule' = 'PhabricatorPolicyRuleUsers',
-  'value' = $user_phids,
-),
-array(
-  'action' = PhabricatorPolicy::ACTION_ALLOW,
-  'rule' = 'PhabricatorPolicyRuleProjects',
-  'value' = $project_phids,
-),
-  ))
--save();
-  return $policy;
+'action' = PhabricatorPolicy::ACTION_ALLOW,
+'rule' = 'PhabricatorPolicyRuleUsers',
+'value' = $user_phids,
+  ),
+  array(
+'action' = PhabricatorPolicy::ACTION_ALLOW,
+'rule' = 'PhabricatorPolicyRuleProjects',
+'value' = $project_phids,
+  ),
+))
+  -save();
+return $policy;
   }
+
+/**
+ * Sanitize herald effects so that for tasks submitted to a secure project,
+ * the following will be enforced:
+ * * CC'd users must be a member of secure project
+ * * assignee must be a member of the secure project
+*/
+  protected function sanityCheck(
+  HeraldManiphestTaskAdapter $adapter,
+  PhabricatorProject $project) {
+
+$ccs = $adapter-getCcPHIDs();
+$members = $project-getMemberPHIDs();
+$member_phids = array();
+$sanitized_ccs = array();
+
+foreach($members as $key=$phid) {
+  $member_phids[$phid]=true;
+}
+
+//CC'd users must be members of secure project
+foreach($ccs as $cc) {
+  if (isset($member_phids[$cc])) {
+$sanitized_ccs[] = $cc;
+  }
+}

[MediaWiki-commits] [Gerrit] Turning on $wgCopyUploadsFromSpecialUpload for Commons - change (operations/mediawiki-config)

2014-10-26 Thread Kaldari (Code Review)
Kaldari has uploaded a new change for review.

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

Change subject: Turning on $wgCopyUploadsFromSpecialUpload for Commons
..

Turning on $wgCopyUploadsFromSpecialUpload for Commons

Bug: 71897
Change-Id: I9083d98bcfed2d9c3606f24cd0ff073be96e6491
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 11c8248..c0a8a3f 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -10755,6 +10755,7 @@
 'wgCopyUploadsFromSpecialUpload' = array(
'default' = false,
'testwiki' = true, // bug 71897
+   'commonswiki' = true, // bug 71897
 ),
 // For Flickr uploads via UploadWizard - 2012-11-20
 'wgCopyUploadsDomains' = array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9083d98bcfed2d9c3606f24cd0ff073be96e6491
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Kaldari rkald...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] page.py: fix docstring of getFileVersionHistory() - change (pywikibot/core)

2014-10-26 Thread Mpaa (Code Review)
Mpaa has uploaded a new change for review.

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

Change subject: page.py: fix docstring of getFileVersionHistory()
..

page.py: fix docstring of getFileVersionHistory()

getFileVersionHistory() returns a list of dicts, not tuples.

Change-Id: I783ed237d691aedb44464a6e292d60ea778183b7
---
M pywikibot/page.py
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/09/168909/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 5a4994c..2fcbb8d 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1915,8 +1915,10 @@
 def getFileVersionHistory(self):
 Return the file's version history.
 
-@return: An iterator yielding tuples containing (timestamp,
-username, resolution, filesize, comment).
+@return: A list of dictionaries with the following keys:
+[u'comment', u'sha1', u'url', u'timestamp', u'metadata',
+ u'height', u'width', u'mime', u'user', u'descriptionurl',
+ u'size']
 
 
 return self.site.loadimageinfo(self, history=True)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I783ed237d691aedb44464a6e292d60ea778183b7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa mpaa.w...@gmail.com

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


[MediaWiki-commits] [Gerrit] [WIP] Generate and run a JS/PHP comparison test suite - change (oojs/ui)

2014-10-26 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: [WIP] Generate and run a JS/PHP comparison test suite
..

[WIP] Generate and run a JS/PHP comparison test suite

Change-Id: I52bd98ee54ffe2b2bd00ddf604b9b22532ebd892
---
A bin/testsuitegenerator.rb
M php/elements/OoUiIconElement.php
A tests/JSPHP-suite.json
A tests/JSPHP.test.js
D tests/index.html
A tests/index.php
6 files changed, 837 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/10/168910/1

diff --git a/bin/testsuitegenerator.rb b/bin/testsuitegenerator.rb
new file mode 100644
index 000..2a0868f
--- /dev/null
+++ b/bin/testsuitegenerator.rb
@@ -0,0 +1,95 @@
+require 'pp'
+require_relative 'docparser'
+
+LOREM_IPSUM = EOF
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
+tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
+quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+EOF
+
+if ARGV.empty? || ARGV == ['-h'] || ARGV == ['--help']
+   $stderr.puts usage: ruby #{$0} dirA dirB
+   $stderr.putsruby #{$0} src php  tests/JSPHP-suite.json
+else
+   dir_a, dir_b = ARGV
+   js = parse_any_path dir_a
+   php = parse_any_path dir_b
+
+   class_names = (js + php).map{|c| c[:name] }.sort.uniq
+
+   tests = []
+   classes = php.select{|c| class_names.include? c[:name] }
+
+   # can't test mixins separately
+   classes = classes.reject{|c| !c[:parent] || c[:parent] == 
'ElementMixin' }
+   # no toplevel
+   classes = classes.reject{|c| %w[Element Widget Layout Theme 
MediaWikiTheme].include? c[:name] }
+   # only without params :(
+   classes = classes.select{|c| c[:methods][0][:params].empty? }
+
+   # values to test for each type
+   expandos = {
+   'null' = [nil],
+   'number' = [0, -1, 300],
+   'boolean' = [true, false],
+   'string' = [LOREM_IPSUM, 'Foo bar'],
+   }
+   
+   # values to test for names
+   sensible_values = {
+   'href' = ['http://example.com/'],
+   ['TextInputWidget', 'type'] = %w[text password],
+   ['ButtonInputWidget', 'type'] = %w[button input],
+   'type' = %w[text button],
+   'method' = %w[GET POST],
+   'action' = %w[.],
+   'enctype' = [],
+   'target' = ['', '_blank'],
+   'name' = [],
+   }
+
+   expand_types_to_values = lambda do |types|
+   return types.map{|t|
+   as_array = true if t.sub! '[]', ''
+   vals = expandos[ t ] || [] # the empty value will 
result in no tests being generated
+   as_array ? vals.map{|v| [v] } : vals
+   }.inject(:+)
+   end
+
+   classes.each do |klass|
+   constructor = klass[:methods][0]
+   # params = constructor[:params]
+   config = constructor[:config]
+
+   # generate every possible configuration of configuration option 
sets
+   config_combinations = (0..config.length).map{|l| 
config.combination(l).to_a }.inject(:+)
+   # for each set, generate all possible values to use based on 
option's type
+   config_combinations = config_combinations.map{|config_comb|
+   expanded = config_comb.map{|config_option|
+   types = config_option[:type].split '|'
+   values =
+   sensible_values[ [ klass[:name], 
config_option[:name] ] ] ||
+   sensible_values[ config_option[:name] ] 
||
+   expand_types_to_values.call(types)
+   values.map{|v| config_option.dup.merge(value: 
v) }
+   }
+   expanded.length  0 ? 
expanded[0].product(*expanded[1..-1]) : []
+   }.inject(:+)
+
+   # param_types = params.map{|p| { placeholder_for: p[:type] } }
+
+   config_combinations.each do |config_comb|
+   tests  {
+   class: klass[:name],
+   # params: param_types,
+   config: Hash[ config_comb.map{|c| [ c[:name], 
c[:value] ] } ]
+   }
+   end
+   end
+
+   puts JSON.pretty_generate tests
+end
+
diff --git a/php/elements/OoUiIconElement.php b/php/elements/OoUiIconElement.php
index 5a22901..061175b 

[MediaWiki-commits] [Gerrit] Fix page_tests testBasePageConstructor - change (pywikibot/core)

2014-10-26 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

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

Change subject: Fix page_tests testBasePageConstructor
..

Fix page_tests testBasePageConstructor

Empty string titles for BasePage raise InvalidTitle during Link.parse

Change-Id: I6d4fb9ff02d472f2e71933084de71a7bc355c154
---
M tests/page_tests.py
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/11/168911/1

diff --git a/tests/page_tests.py b/tests/page_tests.py
index ab229ea..54355cf 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -10,6 +10,7 @@
 import sys
 import pywikibot
 from pywikibot import config
+from pywikibot import InvalidTitle
 import pywikibot.page
 
 from tests.aspects import unittest, TestCase, DefaultSiteTestCase
@@ -279,9 +280,9 @@
 # the site parameter, with the title parameter defaulted to
 # empty string
 page = pywikibot.page.BasePage(site)
-self.assertEqual(page.title(), u'')
+self.assertRaises(InvalidTitle, page.title)
 page = pywikibot.page.BasePage(site, title=u'')
-self.assertEqual(page.title(), u'')
+self.assertRaises(InvalidTitle, page.title)
 self.assertRaises(ValueError, pywikibot.page.BasePage, site, 
title=None)
 
 def testPageConstructor(self):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d4fb9ff02d472f2e71933084de71a7bc355c154
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg jay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Fix page_tests testBasePageConstructor - change (pywikibot/core)

2014-10-26 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged.

Change subject: Fix page_tests testBasePageConstructor
..


Fix page_tests testBasePageConstructor

Empty string titles for BasePage raise InvalidTitle during Link.parse

Change-Id: I6d4fb9ff02d472f2e71933084de71a7bc355c154
---
M tests/page_tests.py
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/tests/page_tests.py b/tests/page_tests.py
index ab229ea..54355cf 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -10,6 +10,7 @@
 import sys
 import pywikibot
 from pywikibot import config
+from pywikibot import InvalidTitle
 import pywikibot.page
 
 from tests.aspects import unittest, TestCase, DefaultSiteTestCase
@@ -279,9 +280,9 @@
 # the site parameter, with the title parameter defaulted to
 # empty string
 page = pywikibot.page.BasePage(site)
-self.assertEqual(page.title(), u'')
+self.assertRaises(InvalidTitle, page.title)
 page = pywikibot.page.BasePage(site, title=u'')
-self.assertEqual(page.title(), u'')
+self.assertRaises(InvalidTitle, page.title)
 self.assertRaises(ValueError, pywikibot.page.BasePage, site, 
title=None)
 
 def testPageConstructor(self):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6d4fb9ff02d472f2e71933084de71a7bc355c154
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg jay...@gmail.com
Gerrit-Reviewer: John Vandenberg jay...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Nullzero nullzero.f...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Use Config instead of globals - change (mediawiki...Truglass)

2014-10-26 Thread Lewis Cawte (Code Review)
Lewis Cawte has uploaded a new change for review.

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

Change subject: Use Config instead of globals
..

Use Config instead of globals

Change-Id: If6eac180316ef626e319fbd39988259dfcaffe16
---
M Truglass.skin.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Truglass 
refs/changes/12/168912/1

diff --git a/Truglass.skin.php b/Truglass.skin.php
index 460b650..31f9984 100644
--- a/Truglass.skin.php
+++ b/Truglass.skin.php
@@ -263,7 +263,7 @@
form name=searchform 
action=?php $this-text( 'wgScript' ) ? id=searchform
input 
type=hidden name=title value=?php $this-text( 'searchtitle' ) ?/
input 
type=hidden name=fulltext class=searchButton value=?php $this-msg( 
'search' ) ? /
-   img src=?php 
$this-text( 'stylepath' ) ?/Truglass/?php $this-text( 'stylename' ) 
?/searchleftcap?php if( $wgLang-isRTL() ) echo '_rtl'; ?.gif alt= 
width=17 height=19 border=0 id=s1 class=srchimgs /
+   img src=?php 
$this-text( 'stylepath' ) ?/Truglass/?php $this-text( 'stylename' ) 
?/searchleftcap?php if( RequestContext::getMain()-getLanguage()-is) echo 
'_rtl'; ?.gif alt= width=17 height=19 border=0 id=s1 
class=srchimgs /
input 
type=text name=search class=sbox id=q01 ?php if( $this-haveMsg( 
'accesskey-search' ) ) { ?accesskey=?php $this-msg( 'accesskey-search' ) 
??php } if( isset( $this-data['search'] ) ) { ? value=?php $this-text( 
'search' ) ??php } ? /
img src=?php 
$this-text( 'stylepath' ) ?/Truglass/?php $this-text( 'stylename' ) 
?/searchrightcap?php if( $wgLang-isRTL() ) echo '_rtl'; ?.gif alt= 
width=9 height=19 border=0 id=s2 class=srchimgs /
/form
@@ -340,9 +340,9 @@
 * an array.
 */
function networkNavigationBox() {
-   global $wgTruglassSidebarLinks;
+   $sidebarLinks = $this-config-get( 'TruglassSidebarLinks' );
 
-   if( is_array( $wgTruglassSidebarLinks )  !empty( 
$wgTruglassSidebarLinks ) ) {
+   if( is_array( $sidebarLinks )  !empty( $sidebarLinks ) ) {
 ?
div class=sbmodule 
id=sbm-networknav
h4 class=sbmoduletitle 
displayer?php echo wfMessage( 'truglass-links' )-parse() ?/h4
@@ -350,7 +350,7 @@
div class=stretcher
ul
?php
-   foreach 
( $wgTruglassSidebarLinks as $link = $title ) {
+   foreach 
( $sidebarLinks as $link = $title ) {

echo 'lia href=http://' . $link . '/' . $title . '/a/li';
}
?

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6eac180316ef626e319fbd39988259dfcaffe16
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Truglass
Gerrit-Branch: master
Gerrit-Owner: Lewis Cawte le...@lewiscawte.me

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


[MediaWiki-commits] [Gerrit] Bug 72527 - CircularRedirect exception throws another exception - change (pywikibot/core)

2014-10-26 Thread John Vandenberg (Code Review)
John Vandenberg has submitted this change and it was merged.

Change subject: Bug 72527 - CircularRedirect exception throws another exception
..


Bug 72527 - CircularRedirect exception throws another exception

CircularRedirect needs a page as input param.

Change-Id: I65cc58a1568b922336fcf5c85651cdc4172444d2
---
M pywikibot/site.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  John Vandenberg: Verified
  XZise: Looks good to me, approved
  Mpaa: Looks good to me, approved



diff --git a/pywikibot/site.py b/pywikibot/site.py
index 17611ee..86de719 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -2344,7 +2344,7 @@
 target_title = u'%(title)s%(section)s' % redirmap[title]
 if target_title == title or pages not in result['query']:
 # no pages element indicates a circular redirect
-raise pywikibot.CircularRedirect(target_title)
+raise pywikibot.CircularRedirect(page)
 pagedata = list(result['query']['pages'].values())[0]
 # there should be only one value in 'pages', and it is the target
 if self.sametitle(pagedata['title'], target_title):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I65cc58a1568b922336fcf5c85651cdc4172444d2
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa mpaa.w...@gmail.com
Gerrit-Reviewer: John Vandenberg jay...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Mpaa mpaa.w...@gmail.com
Gerrit-Reviewer: XZise commodorefabia...@gmx.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Use Config for a few globals. - change (mediawiki...Bouquet)

2014-10-26 Thread Lewis Cawte (Code Review)
Lewis Cawte has uploaded a new change for review.

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

Change subject: Use Config for a few globals.
..

Use Config for a few globals.

Change-Id: I17903c77d680a3d908a850557c4879a5e366
---
M Bouquet.skin.php
1 file changed, 7 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Bouquet 
refs/changes/13/168913/1

diff --git a/Bouquet.skin.php b/Bouquet.skin.php
index 014da98..2b47142 100644
--- a/Bouquet.skin.php
+++ b/Bouquet.skin.php
@@ -55,8 +55,9 @@
 * @return String: logo image URL
 */
private function getLogo() {
-   global $wgStylePath, $wgDefaultTheme;
+   global $wgStylePath;
 
+   $defaultTheme = $this-config-get( 'DefaultTheme' );
$logoURL = '';
$customLogo = wfFindFile( 'Bouquet-skin-logo.png' );
 
@@ -72,8 +73,8 @@
$themeFromRequest = 
$this-getSkin()-getRequest()-getVal( 'usetheme', false );
if ( $themeFromRequest ) {
$themeName = $themeFromRequest;
-   } elseif ( isset( $wgDefaultTheme )  $wgDefaultTheme 
!= 'default' ) {
-   $themeName = $wgDefaultTheme;
+   } elseif ( isset( $defaultTheme )  $defaultTheme != 
'default' ) {
+   $themeName = $defaultTheme;
} else {
$themeName = false;
}
@@ -101,7 +102,6 @@
 * outputs a formatted page.
 */
public function execute() {
-   global $wgSitename;
 
$this-data['pageLanguage'] = 
$this-getSkin()-getTitle()-getPageViewLanguage()-getHtmlCode();
 
@@ -112,13 +112,13 @@
?php echo Html::element( 'a', array(
'href' = 
$this-data['nav_urls']['mainpage']['href'],
'class' = 'header-link',
-   'title' = $wgSitename,
+   'title' = $this-config-get( 'Sitename' ),
'rel' = 'home'
) + Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) ); ?
div
h1 class=firstHeading id=site-titlespan 
dir=auto?php echo Html::element( 'a', array(
'href' = 
$this-data['nav_urls']['mainpage']['href'] )
-   + 
Linker::tooltipAndAccesskeyAttribs( 'p-logo' ), $wgSitename ); ?/span/h1
+   + 
Linker::tooltipAndAccesskeyAttribs( 'p-logo' ), $this-config-get( 'Sitename' 
) ); ?/span/h1
h2 id=site-description?php $this-msg( 'tagline' ) 
?/h2
/div
/header!-- #branding --
@@ -313,7 +313,6 @@
}
 
function searchBox() {
-   global $wgUseTwoButtonsSearchForm;
 ?
aside id=search-3 
class=widget widget_search
form role=search 
method=get id=searchform class=searchform action=?php $this-text( 
'wgScript' ) ?
@@ -323,7 +322,7 @@
?php

echo $this-makeSearchInput( array( 'id' = 'searchInput' ) );

echo $this-makeSearchButton( 'go', array( 'id' = 'searchGoButton', 'class' = 
'searchButton' ) );
-   
if ( $wgUseTwoButtonsSearchForm ) {
+   
if ( $this-config-get( 'UseTwoButtonsSearchForm' ) ) {

echo '#160;';

echo $this-makeSearchButton( 'fulltext', array( 'id' = 
'mw-searchButton', 'class' = 'searchButton' ) );

} else { ?

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I17903c77d680a3d908a850557c4879a5e366
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Bouquet
Gerrit-Branch: master
Gerrit-Owner: Lewis Cawte le...@lewiscawte.me

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


[MediaWiki-commits] [Gerrit] Version 0.3.0 -- more RequestContext, less legacy i18n - change (mediawiki...Quantcast)

2014-10-26 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review.

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

Change subject: Version 0.3.0 -- more RequestContext, less legacy i18n
..

Version 0.3.0 -- more RequestContext, less legacy i18n

Change-Id: Iae22af7f3ebce8fd015ff231f50ed78524615521
---
D Quantcast.i18n.php
M Quantcast.php
2 files changed, 16 insertions(+), 51 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Quantcast 
refs/changes/14/168914/1

diff --git a/Quantcast.i18n.php b/Quantcast.i18n.php
deleted file mode 100644
index baf8b2b..000
--- a/Quantcast.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-?php
-/**
- * This is a backwards-compatibility shim, generated by:
- * 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = array();
-if ( !function_exists( 'wfJsonI18nShimb23cb4cbb110b6e7' ) ) {
-   function wfJsonI18nShimb23cb4cbb110b6e7( $cache, $code, $cachedData ) {
-   $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
-   foreach ( $codeSequence as $csCode ) {
-   $fileName = dirname( __FILE__ ) . /i18n/$csCode.json;
-   if ( is_readable( $fileName ) ) {
-   $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
-   foreach ( array_keys( $data ) as $key ) {
-   if ( $key === '' || $key[0] === '@' ) {
-   unset( $data[$key] );
-   }
-   }
-   $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
-   }
-
-   $cachedData['deps'][] = new FileDependency( $fileName );
-   }
-   return true;
-   }
-
-   $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShimb23cb4cbb110b6e7';
-}
diff --git a/Quantcast.php b/Quantcast.php
index 6993293..a4b7138 100644
--- a/Quantcast.php
+++ b/Quantcast.php
@@ -5,27 +5,27 @@
  * @file
  * @ingroup Extensions
  * @author Jack Phoenix j...@shoutwiki.com (forgive me)
- * @license http://en.wikipedia.org/wiki/Public_domain Public domain
- * @link http://www.mediawiki.org/wiki/Extension:Quantcast Documentation
- * @see http://bugzilla.shoutwiki.com/show_bug.cgi?id=108
+ * @license https://en.wikipedia.org/wiki/Public_domain Public domain
+ * @link https://www.mediawiki.org/wiki/Extension:Quantcast Documentation
+ * @see https://bugzilla.shoutwiki.com/show_bug.cgi?id=108
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This is not a valid entry point to MediaWiki.' );
 }
 
-$wgMessagesDirs['QuantCast'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['Quantcast'] =  __DIR__ . '/Quantcast.i18n.php';
-
 // Extension credits that will show up on Special:Version
 $wgExtensionCredits['other'][] = array(
'path' = __FILE__,
'name' = 'Quantcast Tracking',
-   'version' = '0.2.0',
+   'version' = '0.3.0',
'author' = 'Jack Phoenix',
'descriptionmsg' = 'quantcast-desc',
'url' = 'https://www.mediawiki.org/wiki/Extension:Quantcast',
 );
+
+// i18n
+$wgMessagesDirs['Quantcast'] = __DIR__ . '/i18n';
 
 // Groups that are excluded from Quantcast statistics
 $wgQuantcastTrackingExcludedGroups = array( 'staff' );
@@ -37,21 +37,21 @@
  * Add tracking JS to all pages for all users that are not members of excluded
  * groups (the group listed in $wgQuantcastTrackingExcludedGroups).
  *
- * @param $skin Object: Skin object
- * @param $text String: bottomScripts text
- * @return Boolean: true
+ * @param Skin $skin
+ * @param string $text bottomScripts text
+ * @return bool
  */
 function wfAddQuantcastTrackingCode( $skin, $text ) {
-   global $wgUser, $wgQuantcastTrackingExcludedGroups;
+   global $wgQuantcastTrackingExcludedGroups;
 
-   $groups = $wgUser-getEffectiveGroups();
+   $groups = $skin-getUser()-getEffectiveGroups();
if ( !in_array( $wgQuantcastTrackingExcludedGroups, $groups ) ) {
-   $message = trim( wfMsgForContent( 'quantcast-tracking-number' ) 
);
+   $message = $skin-msg( 'quantcast-tracking-number' 
)-inContentLanguage();
// We have a custom tracking code, use it!
-   if( !wfEmptyMsg( 'quantcast-tracking-number', $message ) ) {
-   $trackingCode = $message;
+   if ( 

[MediaWiki-commits] [Gerrit] Version 0.3.0 -- more RequestContext, less legacy i18n - change (mediawiki...Quantcast)

2014-10-26 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: Version 0.3.0 -- more RequestContext, less legacy i18n
..


Version 0.3.0 -- more RequestContext, less legacy i18n

Change-Id: Iae22af7f3ebce8fd015ff231f50ed78524615521
---
D Quantcast.i18n.php
M Quantcast.php
2 files changed, 16 insertions(+), 51 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/Quantcast.i18n.php b/Quantcast.i18n.php
deleted file mode 100644
index baf8b2b..000
--- a/Quantcast.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-?php
-/**
- * This is a backwards-compatibility shim, generated by:
- * 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = array();
-if ( !function_exists( 'wfJsonI18nShimb23cb4cbb110b6e7' ) ) {
-   function wfJsonI18nShimb23cb4cbb110b6e7( $cache, $code, $cachedData ) {
-   $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
-   foreach ( $codeSequence as $csCode ) {
-   $fileName = dirname( __FILE__ ) . /i18n/$csCode.json;
-   if ( is_readable( $fileName ) ) {
-   $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
-   foreach ( array_keys( $data ) as $key ) {
-   if ( $key === '' || $key[0] === '@' ) {
-   unset( $data[$key] );
-   }
-   }
-   $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
-   }
-
-   $cachedData['deps'][] = new FileDependency( $fileName );
-   }
-   return true;
-   }
-
-   $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShimb23cb4cbb110b6e7';
-}
diff --git a/Quantcast.php b/Quantcast.php
index 6993293..a4b7138 100644
--- a/Quantcast.php
+++ b/Quantcast.php
@@ -5,27 +5,27 @@
  * @file
  * @ingroup Extensions
  * @author Jack Phoenix j...@shoutwiki.com (forgive me)
- * @license http://en.wikipedia.org/wiki/Public_domain Public domain
- * @link http://www.mediawiki.org/wiki/Extension:Quantcast Documentation
- * @see http://bugzilla.shoutwiki.com/show_bug.cgi?id=108
+ * @license https://en.wikipedia.org/wiki/Public_domain Public domain
+ * @link https://www.mediawiki.org/wiki/Extension:Quantcast Documentation
+ * @see https://bugzilla.shoutwiki.com/show_bug.cgi?id=108
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This is not a valid entry point to MediaWiki.' );
 }
 
-$wgMessagesDirs['QuantCast'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['Quantcast'] =  __DIR__ . '/Quantcast.i18n.php';
-
 // Extension credits that will show up on Special:Version
 $wgExtensionCredits['other'][] = array(
'path' = __FILE__,
'name' = 'Quantcast Tracking',
-   'version' = '0.2.0',
+   'version' = '0.3.0',
'author' = 'Jack Phoenix',
'descriptionmsg' = 'quantcast-desc',
'url' = 'https://www.mediawiki.org/wiki/Extension:Quantcast',
 );
+
+// i18n
+$wgMessagesDirs['Quantcast'] = __DIR__ . '/i18n';
 
 // Groups that are excluded from Quantcast statistics
 $wgQuantcastTrackingExcludedGroups = array( 'staff' );
@@ -37,21 +37,21 @@
  * Add tracking JS to all pages for all users that are not members of excluded
  * groups (the group listed in $wgQuantcastTrackingExcludedGroups).
  *
- * @param $skin Object: Skin object
- * @param $text String: bottomScripts text
- * @return Boolean: true
+ * @param Skin $skin
+ * @param string $text bottomScripts text
+ * @return bool
  */
 function wfAddQuantcastTrackingCode( $skin, $text ) {
-   global $wgUser, $wgQuantcastTrackingExcludedGroups;
+   global $wgQuantcastTrackingExcludedGroups;
 
-   $groups = $wgUser-getEffectiveGroups();
+   $groups = $skin-getUser()-getEffectiveGroups();
if ( !in_array( $wgQuantcastTrackingExcludedGroups, $groups ) ) {
-   $message = trim( wfMsgForContent( 'quantcast-tracking-number' ) 
);
+   $message = $skin-msg( 'quantcast-tracking-number' 
)-inContentLanguage();
// We have a custom tracking code, use it!
-   if( !wfEmptyMsg( 'quantcast-tracking-number', $message ) ) {
-   $trackingCode = $message;
+   if ( !$message-isDisabled() ) {
+   $trackingCode = 

[MediaWiki-commits] [Gerrit] Set $wgMFAnonymousEditing = true for Italian Wikipedia in No... - change (operations/mediawiki-config)

2014-10-26 Thread Nemo bis (Code Review)
Nemo bis has uploaded a new change for review.

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

Change subject: Set $wgMFAnonymousEditing = true for Italian Wikipedia in 
November-December 2014
..

Set $wgMFAnonymousEditing = true for Italian Wikipedia in November-December 2014

Bug: 72541
Change-Id: I41d37ef4b84c238dccd86dbf1602172f191b069c
---
M wmf-config/CommonSettings.php
1 file changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index ec0927c..45a1ff6 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2153,6 +2153,12 @@
 
 require( getRealmSpecificFilename( $wmfConfigDir/mobile.php ) );
 
+if ( time() = strtotime( '2014-11-01T00:01 +0:00' )
+time() = strtotime( '2014-12-31T23:59 +0:00' )
+( $wgDBname === 'itwiki' )
+) {
+   $wgMFAnonymousEditing = true; // Bug 72541
+}
 
 # MUST be after MobileFrontend initialization
 if ( $wmgEnableTextExtracts ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41d37ef4b84c238dccd86dbf1602172f191b069c
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Nemo bis federicol...@tiscali.it

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


[MediaWiki-commits] [Gerrit] Fix fatal on empty query submodule list - change (mediawiki...ApiSandbox)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix fatal on empty query submodule list
..


Fix fatal on empty query submodule list

Bug: 67577
Change-Id: I2a872f56a8c703da13f82570620d40928656a7ab
---
M resources/main.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Alex Monk: Looks good to me, approved
  Legoktm: Looks good to me, approved
  TTO: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/resources/main.js b/resources/main.js
index 45da2d0..d16ff63 100644
--- a/resources/main.js
+++ b/resources/main.js
@@ -617,7 +617,7 @@
} );
if ( $action.val() === 'query' ) {
var lists = [], metas = [], props = [];
-   $.each( $query.val(), function ( index, 
queryParam ) {
+   $.each( $query.val() || [], function ( index, 
queryParam ) {
if ( queryParam.substring( 0, 5 ) == 
'list=' ) {
lists.push( 
queryParam.substring( 5 ) );
} else if ( queryParam.substring( 0, 5 
) == 'meta=' ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2a872f56a8c703da13f82570620d40928656a7ab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ApiSandbox
Gerrit-Branch: master
Gerrit-Owner: Umherirrender umherirrender_de...@web.de
Gerrit-Reviewer: Alex Monk kren...@wikimedia.org
Gerrit-Reviewer: Anomie bjor...@wikimedia.org
Gerrit-Reviewer: Jackmcbarn jackmcb...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: TTO at.li...@live.com.au
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add mediawiki.userSuggest to Special:UserRights - change (mediawiki/core)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add mediawiki.userSuggest to Special:UserRights
..


Add mediawiki.userSuggest to Special:UserRights

This gives a suggestion list when typing a username

Bug: 48240
Change-Id: I35dc9c4cf62c7a7ff5214d804d65b4ac9feeb897
---
M includes/specials/SpecialUserrights.php
1 file changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/includes/specials/SpecialUserrights.php 
b/includes/specials/SpecialUserrights.php
index cefdad0..6ca57aa 100644
--- a/includes/specials/SpecialUserrights.php
+++ b/includes/specials/SpecialUserrights.php
@@ -415,6 +415,8 @@
 * Output a form to allow searching for a user
 */
function switchForm() {
+   $this-getOutput()-addModules( 'mediawiki.userSuggest' );
+
$this-getOutput()-addHTML(
Html::openElement(
'form',
@@ -433,7 +435,10 @@
'username',
30,
str_replace( '_', ' ', $this-mTarget ),
-   array( 'autofocus' = true )
+   array(
+   'autofocus' = true,
+   'class' = 'mw-autocomplete-user', // 
used by mediawiki.userSuggest
+   )
) . ' ' .
Xml::submitButton( $this-msg( 'editusergroup' 
)-text() ) .
Html::closeElement( 'fieldset' ) .

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I35dc9c4cf62c7a7ff5214d804d65b4ac9feeb897
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender umherirrender_de...@web.de
Gerrit-Reviewer: Alex Monk kren...@wikimedia.org
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Krinkle krinklem...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Umherirrender umherirrender_de...@web.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Improve the CodeEditor toolbar - change (mediawiki...CodeEditor)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Improve the CodeEditor toolbar
..


Improve the CodeEditor toolbar

There isn't much in it yet, but it's a start.
Also needs a patch in WikiEditor, which is forcing some elements to be
visible for no apparent reason.

Change-Id: I6b57e5c11066a104a89bef3b7c8efd2129a80a8f
---
M modules/jquery.codeEditor.css
M modules/jquery.codeEditor.js
2 files changed, 37 insertions(+), 9 deletions(-)

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



diff --git a/modules/jquery.codeEditor.css b/modules/jquery.codeEditor.css
index 73f89a8..50c56d5 100644
--- a/modules/jquery.codeEditor.css
+++ b/modules/jquery.codeEditor.css
@@ -1,3 +1,17 @@
+.group-codeeditor-tools,
+.codeEditor-ui-toolbar .group-insert,
+.codeEditor-ui-toolbar .group-format,
+.codeEditor-ui-toolbar .tabs span.tab-advanced,
+.codeEditor-ui-toolbar .tabs span.tab-characters,
+.codeEditor-ui-toolbar .tabs span.tab-help,
+.codeEditor-ui-toolbar .sections {
+   display: none;
+}
+
+.codeEditor-ui-toolbar .group-codeeditor-tools {
+   display: block;
+}
+
 .codeEditor-status {
clear: both;
width: 100%;
diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js
index 4d074b5..e488334 100644
--- a/modules/jquery.codeEditor.js
+++ b/modules/jquery.codeEditor.js
@@ -93,6 +93,7 @@
},
'setupCodeEditorToolbar': function () {
// Drop out some formatting that isn't relevant 
on these pages...
+   /*
context.api.removeFromToolbar( context, {
'section': 'main',
'group': 'format',
@@ -103,6 +104,7 @@
'group': 'format',
'tool': 'italic'
} );
+   */
var callback = function ( context ) {
context.codeEditorActive = 
!context.codeEditorActive;
 
@@ -118,19 +120,28 @@
};
context.api.addToToolbar( context, {
'section': 'main',
-   'group': 'format',
-   'tools': {
-   'codeEditor': {
-   'labelMsg': 
'codeeditor-toolbar-toggle',
-   'type': 'button',
-   'icon': 
context.fn.codeEditorToolbarIcon(),
-   'action': {
-   'type': 
'callback',
-   'execute': 
callback
+   'groups' : {
+   'codeeditor-main' : {
+   'tools': {
+   'codeEditor': {
+   
'labelMsg': 'codeeditor-toolbar-toggle',
+   'type': 
'button',
+   'icon': 
context.fn.codeEditorToolbarIcon(),
+   
'action': {
+   
'type': 'callback',
+   
'execute': callback
+   }
+   }
+   }
+   },
+   'codeeditor-tools' : {
+   'tools' : {
}
}
}
} );
+   $( '.group-codeeditor-tools' ).prependTo( 
'.section-main' );
+   $( '.group-codeeditor-main' ).prependTo( 
'.section-main' );
},
'toggleCodeEditorToolbar': function () {
var target, $img;
@@ -231,6 +242,7 @@
 

[MediaWiki-commits] [Gerrit] Remove full stop in description message - change (mediawiki...Modern)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove full stop in description message
..


Remove full stop in description message

Description messages do not end with a full stop.

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

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



diff --git a/i18n/en.json b/i18n/en.json
index 398e532..a22435e 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -2,5 +2,5 @@
modern.css: /* CSS placed here will affect users of the Modern skin 
*/,
modern.js: /* Any JavaScript here will be loaded for users using the 
Modern skin */,
skinname-modern: Modern,
-   modern-desc: A blue/grey theme with sidebar and top bar. Derived 
from MonoBook.
+   modern-desc: A blue/grey theme with sidebar and top bar. Derived 
from MonoBook
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I463739f1323987f31797387f710a3feef0dbc42a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Modern
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove full stop in description message - change (mediawiki...chameleon)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove full stop in description message
..


Remove full stop in description message

Description messages do not end with a full stop.

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

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



diff --git a/i18n/en.json b/i18n/en.json
index 7d1738f..6245e10 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -5,7 +5,7 @@
]
},
skinname-chameleon: Chameleon,
-   chameleon-desc: The Chameleon skin.,
+   chameleon-desc: The Chameleon skin,
chameleon-loggedin: You are logged in as $1.,
chameleon-notloggedin: You are not logged in,
chameleon-newmessages: You have new messages.,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I54cb6f28c959f5b7a38c21e193de9b0dd2d692c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/chameleon
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Localisation updates from https://translatewiki.net. - change (mediawiki/core)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Localisation updates from https://translatewiki.net.
..


Localisation updates from https://translatewiki.net.

Change-Id: I1c1be5f954c274bb2479cd7068d32562db05b670
---
M languages/messages/MessagesMai.php
1 file changed, 18 insertions(+), 0 deletions(-)

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



diff --git a/languages/messages/MessagesMai.php 
b/languages/messages/MessagesMai.php
index 09ae5a6..abba540 100644
--- a/languages/messages/MessagesMai.php
+++ b/languages/messages/MessagesMai.php
@@ -26,3 +26,21 @@
 
 $fallback = 'hi';
 
+$namespaceNames = array(
+   NS_MEDIA= 'मेडिया',
+   NS_SPECIAL  = 'विशेष',
+   NS_TALK = 'वार्ता',
+   NS_USER = 'प्रयोगकर्ता',
+   NS_USER_TALK= 'प्रयोगकर्ता_वार्ता',
+   NS_PROJECT_TALK = '$1_वार्ता',
+   NS_FILE = 'फाइल',
+   NS_FILE_TALK= 'फाइल_वार्ता',
+   NS_MEDIAWIKI= 'मेडियाविकि',
+   NS_MEDIAWIKI_TALK   = 'मेडियाविकि_वार्ता',
+   NS_TEMPLATE = 'आकृति',
+   NS_TEMPLATE_TALK= 'आकृति_वार्ता',
+   NS_HELP = 'मद्दत',
+   NS_HELP_TALK= 'मद्दत_वार्ता',
+   NS_CATEGORY = 'श्रेणी',
+   NS_CATEGORY_TALK= 'श्रेणी_वार्ता',
+);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1c1be5f954c274bb2479cd7068d32562db05b670
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Localisation updates from https://translatewiki.net. - change (mediawiki/core)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Localisation updates from https://translatewiki.net.
..


Localisation updates from https://translatewiki.net.

Change-Id: I7d8ecd624b63c3323afd159600d8cca3806a7760
---
M languages/messages/MessagesAng.php
1 file changed, 7 insertions(+), 3 deletions(-)

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



diff --git a/languages/messages/MessagesAng.php 
b/languages/messages/MessagesAng.php
index aa1d9d1..2f86c78 100644
--- a/languages/messages/MessagesAng.php
+++ b/languages/messages/MessagesAng.php
@@ -11,8 +11,11 @@
 $namespaceNames = array(
NS_SPECIAL  = 'Syndrig',
NS_TALK = 'Mōtung',
-   NS_FILE = 'Biliþ',
-   NS_FILE_TALK= 'Biliþmōtung',
+   NS_USER = 'Brūcend',
+   NS_USER_TALK= 'Brūcendmōtung',
+   NS_FILE = 'Ymele',
+   NS_FILE_TALK= 'Ymelmōtung',
+   NS_MEDIAWIKI_TALK   = 'MediaWikimōtung',
NS_TEMPLATE = 'Bysen',
NS_TEMPLATE_TALK= 'Bysenmōtung',
NS_HELP = 'Help',
@@ -26,8 +29,9 @@
'Motung'= NS_TALK,
'Brucend'   = NS_USER,
'Brucendmotung' = NS_USER_TALK,
-   'Biliþgesprec'  = NS_FILE_TALK,
+   'Biliþ' = NS_FILE,
'Biliþmotung'   = NS_FILE_TALK,
+   'Biliþmōtung'   = NS_FILE_TALK,
'Bysengesprec'  = NS_TEMPLATE_TALK,
'Bysenmotung'   = NS_TEMPLATE_TALK,
'Helpgesprec'   = NS_HELP_TALK,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7d8ecd624b63c3323afd159600d8cca3806a7760
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] [FIX] Fixed flake errors - change (pywikibot/core)

2014-10-26 Thread XZise (Code Review)
XZise has uploaded a new change for review.

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

Change subject: [FIX] Fixed flake errors
..

[FIX] Fixed flake errors

Due to the outage of jenkins a few reviews have been merged manually
which contained minor flake errors.

Change-Id: Ibded765a863b36a185258acff3e32de75ff4a58d
---
M pywikibot/exceptions.py
M pywikibot/site.py
2 files changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/16/168916/1

diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index d735038..95d3111 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -260,6 +260,7 @@
 
 PageNotSaved = PageSaveRelatedError
 
+
 class NoCreateError(PageSaveRelatedError):
 
 Parameter nocreate doesn't allow page creation.
@@ -268,6 +269,7 @@
 
 pass
 
+
 class EditConflict(PageSaveRelatedError):
 
 There has been an edit conflict while uploading the page
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 86de719..642731c 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -37,7 +37,6 @@
 from pywikibot.exceptions import (
 Error,
 PageRelatedError,
-PageSaveRelatedError,
 EditConflict,
 PageCreatedConflict,
 PageDeletedConflict,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibded765a863b36a185258acff3e32de75ff4a58d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise commodorefabia...@gmx.de

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


[MediaWiki-commits] [Gerrit] [FIX] Fixed flake errors - change (pywikibot/core)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: [FIX] Fixed flake errors
..


[FIX] Fixed flake errors

Due to the outage of jenkins a few reviews have been merged manually
which contained minor flake errors.

Change-Id: Ibded765a863b36a185258acff3e32de75ff4a58d
---
M pywikibot/exceptions.py
M pywikibot/site.py
2 files changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index d735038..95d3111 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -260,6 +260,7 @@
 
 PageNotSaved = PageSaveRelatedError
 
+
 class NoCreateError(PageSaveRelatedError):
 
 Parameter nocreate doesn't allow page creation.
@@ -268,6 +269,7 @@
 
 pass
 
+
 class EditConflict(PageSaveRelatedError):
 
 There has been an edit conflict while uploading the page
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 86de719..642731c 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -37,7 +37,6 @@
 from pywikibot.exceptions import (
 Error,
 PageRelatedError,
-PageSaveRelatedError,
 EditConflict,
 PageCreatedConflict,
 PageDeletedConflict,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibded765a863b36a185258acff3e32de75ff4a58d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise commodorefabia...@gmx.de
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] page.py: fix docstring of getFileVersionHistory() - change (pywikibot/core)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: page.py: fix docstring of getFileVersionHistory()
..


page.py: fix docstring of getFileVersionHistory()

getFileVersionHistory() returns a list of dicts, not tuples.

Change-Id: I783ed237d691aedb44464a6e292d60ea778183b7
---
M pywikibot/page.py
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/pywikibot/page.py b/pywikibot/page.py
index 5a4994c..54c3ff0 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1915,8 +1915,9 @@
 def getFileVersionHistory(self):
 Return the file's version history.
 
-@return: An iterator yielding tuples containing (timestamp,
-username, resolution, filesize, comment).
+@return: A list of dictionaries with the following keys:
+[comment, sha1, url, timestamp, metadata,
+ height, width, mime, user, descriptionurl, size]
 
 
 return self.site.loadimageinfo(self, history=True)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I783ed237d691aedb44464a6e292d60ea778183b7
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa mpaa.w...@gmail.com
Gerrit-Reviewer: John Vandenberg jay...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Ricordisamoa ricordisa...@openmailbox.org
Gerrit-Reviewer: XZise commodorefabia...@gmx.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] GlobalRenameRequest: Fix typos in variable name - change (mediawiki...CentralAuth)

2014-10-26 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: GlobalRenameRequest: Fix typos in variable name
..

GlobalRenameRequest: Fix typos in variable name

This was causing the requested timestamp to appear as the current
timestamp when viewing the request. Everything appears to be
corrent in the database though.

Change-Id: I647a472d2c580b8a47c18da050214ea78c9f6718
---
M includes/GlobalRename/GlobalRenameRequest.php
1 file changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/includes/GlobalRename/GlobalRenameRequest.php 
b/includes/GlobalRename/GlobalRenameRequest.php
index b603bc8..aeeb8e2 100644
--- a/includes/GlobalRename/GlobalRenameRequest.php
+++ b/includes/GlobalRename/GlobalRenameRequest.php
@@ -244,7 +244,7 @@
public function save() {
$dbw = self::getDB( DB_MASTER );
if ( $this-id === null ) {
-   $this-reqested = wfTimestampNow();
+   $this-requested = wfTimestampNow();
$this-status = self::PENDING;
$dbw-insert(
'renameuser_queue',
@@ -253,7 +253,7 @@
'rq_wiki' = $this-wiki,
'rq_newname'  = $this-newName,
'rq_reason'   = $this-reason,
-   'rq_requested_ts' = $this-reqested,
+   'rq_requested_ts' = $this-requested,
'rq_status'   = $this-status,
),
__METHOD__
@@ -267,7 +267,7 @@
'rq_wiki' = $this-wiki,
'rq_newname'  = $this-newName,
'rq_reason'   = $this-reason,
-   'rq_requested_ts' = $this-reqested,
+   'rq_requested_ts' = $this-requested,
'rq_status'   = $this-status,
'rq_completed_ts' = $this-completed,
'rq_deleted'  = $this-deleted,
@@ -354,7 +354,7 @@
$req-wiki = $row-wiki;
$req-newName = $row-newname;
$req-reason = $row-reason;
-   $req-reqested = $row-requested;
+   $req-requested = $row-requested;
$req-status = $row-status;
$req-completed = $row-completed;
$req-deleted = $row-deleted;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I647a472d2c580b8a47c18da050214ea78c9f6718
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add missing @throws tag - change (mediawiki...CentralAuth)

2014-10-26 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Add missing @throws tag
..

Add missing @throws tag

Change-Id: Ib278acc8181c3a35368ef858b72133786aba94e5
---
M includes/GlobalRename/GlobalRenameRequest.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/includes/GlobalRename/GlobalRenameRequest.php 
b/includes/GlobalRename/GlobalRenameRequest.php
index aeeb8e2..b839a4c 100644
--- a/includes/GlobalRename/GlobalRenameRequest.php
+++ b/includes/GlobalRename/GlobalRenameRequest.php
@@ -140,6 +140,7 @@
 
/**
 * @param string $newName
+* @throws MWException if an invalid username is provided
 * @return GlobalRenameRequest self, for message chaining
 */
public function setNewName( $newName ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib278acc8181c3a35368ef858b72133786aba94e5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com

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


[MediaWiki-commits] [Gerrit] GlobalRenameRequest: Fix typos in variable name - change (mediawiki...CentralAuth)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: GlobalRenameRequest: Fix typos in variable name
..


GlobalRenameRequest: Fix typos in variable name

This was causing the requested timestamp to appear as the current
timestamp when viewing the request. Everything appears to be
corrent in the database though.

Change-Id: I647a472d2c580b8a47c18da050214ea78c9f6718
---
M includes/GlobalRename/GlobalRenameRequest.php
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/includes/GlobalRename/GlobalRenameRequest.php 
b/includes/GlobalRename/GlobalRenameRequest.php
index b603bc8..aeeb8e2 100644
--- a/includes/GlobalRename/GlobalRenameRequest.php
+++ b/includes/GlobalRename/GlobalRenameRequest.php
@@ -244,7 +244,7 @@
public function save() {
$dbw = self::getDB( DB_MASTER );
if ( $this-id === null ) {
-   $this-reqested = wfTimestampNow();
+   $this-requested = wfTimestampNow();
$this-status = self::PENDING;
$dbw-insert(
'renameuser_queue',
@@ -253,7 +253,7 @@
'rq_wiki' = $this-wiki,
'rq_newname'  = $this-newName,
'rq_reason'   = $this-reason,
-   'rq_requested_ts' = $this-reqested,
+   'rq_requested_ts' = $this-requested,
'rq_status'   = $this-status,
),
__METHOD__
@@ -267,7 +267,7 @@
'rq_wiki' = $this-wiki,
'rq_newname'  = $this-newName,
'rq_reason'   = $this-reason,
-   'rq_requested_ts' = $this-reqested,
+   'rq_requested_ts' = $this-requested,
'rq_status'   = $this-status,
'rq_completed_ts' = $this-completed,
'rq_deleted'  = $this-deleted,
@@ -354,7 +354,7 @@
$req-wiki = $row-wiki;
$req-newName = $row-newname;
$req-reason = $row-reason;
-   $req-reqested = $row-requested;
+   $req-requested = $row-requested;
$req-status = $row-status;
$req-completed = $row-completed;
$req-deleted = $row-deleted;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I647a472d2c580b8a47c18da050214ea78c9f6718
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: BryanDavis bda...@wikimedia.org
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add missing @throws tag - change (mediawiki...CentralAuth)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add missing @throws tag
..


Add missing @throws tag

Change-Id: Ib278acc8181c3a35368ef858b72133786aba94e5
---
M includes/GlobalRename/GlobalRenameRequest.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/includes/GlobalRename/GlobalRenameRequest.php 
b/includes/GlobalRename/GlobalRenameRequest.php
index aeeb8e2..b839a4c 100644
--- a/includes/GlobalRename/GlobalRenameRequest.php
+++ b/includes/GlobalRename/GlobalRenameRequest.php
@@ -140,6 +140,7 @@
 
/**
 * @param string $newName
+* @throws MWException if an invalid username is provided
 * @return GlobalRenameRequest self, for message chaining
 */
public function setNewName( $newName ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib278acc8181c3a35368ef858b72133786aba94e5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] HHVM: set MALLOC_CONF envvar in upstart job def - change (operations/puppet)

2014-10-26 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: HHVM: set MALLOC_CONF envvar in upstart job def
..

HHVM: set MALLOC_CONF envvar in upstart job def

Have HHVM start with jemalloc's memory profiling capabilities enabled but
inactive. Profiling can then be toggled on-the-fly by cURLing the
/jemalloc-prof-* endpoints of the admin server.

Change-Id: I74c8f3376a7e1e495ea68815bf36a0b1cbc4c7c2
---
M modules/hhvm/files/hhvm.conf
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/19/168919/1

diff --git a/modules/hhvm/files/hhvm.conf b/modules/hhvm/files/hhvm.conf
index 06fca71..fc19065 100644
--- a/modules/hhvm/files/hhvm.conf
+++ b/modules/hhvm/files/hhvm.conf
@@ -21,6 +21,13 @@
   ( cd /usr/lib/x86_64-linux-gnu/hhvm/extensions; ln -Trsf $API_VERSION 
current; )
 end script
 
+# Start HHVM with memory profiling capabilities enabled but inactive.
+# Profiling can then be toggled on-the-fly by cURLing the /jemalloc-prof-*
+# endpoints of the admin server. See the jemalloc(3) man page for details.
+# You can override these options by assigning MALLOC_CONF a different value
+# in /etc/default/hhvm.
+env MALLOC_CONF=prof:true,prof_active:false
+
 script
   . /etc/default/hhvm
   # HHVM clears its PID file on exit. We need it in the post-stop

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74c8f3376a7e1e495ea68815bf36a0b1cbc4c7c2
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] ButtonInputWidget: Treat 'readOnly' is 'disabled' - change (oojs/ui)

2014-10-26 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: ButtonInputWidget: Treat 'readOnly' is 'disabled'
..

ButtonInputWidget: Treat 'readOnly' is 'disabled'

One can't have read-only buttons, but InputWidget accepts a 'readOnly'
configuration option. This looks like a sane solution.

Change-Id: If61294f27540b49547328094ab478f3aeff9b13b
---
M php/widgets/OoUiButtonInputWidget.php
M src/widgets/ButtonInputWidget.js
2 files changed, 22 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/20/168920/1

diff --git a/php/widgets/OoUiButtonInputWidget.php 
b/php/widgets/OoUiButtonInputWidget.php
index 87a3746..2185936 100644
--- a/php/widgets/OoUiButtonInputWidget.php
+++ b/php/widgets/OoUiButtonInputWidget.php
@@ -76,4 +76,12 @@
 
return $this;
}
+
+   public function isReadOnly() {
+   return $this-isDisabled();
+   }
+
+   public function setReadOnly( $state ) {
+   return $this-setDisabled( $state );
+   }
 }
diff --git a/src/widgets/ButtonInputWidget.js b/src/widgets/ButtonInputWidget.js
index b7b0244..4ca0289 100644
--- a/src/widgets/ButtonInputWidget.js
+++ b/src/widgets/ButtonInputWidget.js
@@ -132,3 +132,17 @@
}
return false;
 };
+
+/**
+ * @inheritdoc
+ */
+OO.ui.ButtonInputWidget.prototype.isReadOnly = function () {
+   return this.isDisabled();
+};
+
+/**
+ * @inheritdoc
+ */
+OO.ui.ButtonInputWidget.prototype.setReadOnly = function ( state ) {
+   return this.setDisabled( state );
+};

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If61294f27540b49547328094ab478f3aeff9b13b
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński matma@gmail.com

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


[MediaWiki-commits] [Gerrit] Use RequestContext::getMainAndWarn() in SpecialPage::getCont... - change (mediawiki/core)

2014-10-26 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Use RequestContext::getMainAndWarn() in 
SpecialPage::getContext()
..

Use RequestContext::getMainAndWarn() in SpecialPage::getContext()

Change-Id: Ic5394e3b7ee6710b9955747ce0ca7670485d4537
---
M includes/specialpage/SpecialPage.php
1 file changed, 1 insertion(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/21/168921/1

diff --git a/includes/specialpage/SpecialPage.php 
b/includes/specialpage/SpecialPage.php
index c0a94af..52556cd 100644
--- a/includes/specialpage/SpecialPage.php
+++ b/includes/specialpage/SpecialPage.php
@@ -487,10 +487,7 @@
if ( $this-mContext instanceof IContextSource ) {
return $this-mContext;
} else {
-   wfDebug( __METHOD__ .  called and \$mContext is null. 
 .
-   Return RequestContext::getMain(); for 
sanity\n );
-
-   return RequestContext::getMain();
+   return RequestContext::getMainAndWarn( __METHOD__ );
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic5394e3b7ee6710b9955747ce0ca7670485d4537
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com

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


[MediaWiki-commits] [Gerrit] Only add the oauthadmin group on the central wiki - change (operations/mediawiki-config)

2014-10-26 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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

Change subject: Only add the oauthadmin group on the central wiki
..

Only add the oauthadmin group on the central wiki

Needs to be an extension function as labs uses a different
central wiki, thus overrides $wgMWOAuthCentralWiki.

Change-Id: If063a8ffc9989477f7307f6bd6be73d496eebd86
---
M wmf-config/CommonSettings.php
1 file changed, 9 insertions(+), 1 deletion(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index ec0927c..982c1aa 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2839,7 +2839,7 @@
$wgMWOAuthCentralWiki = 'mediawikiwiki';
$wgMWOAuthSharedUserSource = 'CentralAuth';
$wgMWOAuthSecureTokenTransfer = true;
-   $wgGroupPermissions['oauthadmin']['mwoauthmanageconsumer'] = true;
+
$wgGroupPermissions['autoconfirmed']['mwoauthproposeconsumer'] = true;
$wgGroupPermissions['autoconfirmed']['mwoauthupdateownconsumer'] = true;
 
@@ -2867,6 +2867,14 @@
$wgMWOAuthGrantPermissions['editpage']['item-merge'] = true;
$wgMWOAuthGrantPermissions['editpage']['property-term'] = true;
$wgMWOAuthGrantPermissions['editpage']['item-redirect'] = true;
+
+   $wgExtensionFunctions[] = function() {
+   global $wgDBname, $wgMWOAuthCentralWiki;
+   if ( $wgDBname === $wgMWOAuthCentralWiki ) {
+   // Only needed on the central wiki.
+   
$wgGroupPermissions['oauthadmin']['mwoauthmanageconsumer'] = true;
+   }
+   };
 }
 
 if ( $wmgUsePetition ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If063a8ffc9989477f7307f6bd6be73d496eebd86
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Hoo man h...@online.de

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


[MediaWiki-commits] [Gerrit] Remove RequestContext::getMainAndWarn - change (mediawiki/core)

2014-10-26 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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

Change subject: Remove RequestContext::getMainAndWarn
..

Remove RequestContext::getMainAndWarn

It's not RequestContext's responsibility to log that some other
class does not have a context available.

Can be removed as there aren't any users out there.
Will backport this to the yet unreleased 1.24.

This was introduced in I1628a179.

Change-Id: I23b2adf0e25f6c95b2028607f044df2fb0cc40e9
---
M includes/context/RequestContext.php
M includes/gallery/ImageGalleryBase.php
2 files changed, 6 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/168923/1

diff --git a/includes/context/RequestContext.php 
b/includes/context/RequestContext.php
index 059f18c..1f63598 100644
--- a/includes/context/RequestContext.php
+++ b/includes/context/RequestContext.php
@@ -433,21 +433,6 @@
}
 
/**
-* Get the RequestContext object associated with the main request
-* and gives a warning to the log, to find places, where a context 
maybe is missing.
-*
-* @param string $func
-* @return RequestContext
-* @since 1.24
-*/
-   public static function getMainAndWarn( $func = __METHOD__ ) {
-   wfDebug( $func . ' called without context. ' .
-   Using RequestContext::getMain() for sanity\n );
-
-   return self::getMain();
-   }
-
-   /**
 * Resets singleton returned by getMain(). Should be called only from 
unit tests.
 */
public static function resetMain() {
diff --git a/includes/gallery/ImageGalleryBase.php 
b/includes/gallery/ImageGalleryBase.php
index b0a593d..d356a2f 100644
--- a/includes/gallery/ImageGalleryBase.php
+++ b/includes/gallery/ImageGalleryBase.php
@@ -93,9 +93,14 @@
static function factory( $mode = false, IContextSource $context = null 
) {
global $wgContLang;
self::loadModes();
+
if ( !$context ) {
-   $context = RequestContext::getMainAndWarn( __METHOD__ );
+   wfDebug( __METHOD__ . ' called without context. ' .
+   Using RequestContext::getMain() for sanity\n );
+
+   $context = RequestContext::getMain();
}
+
if ( !$mode ) {
$galleryOpions = $context-getConfig()-get( 
'GalleryOptions' );
$mode = $galleryOpions['mode'];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I23b2adf0e25f6c95b2028607f044df2fb0cc40e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hoo man h...@online.de

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


[MediaWiki-commits] [Gerrit] Add about link to disable/enable dialog - change (mediawiki...MultimediaViewer)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add about link to disable/enable dialog
..


Add about link to disable/enable dialog

This was the last issue with the dialogs. Tests included.

Change-Id: Ic08af400893950a04489af4b166827d059561974
---
M MultimediaViewer.php
M resources/mmv/logging/mmv.logging.ActionLogger.js
M resources/mmv/ui/mmv.ui.viewingOptions.js
M resources/mmv/ui/mmv.ui.viewingOptions.less
M tests/qunit/mmv/ui/mmv.ui.viewingOptions.test.js
5 files changed, 37 insertions(+), 9 deletions(-)

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



diff --git a/MultimediaViewer.php b/MultimediaViewer.php
index 46bffd5..963005c 100644
--- a/MultimediaViewer.php
+++ b/MultimediaViewer.php
@@ -776,6 +776,7 @@
),
 
'messages' = array(
+   'multimediaviewer-options-learn-more',
'multimediaviewer-options-dialog-header',
'multimediaviewer-option-header-viewer',
'multimediaviewer-option-header-filepage',
@@ -1013,7 +1014,7 @@
 
 $wgHooks['EventLoggingRegisterSchemas'][] = function( array $schemas ) {
$schemas += array(
-   'MediaViewer' = 10277480,
+   'MediaViewer' = 10308479,
'MultimediaViewerNetworkPerformance' = 7917896,
'MultimediaViewerDuration' = 8572641,
'MultimediaViewerAttribution' = 9758179,
diff --git a/resources/mmv/logging/mmv.logging.ActionLogger.js 
b/resources/mmv/logging/mmv.logging.ActionLogger.js
index df3b7e9..c394570 100644
--- a/resources/mmv/logging/mmv.logging.ActionLogger.js
+++ b/resources/mmv/logging/mmv.logging.ActionLogger.js
@@ -111,7 +111,9 @@
'download-open': 'User opened the dialog to download this 
file.',
'download-close': 'User closed the dialog to download this 
file.',
'options-open': 'User opened the enable/disable dialog.',
-   'options-close': 'User either canceled an enable/disable action 
or closed a confirmation window.'
+   'options-close': 'User either canceled an enable/disable action 
or closed a confirmation window.',
+   'disable-about-link': 'User clicked on the Learn more link in 
the disable window.',
+   'enable-about-link': 'User clicked on the Learn more link in 
the enable window.'
};
 
/**
diff --git a/resources/mmv/ui/mmv.ui.viewingOptions.js 
b/resources/mmv/ui/mmv.ui.viewingOptions.js
index 1918949..fe180a7 100644
--- a/resources/mmv/ui/mmv.ui.viewingOptions.js
+++ b/resources/mmv/ui/mmv.ui.viewingOptions.js
@@ -67,7 +67,6 @@
mw.message( 
'multimediaviewer-enable-confirmation-header' ).text(),
mw.message( 
'multimediaviewer-enable-confirmation-text', mw.config.get( 'wgSiteName' ) 
).text()
] );
-
};
 
/**
@@ -233,6 +232,7 @@
.appendTo( $div );
 
this.addText( $div, msgs );
+   this.addInfoLink( $div, ( enabled ? 'enable' : 'disable' ) + 
'-about-link' );
this.makeButtons( $div, smsg, enabled );
 
this[propName] = $div;
@@ -350,6 +350,21 @@
};
 
/**
+* Adds the info link to the panel.
+* @param {jQuery} $div The panel to which we're adding the link.
+*/
+   ODP.addInfoLink = function ( $div, eventName ) {
+   var self = this;
+
+   $( 'a' )
+   .addClass( 'mw-mmv-project-info-link' )
+   .prop( 'href', mw.config.get( 'wgMultimediaViewer' 
).helpLink )
+   .text( mw.message( 
'multimediaviewer-options-learn-more' ) )
+   .click( function ( e ) { self.trackLinkClick.call( 
this, eventName, e ); } )
+   .appendTo( $div.find( '.mw-mmv-options-text' ) );
+   };
+
+   /**
 * Checks the preference.
 */
ODP.isEnabled = function () {
diff --git a/resources/mmv/ui/mmv.ui.viewingOptions.less 
b/resources/mmv/ui/mmv.ui.viewingOptions.less
index ecccfce..f857b39 100644
--- a/resources/mmv/ui/mmv.ui.viewingOptions.less
+++ b/resources/mmv/ui/mmv.ui.viewingOptions.less
@@ -45,11 +45,11 @@
}
 
.mw-mmv-options-enable {
-   height: 170px;
+   height: 180px;
}
 
.mw-mmv-options-disable {
-   height: 150px;
+   height: 160px;
}
 
.mw-mmv-enable-confirmation,
diff --git a/tests/qunit/mmv/ui/mmv.ui.viewingOptions.test.js 
b/tests/qunit/mmv/ui/mmv.ui.viewingOptions.test.js
index 3dda1a2..3da7d3b 100644
--- a/tests/qunit/mmv/ui/mmv.ui.viewingOptions.test.js
+++ b/tests/qunit/mmv/ui/mmv.ui.viewingOptions.test.js
@@ -27,9 +27,9 @@
assert.ok( 

[MediaWiki-commits] [Gerrit] Make sure initialHash exists before checking its value - change (mediawiki...VisualEditor)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Make sure initialHash exists before checking its value
..


Make sure initialHash exists before checking its value

(Followup on If17b50cc4a39993)
Make sure initialHash is set before checking and changing its value
in the MWImageModel method. If a user chooses a brand new image to
insert into the document (an insertion rather than update) then the
initial hash is empty, and changing its values will fail with an
error message.

Bug: 72492
Change-Id: I3f9ea74891cc0ab77a07fa5d4e9cbc591f5b93e6
---
M modules/ve-mw/dm/models/ve.dm.MWImageModel.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/ve-mw/dm/models/ve.dm.MWImageModel.js 
b/modules/ve-mw/dm/models/ve.dm.MWImageModel.js
index fe70d3e..b0cd7b2 100644
--- a/modules/ve-mw/dm/models/ve.dm.MWImageModel.js
+++ b/modules/ve-mw/dm/models/ve.dm.MWImageModel.js
@@ -1066,7 +1066,7 @@
// We have to adjust the details in the initial hash if 
the original
// image was 'default' since we didn't have default 
until now and the
// default dimensions that were 'recorded' were wrong
-   if ( this.initialHash.scalable.isDefault ) {
+   if ( !$.isEmptyObject( this.initialHash )  
this.initialHash.scalable.isDefault ) {
this.initialHash.scalable.currentDimensions = 
this.scalable.getDefaultDimensions();
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3f9ea74891cc0ab77a07fa5d4e9cbc591f5b93e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo mor...@gmail.com
Gerrit-Reviewer: Catrope roan.katt...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: f4a5139..358268b - change (mediawiki/extensions)

2014-10-26 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has submitted this change and it was merged.

Change subject: Syncronize VisualEditor: f4a5139..358268b
..


Syncronize VisualEditor: f4a5139..358268b

Change-Id: I0f1d34e5821caef206b2145e5003789cc74f3a83
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jenkins-mwext-sync: Verified; Looks good to me, approved



diff --git a/VisualEditor b/VisualEditor
index f4a5139..358268b 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit f4a5139012044aeab22e7e95364185293eaa605e
+Subproject commit 358268be7acb3baa7978b742dd16eb0fde2917c6

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0f1d34e5821caef206b2145e5003789cc74f3a83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org
Gerrit-Reviewer: Jenkins-mwext-sync jenkins-...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: f4a5139..358268b - change (mediawiki/extensions)

2014-10-26 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has uploaded a new change for review.

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

Change subject: Syncronize VisualEditor: f4a5139..358268b
..

Syncronize VisualEditor: f4a5139..358268b

Change-Id: I0f1d34e5821caef206b2145e5003789cc74f3a83
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions 
refs/changes/25/168925/1

diff --git a/VisualEditor b/VisualEditor
index f4a5139..358268b 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit f4a5139012044aeab22e7e95364185293eaa605e
+Subproject commit 358268be7acb3baa7978b742dd16eb0fde2917c6

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f1d34e5821caef206b2145e5003789cc74f3a83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] HHVM: set MALLOC_CONF envvar in upstart job def - change (operations/puppet)

2014-10-26 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: HHVM: set MALLOC_CONF envvar in upstart job def
..


HHVM: set MALLOC_CONF envvar in upstart job def

Have HHVM start with jemalloc's memory profiling capabilities enabled but
inactive. Profiling can then be toggled on-the-fly by cURLing the
/jemalloc-prof-* endpoints of the admin server.

Change-Id: I74c8f3376a7e1e495ea68815bf36a0b1cbc4c7c2
---
M modules/hhvm/files/hhvm.conf
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/hhvm/files/hhvm.conf b/modules/hhvm/files/hhvm.conf
index 06fca71..fc19065 100644
--- a/modules/hhvm/files/hhvm.conf
+++ b/modules/hhvm/files/hhvm.conf
@@ -21,6 +21,13 @@
   ( cd /usr/lib/x86_64-linux-gnu/hhvm/extensions; ln -Trsf $API_VERSION 
current; )
 end script
 
+# Start HHVM with memory profiling capabilities enabled but inactive.
+# Profiling can then be toggled on-the-fly by cURLing the /jemalloc-prof-*
+# endpoints of the admin server. See the jemalloc(3) man page for details.
+# You can override these options by assigning MALLOC_CONF a different value
+# in /etc/default/hhvm.
+env MALLOC_CONF=prof:true,prof_active:false
+
 script
   . /etc/default/hhvm
   # HHVM clears its PID file on exit. We need it in the post-stop

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I74c8f3376a7e1e495ea68815bf36a0b1cbc4c7c2
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Tim Starling tstarl...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Move autoValue logic from ui.MWParameterPage to dm.MWParamet... - change (mediawiki...VisualEditor)

2014-10-26 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: Move autoValue logic from ui.MWParameterPage to 
dm.MWParameterModel
..

Move autoValue logic from ui.MWParameterPage to dm.MWParameterModel

Also add missing MWParameterModel#getDefaultValue

Bug: 72404
Change-Id: I4bb117d419f3845f44e321f848e95bb246a24e24
---
M modules/ve-mw/dm/models/ve.dm.MWParameterModel.js
M modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js
2 files changed, 22 insertions(+), 7 deletions(-)


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

diff --git a/modules/ve-mw/dm/models/ve.dm.MWParameterModel.js 
b/modules/ve-mw/dm/models/ve.dm.MWParameterModel.js
index 270a0ee..00aeb0e 100644
--- a/modules/ve-mw/dm/models/ve.dm.MWParameterModel.js
+++ b/modules/ve-mw/dm/models/ve.dm.MWParameterModel.js
@@ -110,10 +110,29 @@
 /**
  * Get parameter value.
  *
- * @returns {string} Parameter value
+ * @returns {string} Parameter value, or automatic value if there is none 
stored.
+ *  Otherwise an empty string.
  */
 ve.dm.MWParameterModel.prototype.getValue = function () {
-   return this.value;
+   return this.value || this.getAutoValue() || '';
+};
+
+/**
+ * Get default parameter value.
+ *
+ * @returns {string} Default parameter value
+ */
+ve.dm.MWParameterModel.prototype.getDefaultValue = function () {
+   return this.template.getSpec().getParameterDefaultValue( this.name );
+};
+
+/**
+ * Get automatic parameter value.
+ *
+ * @returns {string} Automatic parameter name.
+ */
+ve.dm.MWParameterModel.prototype.getAutoValue = function () {
+   return this.template.getSpec().getParameterAutoValue( this.name );
 };
 
 /**
diff --git a/modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js 
b/modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js
index 8aa5ae6..9b1ad5d 100644
--- a/modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js
+++ b/modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js
@@ -30,11 +30,7 @@
// Properties
this.parameter = parameter;
this.spec = parameter.getTemplate().getSpec();
-   this.defaultValue = this.spec.getParameterDefaultValue( paramName );
-   this.autoValue = this.spec.getParameterAutoValue( paramName );
-   if ( this.autoValue  !this.parameter.getValue() ) {
-   this.parameter.setValue( this.autoValue );
-   }
+   this.defaultValue = parameter.getDefaultValue();
 
this.$info = this.$( 'div' );
this.$actions = this.$( 'div' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4bb117d419f3845f44e321f848e95bb246a24e24
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk kren...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Bug 72523: Remove #wikimedia-growth - change (labs...grrrit)

2014-10-26 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Bug 72523: Remove #wikimedia-growth
..

Bug 72523: Remove #wikimedia-growth

Change-Id: If45fd8e5d818316a2ea11eccde9b01d6b705c586
---
M config.yaml
1 file changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/grrrit 
refs/changes/27/168927/1

diff --git a/config.yaml b/config.yaml
index bda681b..145007f 100644
--- a/config.yaml
+++ b/config.yaml
@@ -125,10 +125,6 @@
 mediawiki/extensions/ValueView,
 mediawiki/extensions/Capiunto
 }
-#wikimedia-growth: {
-mediawiki/extensions/GuidedTour,
-mediawiki/extensions/GettingStarted
-}
 #wikimedia-multimedia: {
 mediawiki/extensions/CommonsMetadata.*,
 mediawiki/extensions/MultimediaViewer.*,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If45fd8e5d818316a2ea11eccde9b01d6b705c586
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/grrrit
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Pywikipedia Conversion Bot valhall...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Bug 72523: Remove #wikimedia-growth - change (labs...grrrit)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Bug 72523: Remove #wikimedia-growth
..


Bug 72523: Remove #wikimedia-growth

Change-Id: If45fd8e5d818316a2ea11eccde9b01d6b705c586
---
M config.yaml
1 file changed, 0 insertions(+), 4 deletions(-)

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



diff --git a/config.yaml b/config.yaml
index bda681b..145007f 100644
--- a/config.yaml
+++ b/config.yaml
@@ -125,10 +125,6 @@
 mediawiki/extensions/ValueView,
 mediawiki/extensions/Capiunto
 }
-#wikimedia-growth: {
-mediawiki/extensions/GuidedTour,
-mediawiki/extensions/GettingStarted
-}
 #wikimedia-multimedia: {
 mediawiki/extensions/CommonsMetadata.*,
 mediawiki/extensions/MultimediaViewer.*,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If45fd8e5d818316a2ea11eccde9b01d6b705c586
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/grrrit
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Fix GlobalRenameRequest::setNewName() checking the wrong value - change (mediawiki...CentralAuth)

2014-10-26 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Fix GlobalRenameRequest::setNewName() checking the wrong value
..

Fix GlobalRenameRequest::setNewName() checking the wrong value

Spotted in CR by Krenair

Change-Id: Ibbbefed83b2d15b52d94151631ba742a942da9d9
---
M includes/GlobalRename/GlobalRenameRequest.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/GlobalRename/GlobalRenameRequest.php 
b/includes/GlobalRename/GlobalRenameRequest.php
index b839a4c..c18ee05 100644
--- a/includes/GlobalRename/GlobalRenameRequest.php
+++ b/includes/GlobalRename/GlobalRenameRequest.php
@@ -145,7 +145,7 @@
 */
public function setNewName( $newName ) {
$newName = User::getCanonicalName( $newName, 'creatable' );
-   if ( $this-newName === false ) {
+   if ( $newName === false ) {
throw new MWException( Invalid username '{$newName}' 
);
}
$this-newName = $newName;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibbbefed83b2d15b52d94151631ba742a942da9d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com

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


[MediaWiki-commits] [Gerrit] Increase wgQueryCacheLimit for enwiki and dewiki. - change (operations/mediawiki-config)

2014-10-26 Thread Springle (Code Review)
Springle has uploaded a new change for review.

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

Change subject: Increase wgQueryCacheLimit for enwiki and dewiki.
..

Increase wgQueryCacheLimit for enwiki and dewiki.

Bug: 44321
Change-Id: I25181c1b48df40e78c09bf7935047f027654f4ed
---
M wmf-config/InitialiseSettings.php
1 file changed, 0 insertions(+), 2 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 11c8248..b5515e3 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -1220,8 +1220,6 @@
 
 'wgQueryCacheLimit' = array(
'default' = 5000,
-   'enwiki' = 3000, // safe to raise?
-   'dewiki' = 4000, // safe to raise?
 ),
 
 'wgArticlePath' = array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25181c1b48df40e78c09bf7935047f027654f4ed
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Springle sprin...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix GlobalRenameRequest::setNewName() checking the wrong value - change (mediawiki...CentralAuth)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix GlobalRenameRequest::setNewName() checking the wrong value
..


Fix GlobalRenameRequest::setNewName() checking the wrong value

Spotted in CR by Krenair

Change-Id: Ibbbefed83b2d15b52d94151631ba742a942da9d9
---
M includes/GlobalRename/GlobalRenameRequest.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/GlobalRename/GlobalRenameRequest.php 
b/includes/GlobalRename/GlobalRenameRequest.php
index b839a4c..c18ee05 100644
--- a/includes/GlobalRename/GlobalRenameRequest.php
+++ b/includes/GlobalRename/GlobalRenameRequest.php
@@ -145,7 +145,7 @@
 */
public function setNewName( $newName ) {
$newName = User::getCanonicalName( $newName, 'creatable' );
-   if ( $this-newName === false ) {
+   if ( $newName === false ) {
throw new MWException( Invalid username '{$newName}' 
);
}
$this-newName = $newName;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibbbefed83b2d15b52d94151631ba742a942da9d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Alex Monk kren...@wikimedia.org
Gerrit-Reviewer: BryanDavis bda...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] [WIP] Enable profiling via xhprof - change (mediawiki/core)

2014-10-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: [WIP] Enable profiling via xhprof
..

[WIP] Enable profiling via xhprof

Add a helper class to assist in collecting profiling information using
XHProf https://github.com/phacility/xhprof and a Profiler
implementation to hook it into the existing MediaWiki profiling system.

Bug: T759
Change-Id: I16a75cb7636cb5dcef3830d738b2dcd2047d0aaa
---
M includes/AutoLoader.php
A includes/libs/Xhprof.php
A includes/profiler/ProfilerXhprof.php
3 files changed, 369 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/30/168930/1

diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php
index 99b2d84..c6a915f 100644
--- a/includes/AutoLoader.php
+++ b/includes/AutoLoader.php
@@ -695,6 +695,7 @@
'SwiftVirtualRESTService' = 
'includes/libs/virtualrest/SwiftVirtualRESTService.php',
'VirtualRESTService' = 
'includes/libs/virtualrest/VirtualRESTService.php',
'VirtualRESTServiceClient' = 
'includes/libs/virtualrest/VirtualRESTServiceClient.php',
+   'Xhprof' = 'includes/libs/Xhprof.php',
'XmlTypeCheck' = 'includes/libs/XmlTypeCheck.php',
 
# includes/libs/lessphp
@@ -873,6 +874,7 @@
'ProfilerStandard' = 'includes/profiler/ProfilerStandard.php',
'ProfilerStub' = 'includes/profiler/ProfilerStub.php',
'ProfileSection' = 'includes/profiler/Profiler.php',
+   'ProfilerXhprof' = 'includes/profiler/ProfilerXhprof.php',
'TransactionProfiler' = 'includes/profiler/Profiler.php',
 
# includes/rcfeed
diff --git a/includes/libs/Xhprof.php b/includes/libs/Xhprof.php
new file mode 100644
index 000..0e4bf48
--- /dev/null
+++ b/includes/libs/Xhprof.php
@@ -0,0 +1,261 @@
+?php
+/**
+ * @section LICENSE
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * Convience class for working with XHProf
+ * https://github.com/phacility/xhprof. XHProf can be installed as a PECL
+ * package for use with PHP5 (Zend PHP) and is built-in to HHVM 3.3.0.
+ *
+ * @author Bryan Davis bd...@wikimedia.org
+ * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
+ * @since 1.25
+ */
+class Xhprof {
+
+   /**
+* @var string
+*/
+   const TYPE_DEFAULT = 'default';
+
+   /**
+* @var string
+*/
+   const TYPE_SAMPLE = 'sample';
+
+   /**
+* @var array $config
+*/
+   protected $config;
+
+   /**
+* Hierarchical profilind data returned by xhprof.
+* @var array $hieraData
+*/
+   protected $hieraData;
+
+   /**
+* Per-function inclusive data.
+* @var array $inclusive
+*/
+   protected $inclusive;
+
+   /**
+* Per-function inclusive and exclusive data.
+*/
+   protected $complete;
+
+   /**
+* Configuration data can contain:
+* - 'type': Type of data to collect.
+*   (self::TYPE_DEFAULT or self::TYPE_SAMPLE)
+* - 'flags': Optional flags to add additional information to the
+*profiling. (XHPROF_FLAGS_NO_BUILTINS, XHPROF_FLAGS_CPU,
+*XHPROF_FLAGS_MEMORY)
+* - 'exclude': Array of function names to exclude from profiling.
+* - 'include': Array of function names to include in profiling.
+* - 'sort': Key to sort per-function reports on.
+*
+* @param array $config
+*/
+   public function __construct( array $config = array() ) {
+   $this-config = array_merge(
+   array(
+   'type' = self::TYPE_DEFAULT,
+   'flags' = 0,
+   'exclude' = array(),
+   'include' = null,
+   'sort' = 'wt',
+   ),
+   $config
+   );
+
+   if ( $this-config['type'] === self::TYPE_DEFAULT ) {
+   xhprof_enable( $this-config['flags'], array(
+   'ignored_functions' = 

[MediaWiki-commits] [Gerrit] hash_equals(): Avoid division by zero when $known_string is ... - change (mediawiki/core)

2014-10-26 Thread PleaseStand (Code Review)
PleaseStand has uploaded a new change for review.

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

Change subject: hash_equals(): Avoid division by zero when $known_string is 
empty
..

hash_equals(): Avoid division by zero when $known_string is empty

Per Tim Starling's review of Icb239471, reverted back to the version of
the function from Patch Set 1 of Iece006ec, which did not have the bug.
This version does not attempt to minimize the inevitable leakage of the
string's length.

Also revised the doc comment to explain more effectively what the problem
with a normal (===) string comparison is for the use cases of this function.

Follows-up b9e1d5f5c066.

Change-Id: I1b347e69b39af3d7d8ba6673af63f1a616befbdf
(cherry picked from commit 4620e3b862568d76661e86857779795f4f974e13)
---
M includes/GlobalFunctions.php
1 file changed, 24 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/31/168931/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 490df24..27f7cac 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -102,19 +102,30 @@
 }
 
 // hash_equals function only exists in PHP = 5.6.0
+// http://php.net/hash_equals
 if ( !function_exists( 'hash_equals' ) ) {
/**
-* Check whether a user-provided string is equal to a fixed-length 
secret without
-* revealing bytes of the secret through timing differences.
+* Check whether a user-provided string is equal to a fixed-length 
secret string
+* without revealing bytes of the secret string through timing 
differences.
 *
-* This timing guarantee -- that a partial match takes the same time as 
a complete
-* mismatch -- is why this function is used in some security-sensitive 
parts of the code.
-* For example, it shouldn't be possible to guess an HMAC signature one 
byte at a time.
+* The usual way to compare strings (PHP's === operator or the 
underlying memcmp()
+* function in C) is to compare corresponding bytes and stop at the 
first difference,
+* which would take longer for a partial match than for a complete 
mismatch. This
+* is not secure when one of the strings (e.g. an HMAC or token) must 
remain secret
+* and the other may come from an attacker. Statistical analysis of 
timing measurements
+* over many requests may allow the attacker to guess the string's 
bytes one at a time
+* (and check his guesses) even if the timing differences are extremely 
small.
+*
+* When making such a security-sensitive comparison, it is essential 
that the sequence
+* in which instructions are executed and memory locations are accessed 
not depend on
+* the secret string's value. HOWEVER, for simplicity, we do not 
attempt to minimize
+* the inevitable leakage of the string's length. That is generally 
known anyway as
+* a chararacteristic of the hash function used to compute the secret 
value.
 *
 * Longer explanation: http://www.emerose.com/timing-attacks-explained
 *
 * @codeCoverageIgnore
-* @param string $known_string Fixed-length secret to compare against
+* @param string $known_string Fixed-length secret string to compare 
against
 * @param string $user_string User-provided string
 * @return bool True if the strings are the same, false otherwise
 */
@@ -134,14 +145,14 @@
return false;
}
 
-   // Note that we do one thing PHP doesn't: try to avoid leaking 
information about
-   // relative lengths of $known_string and $user_string, and of 
multiple $known_strings.
-   // However, lengths may still inevitably leak through, for 
example, CPU cache misses.
$known_string_len = strlen( $known_string );
-   $user_string_len = strlen( $user_string );
-   $result = $known_string_len ^ $user_string_len;
-   for ( $i = 0; $i  $user_string_len; $i++ ) {
-   $result |= ord( $known_string[$i % $known_string_len] ) 
^ ord( $user_string[$i] );
+   if ( $known_string_len !== strlen( $user_string ) ) {
+   return false;
+   }
+
+   $result = 0;
+   for ( $i = 0; $i  $known_string_len; $i++ ) {
+   $result |= ord( $known_string[$i] ) ^ ord( 
$user_string[$i] );
}
 
return ( $result === 0 );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b347e69b39af3d7d8ba6673af63f1a616befbdf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_24
Gerrit-Owner: PleaseStand 

[MediaWiki-commits] [Gerrit] Improve squidline regex - change (wikimedia...DjangoBannerStats)

2014-10-26 Thread AndyRussG (Code Review)
AndyRussG has uploaded a new change for review.

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

Change subject: Improve squidline regex
..

Improve squidline regex

Use \t as a field separator and [^\t] for most content.

Change-Id: I2fa535791c1706506810782947f538061122b76e
---
M fundraiser/analytics/regex.py
1 file changed, 27 insertions(+), 27 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools/DjangoBannerStats 
refs/changes/32/168932/1

diff --git a/fundraiser/analytics/regex.py b/fundraiser/analytics/regex.py
index 5a0fca3..3dc4e7c 100644
--- a/fundraiser/analytics/regex.py
+++ b/fundraiser/analytics/regex.py
@@ -4,36 +4,36 @@
 squidline = re.compile(
 r
 ^(?Psquid[\S]+) # Name of the squid server
-\s[-]*
+\t[-]*
 (?Psequence[0-9]+) # Sequence ID from the squid server
-\s
+\t
 (?Ptimestamp[0-9-]+T[0-9:.]+) # Timestamp
-\s
+\t
 (?Pservicetime[0-9.]+) # Request service time
-\s
-(?Pclient[\S]+) # Client IP address
-\s
-(?Psquidstatus[\S]+) # Squid request status and HTTP status code
-\s
-(?Preply[0-9|-]+) # Reply size including HTTP headers
-\s
-(?Prequest[\S]+) # Request type
-\s
-(?Purl[\S]+) # Request URL
-\s
-(?Psquidhierarchy[\S]+) # Squid hierarchy status, peer IP
-\s
-(?Pmime[\S]+) # MIME content type
-\s
-(?Preferrer[\S]+) # Referer header
-\s
-(?Pxff[\S]+)? # X-Forwarded-For header
-\s
-(?Puseragent[\S\s]+) # User-Agent header
-\s
-(?Pacceptlanguage[\S\s]+) # Accept-Language header
-\s
-(?Pxcarrier[\S\s]+)$ # X-carrier header
+\t
+(?Pclient[^\t]+) # Client IP address
+\t
+(?Psquidstatus[^\t]+) # Squid request status and HTTP status code
+\t
+(?Preply[0-9-]+) # Reply size including HTTP headers
+\t
+(?Prequest[^\t]+) # Request type
+\t
+(?Purl[^\t]+) # Request URL
+\t
+(?Psquidhierarchy[^\t]+) # Squid hierarchy status, peer IP
+\t
+(?Pmime[^\t]+) # MIME content type
+\t
+(?Preferrer[^\t]+) # Referer header
+\t
+(?Pxff[^\t]+)? # X-Forwarded-For header
+\t
+(?Puseragent[^\t]+) # User-Agent header
+\t
+(?Pacceptlanguage[^\t]+) # Accept-Language header
+\t
+(?Pxcarrier[^\t]+)$ # X-carrier header
 , re.VERBOSE
 )
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fa535791c1706506810782947f538061122b76e
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools/DjangoBannerStats
Gerrit-Branch: master
Gerrit-Owner: AndyRussG andrew.green...@gmail.com

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


[MediaWiki-commits] [Gerrit] Increase updatequerypages frequency to twice per month for a... - change (operations/puppet)

2014-10-26 Thread Springle (Code Review)
Springle has uploaded a new change for review.

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

Change subject: Increase updatequerypages frequency to twice per month for all 
wikis.
..

Increase updatequerypages frequency to twice per month for all wikis.

This does not increase updatequerypages::enwiki frequency. With every
shard has a 'vslow' slave we should probably look into that too.

Related to bug 46098 and bug 46094, but not a direct fix.

Change-Id: I7c88eb31b2837d152e0edc4b1358816c5b3d7b01
---
M manifests/misc/maintenance.pp
1 file changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/33/168933/1

diff --git a/manifests/misc/maintenance.pp b/manifests/misc/maintenance.pp
index a7d0809..70b90a0 100644
--- a/manifests/misc/maintenance.pp
+++ b/manifests/misc/maintenance.pp
@@ -281,32 +281,32 @@
 
 cron { cron-updatequerypages-ancientpages-${name}:
 command  = /usr/local/bin/mwscriptwikiset 
updateSpecialPages.php ${db_cluster}.dblist --override --only=Ancientpages  
/var/log/mediawiki/updateSpecialPages/${name}-AncientPages.log 21,
-monthday = 11,
+monthday = [8, 22],
 }
 
 cron { cron-updatequerypages-deadendpages-${name}:
 command  = /usr/local/bin/mwscriptwikiset 
updateSpecialPages.php ${db_cluster}.dblist --override --only=Deadendpages  
/var/log/mediawiki/updateSpecialPages/${name}-DeadendPages.log 21,
-monthday = 12,
+monthday = [9, 23],
 }
 
 cron { cron-updatequerypages-mostlinked-${name}:
 command  = /usr/local/bin/mwscriptwikiset 
updateSpecialPages.php ${db_cluster}.dblist --override --only=Mostlinked  
/var/log/mediawiki/updateSpecialPages/${name}-MostLinked.log 21,
-monthday = 13,
+monthday = [10, 24],
 }
 
 cron { cron-updatequerypages-mostrevisions-${name}:
 command  = /usr/local/bin/mwscriptwikiset 
updateSpecialPages.php ${db_cluster}.dblist --override --only=Mostrevisions  
/var/log/mediawiki/updateSpecialPages/${name}-MostRevisions.log 21,
-monthday = 14,
+monthday = [11, 25],
 }
 
 cron { cron-updatequerypages-wantedpages-${name}:
 command  = /usr/local/bin/mwscriptwikiset 
updateSpecialPages.php ${db_cluster}.dblist --override --only=Wantedpages  
/var/log/mediawiki/updateSpecialPages/${name}-WantedPages.log 21,
-monthday = 15,
+monthday = [12, 26],
 }
 
 cron { cron-updatequerypages-fewestrevisions-${name}:
 command  = /usr/local/bin/mwscriptwikiset 
updateSpecialPages.php ${db_cluster}.dblist --override --only=Fewestrevisions  
/var/log/mediawiki/updateSpecialPages/${name}-FewestRevisions.log 21,
-monthday = 16,
+monthday = [13, 27],
 }
 }
 
@@ -323,37 +323,37 @@
 cron { 'cron-updatequerypages-lonelypages-s1':
 command  = /usr/local/bin/mwscriptwikiset 
updateSpecialPages.php s1.dblist --override --only=Lonelypages  
/var/log/mediawiki/updateSpecialPages/${name}-LonelyPages.log 21,
 month= [1, 7],
-monthday = 18,
+monthday = 28,
 }
 
 cron { 'cron-updatequerypages-mostcategories-s1':
 command  = /usr/local/bin/mwscriptwikiset 
updateSpecialPages.php s1.dblist --override --only=Mostcategories  
/var/log/mediawiki/updateSpecialPages/${name}-MostCategories.log 21,
 month= [2, 8],
-monthday = 19,
+monthday = 28,
 }
 
 cron { 'cron-updatequerypages-mostlinkedcategories-s1':
 command  = /usr/local/bin/mwscriptwikiset 
updateSpecialPages.php s1.dblist --override --only=Mostlinkedcategories  
/var/log/mediawiki/updateSpecialPages/${name}-MostLinkedCategories.log 21,
 month= [3, 9],
-monthday = 20,
+monthday = 28,
 }
 
 cron { 'cron-updatequerypages-mostlinkedtemplates-s1':
 command  = /usr/local/bin/mwscriptwikiset 
updateSpecialPages.php s1.dblist --override --only=Mostlinkedtemplates  
/var/log/mediawiki/updateSpecialPages/${name}-MostLinkedTemplates.log 21,
 month= [4, 10],
-monthday = 21,
+monthday = 28,
 }
 
 cron { 'cron-updatequerypages-uncategorizedcategories-s1':
 command  = /usr/local/bin/mwscriptwikiset 
updateSpecialPages.php s1.dblist --override --only=Uncategorizedcategories  

[MediaWiki-commits] [Gerrit] Re-weigh groups now that core-0-mostused does not exist - change (mediawiki...Translate)

2014-10-26 Thread Siebrand (Code Review)
Siebrand has submitted this change and it was merged.

Change subject: Re-weigh groups now that core-0-mostused does not exist
..


Re-weigh groups now that core-0-mostused does not exist

Change-Id: I719ca1fdb8bb73e52a6749e438e5f807cb85afae
---
M scripts/groupStatistics.php
1 file changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  Siebrand: Verified; Looks good to me, approved



diff --git a/scripts/groupStatistics.php b/scripts/groupStatistics.php
index 5fd4df7..d4f560a 100644
--- a/scripts/groupStatistics.php
+++ b/scripts/groupStatistics.php
@@ -101,19 +101,19 @@
 */
public $localisedWeights = array(
'wikimedia' = array(
-   'core-0-mostused' = 40,
-   'core' = 30,
-   'ext-0-wikimedia' = 30
+   //'core-0-mostused' = 40,
+   'core' = 50,
+   'ext-0-wikimedia' = 50
),
'fundraiser' = array(
'ext-di-di' = 16,
'ext-di-pfpg' = 84,
),
'mediawiki' = array(
-   'core-0-mostused' = 30,
-   'core' = 30,
-   'ext-0-wikimedia' = 20,
-   'ext-0-all' = 20
+   //'core-0-mostused' = 30,
+   'core' = 50,
+   'ext-0-wikimedia' = 25,
+   'ext-0-all' = 25
)
);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I719ca1fdb8bb73e52a6749e438e5f807cb85afae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Siebrand siebr...@kitano.nl

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


[MediaWiki-commits] [Gerrit] Mark list=mmsites as an internal module - change (mediawiki...MassMessage)

2014-10-26 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Mark list=mmsites as an internal module
..

Mark list=mmsites as an internal module

Change-Id: I3ea9bc85b4e728f4c4298e82f3a17654e4420312
---
M includes/ApiQueryMMSites.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage 
refs/changes/34/168934/1

diff --git a/includes/ApiQueryMMSites.php b/includes/ApiQueryMMSites.php
index 5b6851a..4842ffb 100644
--- a/includes/ApiQueryMMSites.php
+++ b/includes/ApiQueryMMSites.php
@@ -46,9 +46,12 @@
);
}
 
+   public function isInternal() {
+   return true;
+   }
+
public function getDescription() {
-   return 'Serve autocomplete requests for the site field in 
MassMessage; '
-   . 'not intended for use elsewhere.';
+   return 'Serve autocomplete requests for the site field in 
MassMessage';
}
 
public function getExamples() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ea9bc85b4e728f4c4298e82f3a17654e4420312
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com

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


[MediaWiki-commits] [Gerrit] ApiFormatBase: Remove anonymous functions for PHP 5.2 compat... - change (mediawiki/core)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: ApiFormatBase: Remove anonymous functions for PHP 5.2 
compatibility
..


ApiFormatBase: Remove anonymous functions for PHP 5.2 compatibility

MediaWiki 1.19 is supposed to work with PHP 5.2; however, the fix
for bug 61362 (HTML formatter for debug output from API allows HTML
injection) added anonymous functions, which are a feature introduced
in PHP 5.3.

Follows-up 7bcbd0c635ef, which was released as part of 1.19.13.

Bug: 63049
Co-Authored-By: Kevin Israel pleasest...@live.com
Change-Id: I1641646a61700741ab9b85d16c02fad66ab2cb65
---
M RELEASE-NOTES-1.19
M includes/api/ApiFormatBase.php
2 files changed, 18 insertions(+), 10 deletions(-)

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



diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19
index 3935abd..7cd33a7 100644
--- a/RELEASE-NOTES-1.19
+++ b/RELEASE-NOTES-1.19
@@ -14,6 +14,8 @@
   System administrators are encouraged to upgrade to this release or 1.22+
   and produce a full data dump.
   https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Backing_up_a_wiki
+* (bug 63049) Removed anonymous functions from ApiFormatBase, added in
+  1.19.13 as part of the fix for bug 61362, for PHP 5.2 compatibility.
 
 == MediaWiki 1.19.20 ==
 
diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php
index 785fcd2..691c38f 100644
--- a/includes/api/ApiFormatBase.php
+++ b/includes/api/ApiFormatBase.php
@@ -33,6 +33,7 @@
 
private $mIsHtml, $mFormat, $mUnescapeAmps, $mHelp, $mCleared;
private $mBufferResult = false, $mBuffer, $mDisabled = false;
+   private $mMasked;
 
/**
 * Constructor
@@ -275,12 +276,8 @@
}
 
// Armor links (bug 61362)
-   $masked = array();
-   $text = preg_replace_callback( '#a .*?/a#', function ( 
$matches ) use ( $masked ) {
-   $sha = sha1( $matches[0] );
-   $masked[$sha] = $matches[0];
-   return $sha;
-   }, $text );
+   $this-mMasked = array();
+   $text = preg_replace_callback( '#a .*?/a#', array( $this, 
'armorLinkCallback' ), $text );
 
// identify URLs
$protos = wfUrlProtocolsWithoutProtRel();
@@ -288,10 +285,8 @@
$text = preg_replace( #(($protos).*?)(quot;)?([ 
\\'\\n]|lt;|gt;|quot;)#, 'a href=\\1\\1/a\\3\\4', $text );
 
// Unarmor links
-   $text = preg_replace_callback( '#([0-9a-f]{40})#', function ( 
$matches ) use ( $masked ) {
-   $sha = $matches[1];
-   return isset( $masked[$sha] ) ? $masked[$sha] : 
$matches[0];
-   }, $text );
+   $text = preg_replace_callback( '#([0-9a-f]{40})#', array( 
$this, 'unarmorLinkCallback' ), $text );
+   $this-mMasked = null;
 
/**
 * Temporary fix for bad links in help messages. As a special 
case,
@@ -306,6 +301,17 @@
return $text;
}
 
+   private function armorLinkCallback( $matches ) {
+   $sha = sha1( $matches[0] );
+   $this-mMasked[$sha] = $matches[0];
+   return $sha;
+   }
+
+   private function unarmorLinkCallback( $matches ) {
+   $sha = $matches[1];
+   return isset( $this-mMasked[$sha] ) ? $this-mMasked[$sha] : 
$matches[0];
+   }
+
public function getExamples() {
return array(

'api.php?action=querymeta=siteinfosiprop=namespacesformat=' . 
$this-getModuleName()

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1641646a61700741ab9b85d16c02fad66ab2cb65
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_19
Gerrit-Owner: Kishanio thobhanikis...@gmail.com
Gerrit-Reviewer: Anomie bjor...@wikimedia.org
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: PleaseStand pleasest...@live.com
Gerrit-Reviewer: Reedy re...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Mark list=mmsites as an internal module - change (mediawiki...MassMessage)

2014-10-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Mark list=mmsites as an internal module
..


Mark list=mmsites as an internal module

Change-Id: I3ea9bc85b4e728f4c4298e82f3a17654e4420312
---
M includes/ApiQueryMMSites.php
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/includes/ApiQueryMMSites.php b/includes/ApiQueryMMSites.php
index 5b6851a..4842ffb 100644
--- a/includes/ApiQueryMMSites.php
+++ b/includes/ApiQueryMMSites.php
@@ -46,9 +46,12 @@
);
}
 
+   public function isInternal() {
+   return true;
+   }
+
public function getDescription() {
-   return 'Serve autocomplete requests for the site field in 
MassMessage; '
-   . 'not intended for use elsewhere.';
+   return 'Serve autocomplete requests for the site field in 
MassMessage';
}
 
public function getExamples() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3ea9bc85b4e728f4c4298e82f3a17654e4420312
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Wctaiwan wctai...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] logstash: hadoop: extract and infer job, task, attempt IDs - change (operations/puppet)

2014-10-26 Thread Gage (Code Review)
Gage has uploaded a new change for review.

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

Change subject: logstash: hadoop: extract and infer job, task, attempt IDs
..

logstash: hadoop: extract and infer job, task, attempt IDs

Change-Id: I5fd74143384e7346bde36d6584d07a5db511bdab
---
M files/logstash/filter-gelf.conf
1 file changed, 19 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/35/168935/1

diff --git a/files/logstash/filter-gelf.conf b/files/logstash/filter-gelf.conf
index 40499eb..7e15f87 100644
--- a/files/logstash/filter-gelf.conf
+++ b/files/logstash/filter-gelf.conf
@@ -5,6 +5,8 @@
 replace = [ channel, %{SourceSimpleClassName} ]
   }
   grok {
+# Oniguruma syntax for ‘named capture’: (?field_namethe pattern here)
+# this overwrites the Thread field with a shorter more generic 
version, saving details to separate fields
 match = [ Thread, (?ThreadIPC Server handler) 
%{NUMBER:IPC_Server_handler_id} on %{NUMBER:IPC_Server_handler_port} ]
 match = [ Thread, (?ThreadDeletionService) 
#%{NUMBER:DeletionService_id} ]
 match = [ Thread, (?ThreadLocalizerRunner) for 
%{NOTSPACE:ContainerId} ]
@@ -13,6 +15,23 @@
 match = [ Thread, 
(?ThreadCacheReplicationMonitor)\(%{NUMBER:CacheReplicationMonitor_id}\) ]
 overwrite = [ Thread ]
   }
+  grok {
+# so that we can search by job id and find tasks and attempts:
+# extract attempt ID to field
+# attempt_1409078537822_52431_m_09_1
+# attempt_1409078537822_55176_r_00_0
+match = [ message, 
.*attempt_(?Attempt_id[:digit:]+_[:digit:]+_[mr]_[:digit:]+_[:digit:]+).* ]
+# extract task ID to field
+# task_1409078537822_52431_m_44
+match = [ message,   
.*task_(?Task_id[:digit:]+_[:digit:]+_[mr]_[:digit:]+).* ]
+# extract job ID to field
+# job_1409078537822_52431
+match = [ message, 
.*job_(?Job_id[:digit:]+_[:digit:]+.* ]
+# infer task ID from attempt ID
+match = [ Attempt_id,   
(?Task_id[:digit:]+_[:digit:]+_[mr]_[:digit:]+)_[:digit:]+ ]
+# infer job ID from task ID
+match = [ Task_id,   
(?Job_id[:digit:]+_[:digit:]+)_[mr]_[:digit:]+ ]
+  }
   dns {
 reverse = [ host ]
 action  = replace

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fd74143384e7346bde36d6584d07a5db511bdab
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gage jger...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] logstash: hadoop: extract and infer job, task, attempt IDs - change (operations/puppet)

2014-10-26 Thread Gage (Code Review)
Gage has submitted this change and it was merged.

Change subject: logstash: hadoop: extract and infer job, task, attempt IDs
..


logstash: hadoop: extract and infer job, task, attempt IDs

Change-Id: I5fd74143384e7346bde36d6584d07a5db511bdab
---
M files/logstash/filter-gelf.conf
1 file changed, 19 insertions(+), 0 deletions(-)

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



diff --git a/files/logstash/filter-gelf.conf b/files/logstash/filter-gelf.conf
index 40499eb..7e15f87 100644
--- a/files/logstash/filter-gelf.conf
+++ b/files/logstash/filter-gelf.conf
@@ -5,6 +5,8 @@
 replace = [ channel, %{SourceSimpleClassName} ]
   }
   grok {
+# Oniguruma syntax for ‘named capture’: (?field_namethe pattern here)
+# this overwrites the Thread field with a shorter more generic 
version, saving details to separate fields
 match = [ Thread, (?ThreadIPC Server handler) 
%{NUMBER:IPC_Server_handler_id} on %{NUMBER:IPC_Server_handler_port} ]
 match = [ Thread, (?ThreadDeletionService) 
#%{NUMBER:DeletionService_id} ]
 match = [ Thread, (?ThreadLocalizerRunner) for 
%{NOTSPACE:ContainerId} ]
@@ -13,6 +15,23 @@
 match = [ Thread, 
(?ThreadCacheReplicationMonitor)\(%{NUMBER:CacheReplicationMonitor_id}\) ]
 overwrite = [ Thread ]
   }
+  grok {
+# so that we can search by job id and find tasks and attempts:
+# extract attempt ID to field
+# attempt_1409078537822_52431_m_09_1
+# attempt_1409078537822_55176_r_00_0
+match = [ message, 
.*attempt_(?Attempt_id[:digit:]+_[:digit:]+_[mr]_[:digit:]+_[:digit:]+).* ]
+# extract task ID to field
+# task_1409078537822_52431_m_44
+match = [ message,   
.*task_(?Task_id[:digit:]+_[:digit:]+_[mr]_[:digit:]+).* ]
+# extract job ID to field
+# job_1409078537822_52431
+match = [ message, 
.*job_(?Job_id[:digit:]+_[:digit:]+.* ]
+# infer task ID from attempt ID
+match = [ Attempt_id,   
(?Task_id[:digit:]+_[:digit:]+_[mr]_[:digit:]+)_[:digit:]+ ]
+# infer job ID from task ID
+match = [ Task_id,   
(?Job_id[:digit:]+_[:digit:]+)_[mr]_[:digit:]+ ]
+  }
   dns {
 reverse = [ host ]
 action  = replace

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5fd74143384e7346bde36d6584d07a5db511bdab
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gage jger...@wikimedia.org
Gerrit-Reviewer: Gage jger...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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