[MediaWiki-commits] [Gerrit] Update jquery.ime from upstream - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

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


Change subject: Update jquery.ime from upstream
..

Update jquery.ime from upstream

Version 0.1.0.20130522

Changes:
* Correct the versioning by adding build date metadata
* Remove an unwanted css style
* Avoid screen jump on click of IME menu items
* AltGr+M doesn't create a µ
* Code cleanup

Change-Id: Ia9ccd89a24f4d8627cf3a16f59984ad79f3d49f5
---
M lib/jquery.ime/jquery.ime.js
1 file changed, 83 insertions(+), 63 deletions(-)


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

diff --git a/lib/jquery.ime/jquery.ime.js b/lib/jquery.ime/jquery.ime.js
index d1cb7d6..c09bd54 100644
--- a/lib/jquery.ime/jquery.ime.js
+++ b/lib/jquery.ime/jquery.ime.js
@@ -1,4 +1,4 @@
-/*! jquery.ime - v0.1.0 - 2013-05-17
+/*! jquery.ime - v0.1.0+20130522
 * https://github.com/wikimedia/jquery.ime
 * Copyright (c) 2013 Santhosh Thottingal; Licensed GPL, MIT */
 ( function ( $ ) {
@@ -483,6 +483,8 @@
 ( function ( $ ) {
'use strict';
 
+   var selectorTemplate, MutationObserver;
+
function IMESelector ( element, options ) {
this.$element = $( element );
this.options = $.extend( {}, IMESelector.defaults, options );
@@ -544,7 +546,7 @@
'marginTop': '-20px'
}, 500, function () {
imeselector.$imeSetting.hide();
-   // Restore properties for next 
time it becomes visible:
+   // Restore properties for the 
next time it becomes visible:
imeselector.$imeSetting.css( 
'opacity', 1 );
imeselector.$imeSetting.css( 
'margin-top', 0 );
} );
@@ -563,12 +565,14 @@
this.$menu.addClass( 'open' );
this.stopTimer();
this.$imeSetting.show();
+
return false;
},
 
hide: function () {
this.$menu.removeClass( 'open' );
this.resetTimer();
+
return false;
},
 
@@ -588,9 +592,11 @@
 
imeselector.$imeSetting.on( 'click.ime', function ( e ) 
{
var t = $( e.target );
+
if ( t.hasClass( 'imeselector-toggle' ) ) {
imeselector.toggle();
}
+   return false;
} );
 
imeselector.$element.on( 'blur.ime', function () {
@@ -601,7 +607,8 @@
} );
 
imeselector.$imeSetting.mouseenter( function () {
-   // We don't want the selector to disappear 
while the user is trying to click it
+   // We don't want the selector to disappear
+   // while the user is trying to click it
imeselector.stopTimer();
imeselector.$imeSetting.addClass( 'onfocus' );
} ).mouseleave( function () {
@@ -611,23 +618,22 @@
 
imeselector.$menu.on( 'click.ime', 'li', function() {
imeselector.$element.focus();
-   });
+   return false;
+   } );
 
-   imeselector.$menu.on( 'click.ime', 'li.ime-im', 
function ( e ) {
+   imeselector.$menu.on( 'click.ime', 'li.ime-im', 
function () {
imeselector.selectIM( $( this ).data( 
'ime-inputmethod' ) );
-   e.stopPropagation();
+   return false;
} );
 
-   imeselector.$menu.on( 'click.ime', 'li.ime-lang', 
function ( e ) {
+   imeselector.$menu.on( 'click.ime', 'li.ime-lang', 
function () {
imeselector.selectLanguage( $( this ).attr( 
'lang' ) );
-   e.stopPropagation();
-   e.preventDefault();
+   return false;
} );
 
-   imeselector.$menu.on( 'click.ime', 'div.ime-disable', 
function ( e ) {
+   imeselector.$menu.on( 'click.ime', 'div.ime-disable', 
function () {
imeselector.disableIM();
-   e.stopPropagation

[MediaWiki-commits] [Gerrit] (bug 48683) Use a correct way to create titles from given ns... - change (mediawiki...WikiLove)

2013-05-22 Thread Liangent (Code Review)
Liangent has uploaded a new change for review.

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


Change subject: (bug 48683) Use a correct way to create titles from given ns 
and text
..

(bug 48683) Use a correct way to create titles from given ns and text

Bug: 48683
Change-Id: I6d2fa44550361ebda12c602c487d6a38bff1c479
---
M WikiLove.hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/WikiLove.hooks.php b/WikiLove.hooks.php
index 4446d61..ad6b77a 100644
--- a/WikiLove.hooks.php
+++ b/WikiLove.hooks.php
@@ -173,7 +173,7 @@
}
 
// If we're on a subpage, get the base page title
-   $baseTitle = Title::newFromText( $title-getBaseText(), $ns );
+   $baseTitle = Title::makeTitleSafe( $ns, $title-getBaseText() );
if ( $baseTitle === null ) {
return wfMessage( 'wikilove-err-invalid-username' 
)-plain();
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d2fa44550361ebda12c602c487d6a38bff1c479
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLove
Gerrit-Branch: master
Gerrit-Owner: Liangent liang...@gmail.com

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


[MediaWiki-commits] [Gerrit] Disable Narayam on commons now that they have ULS - change (operations/mediawiki-config)

2013-05-22 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review.

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


Change subject: Disable Narayam on commons now that they have ULS
..

Disable Narayam on commons now that they have ULS

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


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index ed3ce4d..2d35015 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -10906,7 +10906,6 @@
'bnwiki' = true, // Bug 40366
'bnwikibooks' = true, // Bug 40366
'bnwikisource' = true, // Bug 36104
-   'commonswiki' = true, // Bug 32619
'guwiki' = true, // Bug 33423
'guwikisource' = true, // Bug 35138
'guwiktionary' = true, // bug 37365
@@ -10949,7 +10948,6 @@
 ),
 'wmgNarayamEnabledByDefault' = array(
'default' = false, // Note Narayam default is true
-   'commonswiki' = false, // Bug 32619
'amwiki' = true, // Bug 41460
'amwikiquote' = true, // Bug 41460
'amwiktionary' = true, // Bug 41460

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ec904c0a97b2eb078e6c77ca486a5087039fde9
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com

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


[MediaWiki-commits] [Gerrit] Revert prior 3 commit - change (analytics/limn-mobile-data)

2013-05-22 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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


Change subject: Revert prior 3 commit
..

Revert prior 3 commit

Limn doesn't quite likea autogenerated datasources. And since
mobile-dashboard.wmflabs.org has been broken for a bit, reverting

Change-Id: Iad2f118c508a6f752e5b60a01547069b73f53db3
---
M .gitignore
M datasources/30-day-uploads.json
M datasources/cancelled-uploads.json
M datasources/deleted-uploads.json
M datasources/error-uploads.json
M datasources/no-cats.json
M datasources/performance-rendering.json
M datasources/share-attempts.json
M datasources/successful-logins.json
M datasources/successful-uploads.json
M datasources/unique-uploaders.json
M generate.py
R mobile/30-day-uploads.sql
R mobile/alltime-numbers.py
R mobile/cancelled-uploads.sql
M mobile/config.yaml
R mobile/deleted-uploads.py
R mobile/error-correction.py
R mobile/error-uploads.sql
R mobile/no-cats.sql
R mobile/performance-rendering.sql
R mobile/share-attempts.sql
R mobile/successful-logins.sql
R mobile/successful-uploads.sql
R mobile/unique-uploaders.sql
R mobile/uploaders-experience.py
26 files changed, 22 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/limn-mobile-data 
refs/changes/85/64885/1

diff --git a/.gitignore b/.gitignore
index 1867364..c07d99c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
-/env/
-/datafiles/
+env/
+datafiles/
 .output
 *.swp
 *.pyc
diff --git a/datasources/30-day-uploads.json b/datasources/30-day-uploads.json
index 22c226a..cd3092a 100644
--- a/datasources/30-day-uploads.json
+++ b/datasources/30-day-uploads.json
@@ -5,7 +5,7 @@
 step: 1d,
 end: 2013/03/19
 },
-url: {{ output.url }}/30-day-uploads.csv,
+url: 
http://stat1001.wikimedia.org/limn-public-data/mobile/datafiles/30-day-uploads.csv;,
 notes: ,
 format: csv,
 slug: null,
diff --git a/datasources/cancelled-uploads.json 
b/datasources/cancelled-uploads.json
index 646676f..29664f1 100644
--- a/datasources/cancelled-uploads.json
+++ b/datasources/cancelled-uploads.json
@@ -5,7 +5,7 @@
 step: 1d,
 end: 2013/03/19
 },
-url: {{ output.url }}/cancelled-uploads.csv,
+url: 
http://stat1001.wikimedia.org/limn-public-data/mobile/datafiles/cancelled-uploads.csv;,
 notes: ,
 format: csv,
 slug: null,
diff --git a/datasources/deleted-uploads.json b/datasources/deleted-uploads.json
index 54e78ce..e1e5bfe 100644
--- a/datasources/deleted-uploads.json
+++ b/datasources/deleted-uploads.json
@@ -5,7 +5,7 @@
 step: 1d,
 end: 2013/03/19
 },
-url: {{ output.url }}/deleted-uploads.csv,
+url: 
http://stat1001.wikimedia.org/limn-public-data/mobile/datafiles/deleted-uploads.csv;,
 notes: ,
 format: csv,
 slug: null,
diff --git a/datasources/error-uploads.json b/datasources/error-uploads.json
index 4233c46..0fa843a 100644
--- a/datasources/error-uploads.json
+++ b/datasources/error-uploads.json
@@ -5,7 +5,7 @@
 step: 1d,
 end: 2013/03/19
 },
-url: {{ output.url }}/error-uploads.csv,
+url: 
http://stat1001.wikimedia.org/limn-public-data/mobile/datafiles/error-uploads.csv;,
 notes: ,
 format: csv,
 slug: null,
diff --git a/datasources/no-cats.json b/datasources/no-cats.json
index 3d3b875..3e09cee 100644
--- a/datasources/no-cats.json
+++ b/datasources/no-cats.json
@@ -5,7 +5,7 @@
 step: 1d,
 end: 2013/03/19
 },
-url: {{ output.url }}/no-cats.csv,
+url: 
http://stat1001.wikimedia.org/limn-public-data/mobile/datafiles/no-cats.csv;,
 notes: ,
 format: csv,
 slug: null,
diff --git a/datasources/performance-rendering.json 
b/datasources/performance-rendering.json
index f624b33..87f54a6 100644
--- a/datasources/performance-rendering.json
+++ b/datasources/performance-rendering.json
@@ -5,7 +5,7 @@
 step: 1d,
 end: 2013/03/19
 },
-url: {{ output.url }}/performance-rendering.csv,
+url: 
http://stat1001.wikimedia.org/limn-public-data/mobile/datafiles/performance-rendering.csv;,
 notes: ,
 format: csv,
 slug: null,
diff --git a/datasources/share-attempts.json b/datasources/share-attempts.json
index d0e16d3..d79d425 100644
--- a/datasources/share-attempts.json
+++ b/datasources/share-attempts.json
@@ -5,7 +5,7 @@
 step: 1d,
 end: 2013/03/19
 },
-url: {{ output.url }}/share-attempts.csv,
+url: 
http://stat1001.wikimedia.org/limn-public-data/mobile/datafiles/share-attempts.csv;,
 notes: ,
 format: csv,
 slug: null,
diff --git a/datasources/successful-logins.json 
b/datasources/successful-logins.json
index 209e953..d419fba 100644
--- a/datasources/successful-logins.json
+++ b/datasources/successful-logins.json
@@ -5,7 +5,7 @@
 step: 1d,
 end: 2013/03/19
 },
-url: {{ output.url }}/successful-logins.csv,
+url: 

[MediaWiki-commits] [Gerrit] Revert Add a MediaWiki preference for enabling ULS IME - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert Add a MediaWiki preference for enabling ULS IME
..


Revert Add a MediaWiki preference for enabling ULS IME

This reverts commit 6ae0fe3e449920d91a85486dc55ec3c6252a9d18.
The commit was duplicating the preferences in 2 places
making the syncing hard.
As per discussion with Pau, we will try alternate approach.

Bug: 48642
Change-Id: I5c97838ed875364dc35b66a3d6c33d9975b5107e
---
M UniversalLanguageSelector.hooks.php
M UniversalLanguageSelector.i18n.php
M UniversalLanguageSelector.php
M resources/js/ext.uls.preferences.js
4 files changed, 7 insertions(+), 60 deletions(-)

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



diff --git a/UniversalLanguageSelector.hooks.php 
b/UniversalLanguageSelector.hooks.php
index c8e2822..1aa0adc 100644
--- a/UniversalLanguageSelector.hooks.php
+++ b/UniversalLanguageSelector.hooks.php
@@ -295,18 +295,8 @@
}
 
public static function onGetPreferences( $user, $preferences ) {
-   // The detailed preferences for different layouts.
-   // Saved as JSON and modifiable through the ULS screens.
$preferences['uls-preferences'] = array(
'type' = 'api',
-   );
-
-   // A checkbox in the general MediaWiki preferences screen
-   // to enable or disable IME in ULS
-   $preferences['uls-ime-enable'] = array(
-   'type' = 'toggle',
-   'label-message' = 'uls-ime-enable-preferences-label',
-   'section' = 'editing/advancedediting', // under 
'Advanced options' section of 'Editing' tab
);
 
return true;
diff --git a/UniversalLanguageSelector.i18n.php 
b/UniversalLanguageSelector.i18n.php
index 1090745..ea28f0e 100644
--- a/UniversalLanguageSelector.i18n.php
+++ b/UniversalLanguageSelector.i18n.php
@@ -30,7 +30,6 @@
'uls-desc' = 'Gives the user several ways to select a language and to 
adjust language settings',
 
'uls-plang-title-languages' = 'Languages',
-   'uls-ime-enable-preferences-label' = 'Enable input methods',
 );
 
 /** Message documentation (Message documentation)
@@ -43,7 +42,6 @@
'uls-plang-title-languages' = 'A title for the are in the sidebar in 
which the interlanguage links are supposed to appear.
 This title is shown when there are no interlanguage links there, but an icon 
that enables the ULS is shown.
 {{Identical|Language}}',
-   'uls-ime-enable-preferences-label' = 'Used as a label for the checkbox 
in {{msg-mw|Preferences}} page.',
 );
 
 /** Arabic (العربية)
diff --git a/UniversalLanguageSelector.php b/UniversalLanguageSelector.php
index b63222e..c68047b 100644
--- a/UniversalLanguageSelector.php
+++ b/UniversalLanguageSelector.php
@@ -137,7 +137,6 @@
 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = 
'UniversalLanguageSelectorHooks::onSkinTemplateOutputPageBeforeExec';
 
 $wgDefaultUserOptions['uls-preferences'] = '';
-$wgDefaultUserOptions['uls-ime-enable'] = 1;
 $wgHooks['GetPreferences'][] = 
'UniversalLanguageSelectorHooks::onGetPreferences';
 
 $wgExtensionFunctions[] = function() {
diff --git a/resources/js/ext.uls.preferences.js 
b/resources/js/ext.uls.preferences.js
index cfefb63..f0cbb5f 100644
--- a/resources/js/ext.uls.preferences.js
+++ b/resources/js/ext.uls.preferences.js
@@ -104,7 +104,6 @@
 
ULSPreferences = function () {
this.preferenceName = 'uls-preferences';
-   this.imeEnablePreferenceName = 'uls-ime-enable',
this.username = mw.user.getName();
this.isAnon = mw.user.isAnon();
this.preferences = null;
@@ -116,30 +115,13 @@
 * Initialize
 */
init: function () {
-   var options,
-   ulsImeEnable = mw.user.options.get( 
this.imeEnablePreferenceName );
-
if ( this.isAnon ) {
this.preferences = $.jStorage.get( 
this.preferenceName );
} else {
-   options = mw.user.options.get( 
this.preferenceName );
+   var options = mw.user.options.get( 
this.preferenceName );
this.preferences = $.parseJSON( options );
-
}
-
this.preferences = this.preferences || {};
-
-   if ( this.preferences.ime === undefined ) {
-   this.preferences.ime = {};
-   }
-
-   if ( ulsImeEnable === undefined ) {
-   this.preferences.ime.enable = mw.config.get( 
'wgULSIMEEnabled' );
-   } else if ( ulsImeEnable === 1 || ulsImeEnable === '1' 
) 

[MediaWiki-commits] [Gerrit] Add more tests for paragraphs and headings with extra spacing - change (mediawiki/core)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add more tests for paragraphs and headings with extra spacing
..


Add more tests for paragraphs and headings with extra spacing

Change-Id: Ic39fc0972bc25f0377720f82b642007ea0a208a0
---
M tests/parser/parserTests.txt
1 file changed, 53 insertions(+), 0 deletions(-)

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



diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index f90b279..a9ceafa 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -304,6 +304,59 @@
 !! end
 
 !! test
+Extra newlines: More paragraphs with indented comment
+!! input
+a
+
+   !--boo--
+
+b
+!!result
+pa
+/ppbr /
+b
+/p
+!!end
+
+!! test
+Extra newlines followed by heading
+!! input
+a
+
+
+
+=b=
+[[a]]
+
+
+=b=
+!! result
+pa
+/ppbr /
+/p
+h1span class=mw-headline id=bb/spanspan class=mw-editsection[a 
href=/index.php?title=Parser_testamp;action=editamp;section=1 title=Edit 
section: bedit/a]/span/h1
+pa href=/index.php?title=Aamp;action=editamp;redlink=1 class=new 
title=A (page does not exist)a/a
+/ppbr /
+/p
+h1span class=mw-headline id=b_2b/spanspan 
class=mw-editsection[a 
href=/index.php?title=Parser_testamp;action=editamp;section=2 title=Edit 
section: bedit/a]/span/h1
+
+!! end
+
+!! test
+Extra newlines between heading and content are swallowed
+!! input
+=b=
+
+
+
+[[a]]
+!! result
+h1span class=mw-headline id=bb/spanspan class=mw-editsection[a 
href=/index.php?title=Parser_testamp;action=editamp;section=1 title=Edit 
section: bedit/a]/span/h1
+pa href=/index.php?title=Aamp;action=editamp;redlink=1 class=new 
title=A (page does not exist)a/a
+/p
+!! end
+
+!! test
 Parsing an URL
 !! input
 http://fr.wikipedia.org/wiki/

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic39fc0972bc25f0377720f82b642007ea0a208a0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: GWicke gwi...@wikimedia.org
Gerrit-Reviewer: GWicke gwi...@wikimedia.org
Gerrit-Reviewer: Subramanya Sastry ssas...@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] Add fonts for Syriac Armaic languages - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add fonts for Syriac Armaic languages
..


Add fonts for Syriac Armaic languages

Fonts added: EastSyriacAdiabene, Estarngelo Edessa and SertoUrhoy
Languages: syc, arc
Bug: 47229

Change-Id: Id4f434c544d71a5b9a95ae73c7fd502cdd083019
---
A data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.eot
A data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.ttf
A data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.woff
A data/fontrepo/fonts/EastSyriacAdiabene/font.ini
A data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.eot
A data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.ttf
A data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.woff
A data/fontrepo/fonts/EstarngeloEdessa/font.ini
A data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.eot
A data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.ttf
A data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.woff
A data/fontrepo/fonts/SertoUrhoy/font.ini
A data/fontrepo/licenses/melthofontsLicense.txt
M resources/js/ext.uls.webfonts.repository.js
14 files changed, 80 insertions(+), 1 deletion(-)

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



diff --git a/data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.eot 
b/data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.eot
new file mode 100644
index 000..202cb21
--- /dev/null
+++ b/data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.eot
Binary files differ
diff --git a/data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.ttf 
b/data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.ttf
new file mode 100644
index 000..8893f48
--- /dev/null
+++ b/data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.ttf
Binary files differ
diff --git a/data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.woff 
b/data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.woff
new file mode 100644
index 000..2a162e9
--- /dev/null
+++ b/data/fontrepo/fonts/EastSyriacAdiabene/SyrCOMAdiabene.woff
Binary files differ
diff --git a/data/fontrepo/fonts/EastSyriacAdiabene/font.ini 
b/data/fontrepo/fonts/EastSyriacAdiabene/font.ini
new file mode 100644
index 000..5d5800f
--- /dev/null
+++ b/data/fontrepo/fonts/EastSyriacAdiabene/font.ini
@@ -0,0 +1,6 @@
+[East Syriac Adiabene]
+languages=syc,arc
+version=1.21
+license=East Syriac Adiabene License
+licensefile=melthofontsLicense.txt
+url=http://www.bethmardutho.org/index.php/resources/fonts.html
diff --git a/data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.eot 
b/data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.eot
new file mode 100644
index 000..1a4d1ee
--- /dev/null
+++ b/data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.eot
Binary files differ
diff --git a/data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.ttf 
b/data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.ttf
new file mode 100644
index 000..84878e1
--- /dev/null
+++ b/data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.ttf
Binary files differ
diff --git a/data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.woff 
b/data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.woff
new file mode 100644
index 000..ff32ea5
--- /dev/null
+++ b/data/fontrepo/fonts/EstarngeloEdessa/SyrCOMEdessa.woff
Binary files differ
diff --git a/data/fontrepo/fonts/EstarngeloEdessa/font.ini 
b/data/fontrepo/fonts/EstarngeloEdessa/font.ini
new file mode 100644
index 000..bf7d1ee
--- /dev/null
+++ b/data/fontrepo/fonts/EstarngeloEdessa/font.ini
@@ -0,0 +1,6 @@
+[Estarngelo Edessa]
+languages=syc*,arc*
+version=1.21
+license=Estarngelo Edessa License
+licensefile=melthofontsLicense.txt
+url=http://www.bethmardutho.org/index.php/resources/fonts.html
diff --git a/data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.eot 
b/data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.eot
new file mode 100644
index 000..a0aa3a9
--- /dev/null
+++ b/data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.eot
Binary files differ
diff --git a/data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.ttf 
b/data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.ttf
new file mode 100644
index 000..ff23670
--- /dev/null
+++ b/data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.ttf
Binary files differ
diff --git a/data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.woff 
b/data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.woff
new file mode 100644
index 000..cbb27b8
--- /dev/null
+++ b/data/fontrepo/fonts/SertoUrhoy/SyrCOMUrhoy.woff
Binary files differ
diff --git a/data/fontrepo/fonts/SertoUrhoy/font.ini 
b/data/fontrepo/fonts/SertoUrhoy/font.ini
new file mode 100644
index 000..8f67df3
--- /dev/null
+++ b/data/fontrepo/fonts/SertoUrhoy/font.ini
@@ -0,0 +1,6 @@
+[SertoUrhoy]
+languages=syc,arc
+version=1.20
+license=SertoUrhoy License
+licensefile=melthofontsLicense.txt
+url=http://www.bethmardutho.org/index.php/resources/fonts.html
diff --git a/data/fontrepo/licenses/melthofontsLicense.txt 
b/data/fontrepo/licenses/melthofontsLicense.txt
new file mode 100644
index 000..35c74dd
--- /dev/null
+++ 

[MediaWiki-commits] [Gerrit] Update jquery.ime from upstream - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update jquery.ime from upstream
..


Update jquery.ime from upstream

Version 0.1.0.20130522

Changes:
* Correct the versioning by adding build date metadata
* Remove an unwanted css style
* Avoid screen jump on click of IME menu items
* AltGr+M doesn't create a µ
* Code cleanup

Change-Id: Ia9ccd89a24f4d8627cf3a16f59984ad79f3d49f5
---
M lib/jquery.ime/css/jquery.ime.css
M lib/jquery.ime/jquery.ime.js
2 files changed, 83 insertions(+), 67 deletions(-)

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



diff --git a/lib/jquery.ime/css/jquery.ime.css 
b/lib/jquery.ime/css/jquery.ime.css
index d5dce3e..df40cc4 100644
--- a/lib/jquery.ime/css/jquery.ime.css
+++ b/lib/jquery.ime/css/jquery.ime.css
@@ -63,10 +63,6 @@
padding-right: 4px;
 }
 
-.ime-disable-link:hover span {
-   color: #eee;
-}
-
 .ime-list-title,
 .ime-lang-title {
color: #39d;
diff --git a/lib/jquery.ime/jquery.ime.js b/lib/jquery.ime/jquery.ime.js
index d1cb7d6..c09bd54 100644
--- a/lib/jquery.ime/jquery.ime.js
+++ b/lib/jquery.ime/jquery.ime.js
@@ -1,4 +1,4 @@
-/*! jquery.ime - v0.1.0 - 2013-05-17
+/*! jquery.ime - v0.1.0+20130522
 * https://github.com/wikimedia/jquery.ime
 * Copyright (c) 2013 Santhosh Thottingal; Licensed GPL, MIT */
 ( function ( $ ) {
@@ -483,6 +483,8 @@
 ( function ( $ ) {
'use strict';
 
+   var selectorTemplate, MutationObserver;
+
function IMESelector ( element, options ) {
this.$element = $( element );
this.options = $.extend( {}, IMESelector.defaults, options );
@@ -544,7 +546,7 @@
'marginTop': '-20px'
}, 500, function () {
imeselector.$imeSetting.hide();
-   // Restore properties for next 
time it becomes visible:
+   // Restore properties for the 
next time it becomes visible:
imeselector.$imeSetting.css( 
'opacity', 1 );
imeselector.$imeSetting.css( 
'margin-top', 0 );
} );
@@ -563,12 +565,14 @@
this.$menu.addClass( 'open' );
this.stopTimer();
this.$imeSetting.show();
+
return false;
},
 
hide: function () {
this.$menu.removeClass( 'open' );
this.resetTimer();
+
return false;
},
 
@@ -588,9 +592,11 @@
 
imeselector.$imeSetting.on( 'click.ime', function ( e ) 
{
var t = $( e.target );
+
if ( t.hasClass( 'imeselector-toggle' ) ) {
imeselector.toggle();
}
+   return false;
} );
 
imeselector.$element.on( 'blur.ime', function () {
@@ -601,7 +607,8 @@
} );
 
imeselector.$imeSetting.mouseenter( function () {
-   // We don't want the selector to disappear 
while the user is trying to click it
+   // We don't want the selector to disappear
+   // while the user is trying to click it
imeselector.stopTimer();
imeselector.$imeSetting.addClass( 'onfocus' );
} ).mouseleave( function () {
@@ -611,23 +618,22 @@
 
imeselector.$menu.on( 'click.ime', 'li', function() {
imeselector.$element.focus();
-   });
+   return false;
+   } );
 
-   imeselector.$menu.on( 'click.ime', 'li.ime-im', 
function ( e ) {
+   imeselector.$menu.on( 'click.ime', 'li.ime-im', 
function () {
imeselector.selectIM( $( this ).data( 
'ime-inputmethod' ) );
-   e.stopPropagation();
+   return false;
} );
 
-   imeselector.$menu.on( 'click.ime', 'li.ime-lang', 
function ( e ) {
+   imeselector.$menu.on( 'click.ime', 'li.ime-lang', 
function () {
imeselector.selectLanguage( $( this ).attr( 
'lang' ) );
-   e.stopPropagation();
-   e.preventDefault();
+   return false

[MediaWiki-commits] [Gerrit] Remove redundant focus handler - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove redundant focus handler
..


Remove redundant focus handler

focus on input field and updating language(can be changed from settings,
selector etc) is already handled inside jquery.ime

But focus on the particular input field need to be triggered, without
consuming focus event with in the event handler

Change-Id: I0b3783542e23b194fe141b9aef692a855469ce62
---
M resources/js/ext.uls.ime.js
1 file changed, 2 insertions(+), 9 deletions(-)

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



diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js
index 1b71f3d..1841082 100644
--- a/resources/js/ext.uls.ime.js
+++ b/resources/js/ext.uls.ime.js
@@ -139,8 +139,7 @@
mw.ime.setup = function () {
 
$( 'body' ).on( 'focus.ime', inputSelector, function () {
-   var imeselector,
-   $input = $( this );
+   var $input = $( this );
 
$input.ime( {
languages: mw.ime.getIMELanguageList(),
@@ -165,13 +164,7 @@
 
return $ulsTrigger;
}
-   } );
-
-   // Some fields may be uninitialized
-   imeselector = $input.data( 'imeselector' );
-   if ( imeselector ) {
-   imeselector.selectLanguage( 
$.ime.preferences.getLanguage() );
-   }
+   } ).focus();
} );
 
};

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b3783542e23b194fe141b9aef692a855469ce62
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com
Gerrit-Reviewer: Amire80 amir.ahar...@mail.huji.ac.il
Gerrit-Reviewer: Santhosh santhosh.thottin...@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] displaytitle: reject some CSS if $wgRestrictDisplayTitle set - change (mediawiki/core)

2013-05-22 Thread Matmarex (Code Review)
Matmarex has uploaded a new change for review.

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


Change subject: displaytitle: reject some CSS if $wgRestrictDisplayTitle set
..

displaytitle: reject some CSS if $wgRestrictDisplayTitle set

$wgRestrictDisplayTitle is intended to make it possible to simply
copy-and-paste the title text even if it requires some styling like
subscript or superscript. Using a span style=display: none; /
broke that expectation, as the text hidden in such way becomes
completely invisible and unselectable. This patch rejects such styles.

Also disallowed 'user-select' and 'visibility', since they both
prevents the user from selecting and/or copying the text as well.

Minor change to Sanitizer::checkCss was made for it to pass through
values which consist of nothing but a single comment, to allow this
rejection to display some sort of a notification to the user.

Bug: 26547
Change-Id: Ie162535b6bcbebce4ee69f6dcc1957c3c672
---
M includes/Sanitizer.php
M includes/parser/CoreParserFunctions.php
M tests/parser/parserTests.txt
3 files changed, 66 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/11/64911/1

diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php
index ed01235..71feef0 100644
--- a/includes/Sanitizer.php
+++ b/includes/Sanitizer.php
@@ -856,19 +856,24 @@
$value = preg_replace_callback( $decodeRegex,
array( __CLASS__, 'cssDecodeCallback' ), $value );
 
-   // Remove any comments; IE gets token splitting wrong
-   // This must be done AFTER decoding character references and
-   // escape sequences, because those steps can introduce comments
-   // This step cannot introduce character references or escape
-   // sequences, because it replaces comments with spaces rather
-   // than removing them completely.
-   $value = StringUtils::delimiterReplace( '/*', '*/', ' ', $value 
);
+   // Let the value through if it's nothing but a single comment, 
to
+   // allow other functions which may reject it to pass some error
+   // message through.
+   if ( !preg_match( '!\^ \s* /\* [^*/]* \*/ \s* $ !x', $value ) ) {
+   // Remove any comments; IE gets token splitting wrong
+   // This must be done AFTER decoding character 
references and
+   // escape sequences, because those steps can introduce 
comments
+   // This step cannot introduce character references or 
escape
+   // sequences, because it replaces comments with spaces 
rather
+   // than removing them completely.
+   $value = StringUtils::delimiterReplace( '/*', '*/', ' 
', $value );
 
-   // Remove anything after a comment-start token, to guard against
-   // incorrect client implementations.
-   $commentPos = strpos( $value, '/*' );
-   if ( $commentPos !== false ) {
-   $value = substr( $value, 0, $commentPos );
+   // Remove anything after a comment-start token, to 
guard against
+   // incorrect client implementations.
+   $commentPos = strpos( $value, '/*' );
+   if ( $commentPos !== false ) {
+   $value = substr( $value, 0, $commentPos );
+   }
}
 
// Reject problematic keywords and control characters
diff --git a/includes/parser/CoreParserFunctions.php 
b/includes/parser/CoreParserFunctions.php
index be945f7..fbd30ce 100644
--- a/includes/parser/CoreParserFunctions.php
+++ b/includes/parser/CoreParserFunctions.php
@@ -363,22 +363,35 @@
static function displaytitle( $parser, $text = '' ) {
global $wgRestrictDisplayTitle;
 
-   #parse a limited subset of wiki markup (just the single quote 
items)
+   // parse a limited subset of wiki markup (just the single quote 
items)
$text = $parser-doQuotes( $text );
 
-   #remove stripped text (e.g. the UNIQ-QINU stuff) that was 
generated by tag extensions/whatever
+   // remove stripped text (e.g. the UNIQ-QINU stuff) that was 
generated by tag extensions/whatever
$text = preg_replace( '/' . preg_quote( $parser-uniqPrefix(), 
'/' ) . '.*?'
. preg_quote( Parser::MARKER_SUFFIX, '/' ) . '/', '', 
$text );
 
-   #list of disallowed tags for DISPLAYTITLE
-   #these will be escaped even though they are allowed in normal 
wiki text
+   // list of disallowed tags for DISPLAYTITLE
+   // these will be escaped even though they are allowed in normal 
wiki text
  

[MediaWiki-commits] [Gerrit] Add missing namespace use - change (mediawiki...Wikibase)

2013-05-22 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has submitted this change and it was merged.

Change subject: Add missing namespace use
..


Add missing namespace use

Change-Id: I77e361f64dee20aca37b72d469343152ceefdac2
---
M client/includes/recentchanges/ExternalChangesLine.php
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/client/includes/recentchanges/ExternalChangesLine.php 
b/client/includes/recentchanges/ExternalChangesLine.php
index d897846..49ab4a1 100644
--- a/client/includes/recentchanges/ExternalChangesLine.php
+++ b/client/includes/recentchanges/ExternalChangesLine.php
@@ -2,6 +2,8 @@
 
 namespace Wikibase;
 
+use \Wikibase\Client\WikibaseClient;
+
 /**
  * @todo remove static stuff and refactor
  *

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I77e361f64dee20aca37b72d469343152ceefdac2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.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] code cleanup, remove tabs - change (mediawiki...TimedMediaHandler)

2013-05-22 Thread J (Code Review)
J has uploaded a new change for review.

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


Change subject: code cleanup, remove tabs
..

code cleanup, remove tabs

Change-Id: I70b7e17ac775fa57ae55280812a58891ddb9068a
---
M TimedMediaHandler.i18n.php
M TimedMediaHandler.php
M TimedMediaHandler_body.php
M TimedMediaIframeOutput.php
M TimedMediaThumbnail.php
5 files changed, 29 insertions(+), 29 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/12/64912/1

diff --git a/TimedMediaHandler.i18n.php b/TimedMediaHandler.i18n.php
index d7fb5de..5b282e3 100644
--- a/TimedMediaHandler.i18n.php
+++ b/TimedMediaHandler.i18n.php
@@ -25,42 +25,42 @@
'timedmedia-mp4-short-video' = 'MP4 $1 video file, $2',
'timedmedia-mp4-long-video' = 'MP4 audio/video file, $1, length $2, $4 
× $5 pixels, $3 overall',
 
-   'timedmedia-no-player-js' = 'Sorry, your browser either has 
JavaScript disabled or does not have any supported player.br /
+   'timedmedia-no-player-js' = 'Sorry, your browser either has JavaScript 
disabled or does not have any supported player.br /
 You can a href=$1download the clip/a or a 
href=//www.mediawiki.org/wiki/Extension:TimedMediaHandler/Client_downloaddownload
 a player/a to play the clip in your browser.',
 
'timedmedia-more' = 'More…',
'timedmedia-dismiss'  = 'Close',
'timedmedia-download' = 'Download file',
-   'timedmedia-play-media'   = 'Play media',
+   'timedmedia-play-media'   = 'Play media',
'timedmedia-desc-link'= 'About this file',
'timedmedia-oggThumb-version' = 'OggHandler requires oggThumb version 
$1 or later.',
'timedmedia-oggThumb-failed'  = 'oggThumb failed to create the 
thumbnail.',
 
// Transcode status table:
 
-   'timedmedia-status-header'  = 'Transcode status',
-   'timedmedia-update-status'  = 'Update transcode status',
-   'timedmedia-status' = 'Status',
-   'timedmedia-status-unknown' = 'Unknown status',
-   'timedmedia-transcodeinfo'  = 'Transcode derivative 
description',
-   'timedmedia-actions'= 'Actions',
-   'timedmedia-direct-link'= 'Download derivative',
-   'timedmedia-not-ready'  = 'Not ready',
-   'timedmedia-completed-on'   = 'Completed transcode $1',
-   'timedmedia-error-on'   = 'Error in transcode on $1.',
-   'timedmedia-started-transcode'  = 'Transcode started $1 ago. $2',
-   'timedmedia-percent-done'   = 'About $1% done',
-   'timedmedia-in-job-queue'   = 'Added to Job queue $1 ago',
+   'timedmedia-status-header' = 'Transcode status',
+   'timedmedia-update-status' = 'Update transcode status',
+   'timedmedia-status'= 'Status',
+   'timedmedia-status-unknown' = 'Unknown status',
+   'timedmedia-transcodeinfo' = 'Transcode derivative description',
+   'timedmedia-actions' = 'Actions',
+   'timedmedia-direct-link' = 'Download derivative',
+   'timedmedia-not-ready' = 'Not ready',
+   'timedmedia-completed-on' = 'Completed transcode $1',
+   'timedmedia-error-on' = 'Error in transcode on $1.',
+   'timedmedia-started-transcode' = 'Transcode started $1 ago. $2',
+   'timedmedia-percent-done' = 'About $1% done',
+   'timedmedia-in-job-queue' = 'Added to Job queue $1 ago',
'timedmedia-unknown-target-size'= 'Unknown target size, $1 encoded',
-   'timedmedia-days'   = '{{PLURAL:$1|1 day|$1 
days}}',
-   'timedmedia-hours'  = '{{PLURAL:$1|1 hour|$1 
hours}}',
-   'timedmedia-minutes'= '{{PLURAL:$1|1 minute|$1 
minutes}}',
-   'timedmedia-seconds'= '{{PLURAL:$1|1 second|$1 
seconds}}',
-   'timedmedia-show-error' = 'Show error',
-   'timedmedia-reset'  = 'Reset transcode',
-   'timedmedia-reset-confirm'  = 'Resetting this transcode 
will remove any existing file (if present), and it will re-add the transcode to 
the job queue. It will take some time to re-transcode. br /br /
+   'timedmedia-days' = '{{PLURAL:$1|1 day|$1 days}}',
+   'timedmedia-hours' = '{{PLURAL:$1|1 hour|$1 hours}}',
+   'timedmedia-minutes' = '{{PLURAL:$1|1 minute|$1 minutes}}',
+   'timedmedia-seconds' = '{{PLURAL:$1|1 second|$1 seconds}}',
+   'timedmedia-show-error' = 'Show error',
+   'timedmedia-reset' = 'Reset transcode',
+   'timedmedia-reset-confirm' = 'Resetting this transcode will remove any 
existing file (if present), and it will re-add the transcode to the job queue. 
It will take some time to re-transcode. br /br /
 Are you sure you want 

[MediaWiki-commits] [Gerrit] Provide disable input tools option in IME menu - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Provide disable input tools option in IME menu
..


Provide disable input tools option in IME menu

Bug: 48533
Change-Id: Ie856cbda344ae2624567fb6c2d6206996c3b10dc
---
M i18n/en.json
M resources/css/ext.uls.inputsettings.css
A resources/images/cog.png
M resources/images/cog.svg
A resources/images/remove-input.png
A resources/images/remove-input.svg
M resources/js/ext.uls.ime.js
7 files changed, 166 insertions(+), 50 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 7eca407..5fd47af 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -39,7 +39,6 @@
 ext-uls-disable-input-method: Disable input method,
 ext-uls-disable-input-method-desc: Use a regular keyboard,
 ext-uls-input-settings-more-languages-tooltip: More languages,
-ext-uls-input-more-settings : More settings,
 jquery-ime-other-languages: Other languages,
 jquery-ime-disable-text: Disable input method,
 jquery-ime-help: Help,
diff --git a/resources/css/ext.uls.inputsettings.css 
b/resources/css/ext.uls.inputsettings.css
index b8c7b56..b6b7531 100644
--- a/resources/css/ext.uls.inputsettings.css
+++ b/resources/css/ext.uls.inputsettings.css
@@ -31,22 +31,40 @@
background-color: #5089e8;
 }
 
-.uls-ime-more-settings-link {
-   /* @embed */
-   background: transparent url('../images/cog-16x16-ltr.png') right center 
no-repeat;
-   background-image: -webkit-linear-gradient(transparent, transparent), 
url('../images/cog.svg');
-   background-image: -moz-linear-gradient(transparent, transparent), 
url('../images/cog.svg');
-   background-image: linear-gradient(transparent, transparent), 
url('../images/cog.svg');
-   background-size: 20px auto;
+.uls-ime-menu-settings-item {
background-color: #f0f0f0;
border-radius: 0 0 5px 5px;
border-top: 1px solid #ddd;
margin-top: 6px;
-   padding: 2px 0 2px 0;
+   padding: 4px 2px;
color: #444;
 }
 
-.uls-ime-more-settings-link  a:hover {
+.uls-ime-disable-link {
+   /* @embed */
+   background: transparent url('../images/remove-input.png') left top 
no-repeat;
+   background-image: -webkit-linear-gradient(transparent, transparent), 
url('../images/remove-input.svg');
+   background-image: -moz-linear-gradient(transparent, transparent), 
url('../images/remove-input.svg');
+   background-image: linear-gradient(transparent, transparent), 
url('../images/remove-input.svg');
+   background-size: auto 16px;
+   padding-left: 22px;
+   padding-bottom: 10px;
+}
+
+.uls-ime-more-settings-link {
+   /* @embed */
+   background: transparent url('../images/cog.png') right top no-repeat;
+   background-image: -webkit-linear-gradient(transparent, transparent), 
url('../images/cog.svg');
+   background-image: -moz-linear-gradient(transparent, transparent), 
url('../images/cog.svg');
+   background-image: linear-gradient(transparent, transparent), 
url('../images/cog.svg');
+   background-size: auto 14px;
+   border-left: 1px solid #CC;
+   width: 22px;
+   height: 14px;
+   float: right;
+}
+
+.uls-ime-menu-settings-item  a:hover {
background-color: #f0f0f0;
color: #000;
 }
@@ -87,4 +105,4 @@
margin: 12px 0;
padding: 6px 10px;
background: #f0f0f0;
-}
\ No newline at end of file
+}
diff --git a/resources/images/cog.png b/resources/images/cog.png
new file mode 100644
index 000..a8ec25f
--- /dev/null
+++ b/resources/images/cog.png
Binary files differ
diff --git a/resources/images/cog.svg b/resources/images/cog.svg
index bf8dafc..93791b1 100644
--- a/resources/images/cog.svg
+++ b/resources/images/cog.svg
@@ -7,12 +7,38 @@
xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#;
xmlns:svg=http://www.w3.org/2000/svg;
xmlns=http://www.w3.org/2000/svg;
+   xmlns:sodipodi=http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd;
+   xmlns:inkscape=http://www.inkscape.org/namespaces/inkscape;
version=1.1
-   width=42
-   height=31.98
-   viewBox=0 0 42 31.98
+   width=20
+   height=14
+   viewBox=0 0 20 14
id=Layer_1
-   xml:space=preservemetadata
+   xml:space=preserve
+   inkscape:version=0.48.2 r9819
+   sodipodi:docname=cog.svg
+   
inkscape:export-filename=/Users/pau/repos/wikimedia/UniversalLanguageSelector/resources/images/cog.png
+   inkscape:export-xdpi=90
+   inkscape:export-ydpi=90sodipodi:namedview
+   pagecolor=#ff
+   bordercolor=#66
+   borderopacity=1
+   objecttolerance=10
+   gridtolerance=10
+   guidetolerance=10
+   inkscape:pageopacity=0
+   inkscape:pageshadow=2
+   inkscape:window-width=1124
+   inkscape:window-height=646
+   id=namedview82
+   showgrid=false
+   inkscape:zoom=7.3750004
+   inkscape:cx=3.9830519
+   inkscape:cy=14.711864
+   inkscape:window-x=520
+   

[MediaWiki-commits] [Gerrit] only count failed transcodes as failed - change (mediawiki...TimedMediaHandler)

2013-05-22 Thread J (Code Review)
J has uploaded a new change for review.

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


Change subject: only count failed transcodes as failed
..

only count failed transcodes as failed

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


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/13/64913/1

diff --git a/SpecialTimedMediaHandler.php b/SpecialTimedMediaHandler.php
index e23fc54..b59680a 100644
--- a/SpecialTimedMediaHandler.php
+++ b/SpecialTimedMediaHandler.php
@@ -11,7 +11,7 @@
 class SpecialTimedMediaHandler extends SpecialPage {
private $transcodeStates = array(
'active' = 'transcode_time_startwork IS NOT NULL AND 
transcode_time_success IS NULL AND transcode_time_error IS NULL',
-   'failed' = 'transcode_error != ',
+   'failed' = 'transcode_error !=  AND transcode_time_success 
IS NULL',
'queued' = 'transcode_time_startwork IS NULL AND 
transcode_time_success IS NULL AND transcode_time_error IS NULL',
 
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb3d9e5ca0bf5eeadad0397dbc0df969827c855e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: J jger...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Make jshint voting for GuidedTour - change (integration/zuul-config)

2013-05-22 Thread Hashar (Code Review)
Hashar has submitted this change and it was merged.

Change subject: Make jshint voting for GuidedTour
..


Make jshint voting for GuidedTour

Change-Id: I17ef9247f65d7d6515566a1cffa77327a23d0b8e
---
M layout.yaml
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, but someone else must approve
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/layout.yaml b/layout.yaml
index 83ea219..904018d 100644
--- a/layout.yaml
+++ b/layout.yaml
@@ -341,6 +341,8 @@
 voting: true
   - name: mwext-Echo-jslint
 voting: true
+  - name: mwext-GuidedTour-jslint
+voting: true
   - name: mwext-GlobalBlocking-jslint
 voting: true
   - name: mwext-Math-jslint

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I17ef9247f65d7d6515566a1cffa77327a23d0b8e
Gerrit-PatchSet: 2
Gerrit-Project: integration/zuul-config
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen mflasc...@wikimedia.org
Gerrit-Reviewer: Hashar has...@free.fr
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Spage sp...@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] Optimize images - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review.

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


Change subject: Optimize images
..

Optimize images

Change-Id: I8cf0ec50425374e8abb89dcedc9663375e3d1edd
---
M resources/images/cog-sprite.png
M resources/images/cog.png
2 files changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/resources/images/cog-sprite.png b/resources/images/cog-sprite.png
index c827804..04c7aa2 100644
--- a/resources/images/cog-sprite.png
+++ b/resources/images/cog-sprite.png
Binary files differ
diff --git a/resources/images/cog.png b/resources/images/cog.png
index a8ec25f..7d48155 100644
--- a/resources/images/cog.png
+++ b/resources/images/cog.png
Binary files differ

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8cf0ec50425374e8abb89dcedc9663375e3d1edd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com

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


[MediaWiki-commits] [Gerrit] Removed word 'proleptic' from message - change (mediawiki...DataValues)

2013-05-22 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has uploaded a new change for review.

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


Change subject: Removed word 'proleptic' from message
..

Removed word 'proleptic' from message

- this was misleading and just wrong in some cases

Change-Id: I52af5203b012ed50af8bf2f307c9ef69eb6b4014
---
M ValueView/ValueView.i18n.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues 
refs/changes/15/64915/1

diff --git a/ValueView/ValueView.i18n.php b/ValueView/ValueView.i18n.php
index 62cce5d..de50785 100644
--- a/ValueView/ValueView.i18n.php
+++ b/ValueView/ValueView.i18n.php
@@ -48,7 +48,7 @@
// TimeInput expert:
'valueview-expert-timeinput-precision' = 'Precision:',
'valueview-expert-timeinput-calendar' = 'Calendar:',
-   'valueview-expert-timeinput-calendarhint' = '(proleptic $1 calendar)',
+   'valueview-expert-timeinput-calendarhint' = '($1 calendar)',
'valueview-expert-timeinput-calendarhint-switch' = 'rarr; change to 
$1',
 
'valueview-preview-label' = 'will be displayed as:',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I52af5203b012ed50af8bf2f307c9ef69eb6b4014
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DataValues
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] Removed word 'proleptic' from message - change (mediawiki...DataValues)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: Removed word 'proleptic' from message
..


Removed word 'proleptic' from message

- this was misleading and just wrong in some cases

Change-Id: I52af5203b012ed50af8bf2f307c9ef69eb6b4014
---
M ValueView/ValueView.i18n.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/ValueView/ValueView.i18n.php b/ValueView/ValueView.i18n.php
index 62cce5d..de50785 100644
--- a/ValueView/ValueView.i18n.php
+++ b/ValueView/ValueView.i18n.php
@@ -48,7 +48,7 @@
// TimeInput expert:
'valueview-expert-timeinput-precision' = 'Precision:',
'valueview-expert-timeinput-calendar' = 'Calendar:',
-   'valueview-expert-timeinput-calendarhint' = '(proleptic $1 calendar)',
+   'valueview-expert-timeinput-calendarhint' = '($1 calendar)',
'valueview-expert-timeinput-calendarhint-switch' = 'rarr; change to 
$1',
 
'valueview-preview-label' = 'will be displayed as:',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I52af5203b012ed50af8bf2f307c9ef69eb6b4014
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DataValues
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.de
Gerrit-Reviewer: Siebrand siebr...@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] Define a configuration variable - change (mediawiki...InviteSignup)

2013-05-22 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review.

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


Change subject: Define a configuration variable
..

Define a configuration variable

Change-Id: I637937c1a09b9de3eb6ec9a4e84ba2eb26cf739b
---
M InviteSignup.php
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/InviteSignup 
refs/changes/16/64916/1

diff --git a/InviteSignup.php b/InviteSignup.php
index 400da19..0c81f9e 100644
--- a/InviteSignup.php
+++ b/InviteSignup.php
@@ -14,7 +14,7 @@
 $wgExtensionCredits['specialpage'][] = array(
'path' = __FILE__,
'name' = 'InviteSignup',
-   'version' = '2012-12-26',
+   'version' = '2013-05-22',
'author' = array( 'Niklas Laxström' ),
'descriptionmsg' = 'is-desc',
 );
@@ -28,6 +28,11 @@
 
 $wgInviteSignupHash = null;
 
+/**
+ * List of groups the invitee will be promoted automatically.
+ */
+$wgISGroups = array();
+
 $wgHooks['BeforeInitialize'][] = function ( $title, $unused, $output, 
$user, $request ) {
if ( !$title-isSpecialPage() ) {
return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I637937c1a09b9de3eb6ec9a4e84ba2eb26cf739b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/InviteSignup
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com

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


[MediaWiki-commits] [Gerrit] changed namespaces a bit, added license - change (mediawiki...Wikibase)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: changed namespaces a bit, added license
..


changed namespaces a bit, added license

namespace for data and entity come now directly from
the settings. also a cc-license is added. the license
is not changeable in the settings for now.

Change-Id: Iea1d34372ba30466d8b76a3650c95cfabadc21dd
---
M repo/includes/WikibaseRepo.php
M repo/includes/rdf/RdfBuilder.php
M repo/includes/rdf/RdfSerializer.php
M repo/includes/specials/SpecialEntityData.php
M repo/tests/phpunit/includes/WikibaseRepoTest.php
M repo/tests/phpunit/includes/rdf/RdfBuilderTest.php
M repo/tests/phpunit/includes/rdf/RdfSerializerTest.php
7 files changed, 51 insertions(+), 32 deletions(-)

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



diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index d63ec1b..e2735dd 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -114,6 +114,7 @@
 
$uri = $wgServer;
$uri = preg_replace( '!^//!', 'http://', $uri );
+   $uri = $uri . '/entity/';
return $uri;
}
 
diff --git a/repo/includes/rdf/RdfBuilder.php b/repo/includes/rdf/RdfBuilder.php
index 2267357..38fb7e7 100755
--- a/repo/includes/rdf/RdfBuilder.php
+++ b/repo/includes/rdf/RdfBuilder.php
@@ -49,16 +49,17 @@
const NS_ONTOLOGY =  'wikibase'; // wikibase ontology (shared)
const NS_ENTITY ='entity';   // concept uris
const NS_DATA =  'data'; // document uris
-   const NS_PROPERTY =  'p'; // entity - value
const NS_VALUE = 'v'; // statement - value
const NS_QUALIFIER = 'q'; // statement - qualifier
const NS_STATEMENT = 's'; // entity - statement
 
const NS_SKOS = 'skos'; // SKOS vocabulary
const NS_SCHEMA_ORG = 'schema'; // schema.org vocabulary
+   const NS_CC = 'cc';
 
const SKOS_URI = 'http://www.w3.org/2004/02/skos/core#';
const SCHEMA_ORG_URI = 'http://schema.org/';
+   const CC_URI = 'http://creativecommons.org/ns#';
 
const WIKIBASE_STATEMENT_QNAME = 'wikibase:Statement';
 
@@ -86,6 +87,7 @@
 */
public function __construct(
$baseUri,
+   $dataUri,
EntityIdFormatter $idFormatter,
EasyRdf_Graph $graph = null
) {
@@ -95,18 +97,19 @@
 
$this-graph = $graph;
$this-baseUri = $baseUri;
+   $this-dataUri = $dataUri;
$this-idFormatter = $idFormatter;
 
$this-namespaces = array(
self::NS_ONTOLOGY = self::ONTOLOGY_BASE_URI,
-   self::NS_DATA = $this-baseUri . '/data/',
-   self::NS_ENTITY = $this-baseUri . '/entity/',
-   self::NS_PROPERTY = $this-baseUri . '/property/',
-   self::NS_VALUE = $this-baseUri . '/value/',
-   self::NS_QUALIFIER = $this-baseUri . '/qualifier/',
-   self::NS_STATEMENT = $this-baseUri . '/statement/',
+   self::NS_DATA = $this-dataUri,
+   self::NS_ENTITY = $this-baseUri,
+   self::NS_VALUE = $this-baseUri . 'value/',
+   self::NS_QUALIFIER = $this-baseUri . 'qualifier/',
+   self::NS_STATEMENT = $this-baseUri . 'statement/',
self::NS_SKOS = self::SKOS_URI,
self::NS_SCHEMA_ORG = self::SCHEMA_ORG_URI,
+   self::NS_CC = self::CC_URI,
);
 
//XXX: Ugh, static. Should go into $this-graph.
@@ -154,7 +157,7 @@
 * @return string
 */
public function getEntityQName( $prefix, EntityId $id ) {
-   return $prefix . ':' . $this-idFormatter-format( $id );
+   return $prefix . ':' . ucfirst( $this-idFormatter-format( $id 
) );
}
 
/**
@@ -205,7 +208,7 @@
 */
public function getDataURL( EntityId $id ) {
$base = $this-namespaces[ self::NS_DATA ];
-   $url = $base . $this-idFormatter-format( $id );
+   $url = $base . ucfirst( $this-idFormatter-format( $id ) );
return $url;
}
 
@@ -253,12 +256,13 @@
public function addEntityMetaData( Entity $entity, Revision $rev = null 
) {
$entityResource = $this-getEntityResource( $entity-getId() );
$entityResource-addResource( 'rdf:type', 
$this-getEntityTypeQName( $entity-getType() ) );
-
-   $dataResource = $this-graph-resource( '#' ); // this 
document
$dataURL = $this-getDataURL( $entity-getId() );
-   $dataResource-addResource( self::NS_SCHEMA_ORG . ':about', 
$entityResource );
-

[MediaWiki-commits] [Gerrit] Remove resize handles on surface teardown - change (mediawiki...VisualEditor)

2013-05-22 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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


Change subject: Remove resize handles on surface teardown
..

Remove resize handles on surface teardown

Add teardown call to surface destruction in mw target, and
teardown listener to resizeable node.

Bug: 48530
Change-Id: I807a0f32d3d1eb490456d887f7bf867bdb896df4
---
M modules/ve/ce/ve.ce.ResizableNode.js
M modules/ve/ce/ve.ce.View.js
M modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
3 files changed, 34 insertions(+), 1 deletion(-)


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

diff --git a/modules/ve/ce/ve.ce.ResizableNode.js 
b/modules/ve/ce/ve.ce.ResizableNode.js
index f15a8ad..50f7bc6 100644
--- a/modules/ve/ce/ve.ce.ResizableNode.js
+++ b/modules/ve/ce/ve.ce.ResizableNode.js
@@ -22,7 +22,11 @@
this.$resizeHandles = $( 'div' );
 
// Events
-   this.connect( this, { 'focus': 'onResizableFocus', 'blur': 
'onResizableBlur' } );
+   this.connect( this, {
+   'focus': 'onResizableFocus',
+   'blur': 'onResizableBlur',
+   'setup': 'onResizableSetup'
+   } );
 
// Initialization
this.$resizeHandles
@@ -79,6 +83,24 @@
 };
 
 /**
+ * Handle setup event.
+ *
+ * @method
+ */
+ve.ce.ResizableNode.prototype.onResizableSetup = function () {
+   this.root.getSurface().connect( this, { 'teardown': 
'onResizableTeardown' } );
+};
+
+/**
+ * Handle teardown event.
+ *
+ * @method
+ */
+ve.ce.ResizableNode.prototype.onResizableTeardown = function () {
+   this.$resizeHandles.detach();
+};
+
+/**
  * Handle bounding box handle mousedown.
  *
  * @method
diff --git a/modules/ve/ce/ve.ce.View.js b/modules/ve/ce/ve.ce.View.js
index 0b348d6..a286112 100644
--- a/modules/ve/ce/ve.ce.View.js
+++ b/modules/ve/ce/ve.ce.View.js
@@ -53,6 +53,14 @@
  * @event live
  */
 
+/**
+ * @event setup
+ */
+
+/**
+ * @event teardown
+ */
+
 /* Static Members */
 
 /**
@@ -135,6 +143,8 @@
  * @method
  * @param {boolean} live The view has been attached to the live DOM (use false 
on detach)
  * @emits live
+ * @emits setup
+ * @emits teardown
  */
 ve.ce.View.prototype.setLive = function ( live ) {
this.live = live;
diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js 
b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
index 3400ae9..381e2c1 100644
--- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
@@ -810,6 +810,7 @@
if ( this.surface ) {
this.editor.destroy();
this.editor = null;
+   this.surface.view.emit( 'teardown' );
this.surface.destroy();
this.surface = null;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I807a0f32d3d1eb490456d887f7bf867bdb896df4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders esand...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Don't use flush(), it interferes with output buffers - change (mediawiki...Wikibase)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Don't use flush(), it interferes with output buffers
..


Don't use flush(), it interferes with output buffers

Change-Id: I4262bebf04c90e9c2ee0d31cba2a9c83fc6b870b
---
M repo/includes/specials/SpecialEntityData.php
1 file changed, 2 insertions(+), 3 deletions(-)

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



diff --git a/repo/includes/specials/SpecialEntityData.php 
b/repo/includes/specials/SpecialEntityData.php
index ffd7843..a0d07d4 100755
--- a/repo/includes/specials/SpecialEntityData.php
+++ b/repo/includes/specials/SpecialEntityData.php
@@ -631,12 +631,11 @@
$response-header( 'Cache-Control: ' . $mode . ', s-maxage=' . 
$smaxage . ', max-age=' . $maxage );
 
$this-getOutput()-disable(); // don't generate HTML
-   ob_clean();
+   ob_clean(); // remove anything that might already be in the 
output buffer.
 
print $data;
-   flush();
 
-   //die(); //FIXME: figure out how to best shut down here.
+   // exit normally here, keeping all levels of output buffering.
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4262bebf04c90e9c2ee0d31cba2a9c83fc6b870b
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.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] (bug 40341) Enable translation import on wikis with Translat... - change (operations/mediawiki-config)

2013-05-22 Thread Nemo bis (Code Review)
Nemo bis has uploaded a new change for review.

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


Change subject: (bug 40341) Enable translation import on wikis with Translate 
extension
..

(bug 40341) Enable translation import on wikis with Translate extension

Add one missing piece, the user right.

Bug: 40341
Change-Id: I9f6b620c69b559214aa87d8fc96a19436a5687ee
---
M wmf-config/CommonSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 0847ab2..3faf844 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2031,6 +2031,7 @@
$wgGroupPermissions['*']['translate'] = true;
$wgGroupPermissions['translationadmin']['pagetranslation'] = true;
$wgGroupPermissions['translationadmin']['translate-manage'] = true;
+   $wgGroupPermissions['translationadmin']['translate-import'] = true; // 
bug 40341
$wgGroupPermissions['user']['translate-messagereview'] = true;
$wgGroupPermissions['user']['translate-groupreview'] = true;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f6b620c69b559214aa87d8fc96a19436a5687ee
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] Show HTML representation of detailed error-message in error-... - change (mediawiki...Wikibase)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Show HTML representation of detailed error-message in 
error-tooltip
..


Show HTML representation of detailed error-message in error-tooltip

Bug: 46369
Bug: 46073
Bug: 41602

Change-Id: I72778dbed2c30fe18d921895d42e23c6ee4af8ce
---
M lib/resources/wikibase.RepoApi/wikibase.RepoApiError.js
M lib/resources/wikibase.ui.Tooltip.js
2 files changed, 8 insertions(+), 2 deletions(-)

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

Objections:
  Hoo man: There's a problem with this change, please improve



diff --git a/lib/resources/wikibase.RepoApi/wikibase.RepoApiError.js 
b/lib/resources/wikibase.RepoApi/wikibase.RepoApiError.js
index 9779b12..b40cae2 100644
--- a/lib/resources/wikibase.RepoApi/wikibase.RepoApiError.js
+++ b/lib/resources/wikibase.RepoApi/wikibase.RepoApiError.js
@@ -99,7 +99,13 @@
var detailedMessage = '';
 
if ( details.error ) {
-   detailedMessage = details.error.info;
+   if ( details.error.messages  
details.error.messages.html ) {
+   // TODO: where does this * come from? we 
should get rid of it!
+   // TODO: there's a \n inside the HTML, we 
should get rid of it in the backend.
+   detailedMessage = 
details.error.messages.html['*'];
+   } else {
+   detailedMessage = details.error.info;
+   }
} else if ( details.exception ) {
errorCode = details.textStatus;
detailedMessage = details.exception;
diff --git a/lib/resources/wikibase.ui.Tooltip.js 
b/lib/resources/wikibase.ui.Tooltip.js
index 62241e3..82d52f2 100644
--- a/lib/resources/wikibase.ui.Tooltip.js
+++ b/lib/resources/wikibase.ui.Tooltip.js
@@ -157,7 +157,7 @@
 
var $detailedMessage = $( 'div/', {
'class': 'wb-tooltip-error-details',
-   text: this._error.detailedMessage
+   html: this._error.detailedMessage
} ).hide(); // hide detail message initially!
 
var $toggler = $( 'a/' )

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I72778dbed2c30fe18d921895d42e23c6ee4af8ce
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Daniel Werner daniel.wer...@wikimedia.de
Gerrit-Reviewer: Henning Snater henning.sna...@wikimedia.de
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.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] Purging of cached output from Special:EntityData. - change (mediawiki...Wikibase)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: Purging of cached output from Special:EntityData.
..


Purging of cached output from Special:EntityData.

This will cause Special:EntityData to purge HTTP caches
if action=purge is given in the URL. Note that currently,
only the presently requested format of the output is purged.

Change-Id: Ic13fb09ad5abbeafe2b527c07245cf20ea4f737a
---
M repo/includes/specials/SpecialEntityData.php
1 file changed, 46 insertions(+), 0 deletions(-)

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



diff --git a/repo/includes/specials/SpecialEntityData.php 
b/repo/includes/specials/SpecialEntityData.php
index c086a97..a241509 100755
--- a/repo/includes/specials/SpecialEntityData.php
+++ b/repo/includes/specials/SpecialEntityData.php
@@ -120,6 +120,8 @@
$revision = 0;
$format = '';
 
+   $requestedSubPage = $subPage;
+
// get format from $subPage or request param
if ( preg_match( '#\.([-./\w]+)$#', $subPage, $m ) ) {
$subPage = preg_replace( '#\.([-./\w]+)$#', '', 
$subPage );
@@ -144,6 +146,11 @@
if ( $id === null || $id === '' ) {
$this-showForm();
return;
+   }
+
+   //XXX: allow for logged in users only?
+   if ( $this-getRequest()-getText( 'action', 'purge' ) ) {
+   $this-purge( $id, $format, $revision );
}
 
if ( $format === null || $format === '' ) {
@@ -178,6 +185,45 @@
}
 
/**
+* Purges the entity data identified by the subPage parameter from any 
HTTP caches.
+*
+* @param string $id
+* @param string $format
+* @param int$revision
+*/
+   protected function purge( $id, $format = '', $revision = 0 ) {
+   global $wgUseSquid;
+
+   if ( $wgUseSquid ) {
+   //TODO: purge all formats based on the ID, instead of 
just the one currently requested
+   $subPage = $this-getSubPageName( $id, $format, 
$revision );
+
+   $title = $this-getTitle( $subPage );
+
+   $urls = array();
+   $urls[] = $title-getInternalURL();
+
+   $u = new SquidUpdate( $urls );
+   $u-doUpdate();
+   }
+   }
+
+   public function getSubPageName( $id, $format, $revision ) {
+   //TODO: force canonical ID (upper- or lower case) by redirecting
+   $subPage = $id;
+
+   if ( $revision  0 ) {
+   $subPage .= ':' . $revision;
+   }
+
+   if ( $format !== null  $format !== '' ) {
+   $subPage .= '.' . $format;
+   }
+
+   return $subPage;
+   }
+
+   /**
 * Returns the list of supported MIME types that can be used to specify 
the
 * output format.
 *

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic13fb09ad5abbeafe2b527c07245cf20ea4f737a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.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] Config setting for cache duration of entity data. - change (mediawiki...Wikibase)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: Config setting for cache duration of entity data.
..


Config setting for cache duration of entity data.

This introduces $wgWBRepoSettings['dataSquidMaxage'] instead
of using $wgSquidMaxage to determine the cache duration for
the output of Special:EntityData. $wgWBRepoSettings['dataSquidMaxage']
defaults to $wgSquidMaxage, but should be overwritten when and where
$wgSquidMaxage is larger than a few hours, since entity data isn't
automatically purged from HTTP caches.

Change-Id: I1dabe792619c5ebd690bfe3e7bf5cd28eb5f19c9
---
M repo/config/Wikibase.default.php
M repo/includes/specials/SpecialEntityData.php
2 files changed, 18 insertions(+), 8 deletions(-)

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



diff --git a/repo/config/Wikibase.default.php b/repo/config/Wikibase.default.php
index da4768c..2bf1276 100644
--- a/repo/config/Wikibase.default.php
+++ b/repo/config/Wikibase.default.php
@@ -30,6 +30,7 @@
  */
 
 return call_user_func( function() {
+   global $wgSquidMaxage;
 
$defaults = array(
 
@@ -72,6 +73,10 @@
 
// Should the page names (titles) be normalized against the 
external site
'normalizeItemByTitlePageNames' = false,
+
+   // Number of seconds for which data output shall be cached.
+   // Note: keep that low, because such caches can not always be 
purged easily.
+   'dataSquidMaxage' = $wgSquidMaxage,
);
 
return $defaults;
diff --git a/repo/includes/specials/SpecialEntityData.php 
b/repo/includes/specials/SpecialEntityData.php
index c086a97..368445b 100755
--- a/repo/includes/specials/SpecialEntityData.php
+++ b/repo/includes/specials/SpecialEntityData.php
@@ -89,6 +89,11 @@
protected $idFormatter = null;
 
/**
+* @var int Cache dureation in seconds
+*/
+   protected $maxAge = 0;
+
+   /**
 * @var null|array Associative array from MIME type to format name
 * @note: initialized by initFormats()
 */
@@ -173,6 +178,7 @@
$this-entityLookup = 
\Wikibase\StoreFactory::getStore()-getEntityLookup();
$this-dataTypeFactory = $repo-getDataTypeFactory();
$this-idFormatter = $repo-getIdFormatter();
+   $this-maxAge = \Wikibase\Settings::get( 'dataSquidMaxage' );
 
$this-showData( $format, $id, $revision );
}
@@ -606,25 +612,24 @@
 * @param Revision $revision
 */
public function outputData( $data, $contentType, Revision $revision = 
null ) {
-   global $wgSquidMaxage;
-
// NOTE: similar code as in RawAction::onView, keep in sync.
 
$request = $this-getRequest();
$response = $request-response();
 
-   $maxage = $request-getInt( 'maxage', $wgSquidMaxage );
-   $smaxage = $request-getInt( 'smaxage', $wgSquidMaxage );
+   $maxage = $request-getInt( 'maxage', $this-maxAge );
+   $smaxage = $request-getInt( 'smaxage', $this-maxAge );
 
-   // Sanity: 0 to 30 days. // todo: Hard maximum could be 
configurable somehow.
-   $maxage  = max( 0, min( 60 * 60 * 24 * 30, $maxage ) );
-   $smaxage = max( 0, min( 60 * 60 * 24 * 30, $smaxage ) );
+   // XXX: do we want public caching even for data from old 
revisions?
+   // Sanity: 0 to 31 days. // todo: Hard maximum could be 
configurable somehow.
+   $maxage  = max( 0, min( 60 * 60 * 24 * 31, $maxage ) );
+   $smaxage = max( 0, min( 60 * 60 * 24 * 31, $smaxage ) );
 
$response-header( 'Content-Type: ' . $contentType . '; 
charset=UTF-8' );
$response-header( 'Content-Length: ' . strlen( $data ) );
 
if ( $revision ) {
-   $response-header( 'Last-Modified: ' . wfTimestamp( 
TS_ISO_8601, $revision-getTimestamp() ) );
+   $response-header( 'Last-Modified: ' . wfTimestamp( 
TS_RFC2822, $revision-getTimestamp() ) );
}
 
//Set X-Frame-Options API results (bug 39180)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1dabe792619c5ebd690bfe3e7bf5cd28eb5f19c9
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.de
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org

[MediaWiki-commits] [Gerrit] Add option to add a footer to a property page. See bugzilla ... - change (mediawiki...Wikibase)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add option to add a footer to a property page. See bugzilla bug 
#48601
..


Add option to add a footer to a property page. See bugzilla bug #48601

Bug: 48601
Change-Id: I7f8c2de1a2b73f6d28c515ffe68ecebb5e9a46c5
---
M repo/Wikibase.i18n.php
M repo/includes/PropertyView.php
2 files changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/repo/Wikibase.i18n.php b/repo/Wikibase.i18n.php
index c4ec56e..df2c8b6 100644
--- a/repo/Wikibase.i18n.php
+++ b/repo/Wikibase.i18n.php
@@ -70,6 +70,7 @@
'wikibase-aliases-input-help-message' = 'If this data set is known 
under more than one particular name, you may enter aliases and synonyms, so it 
can be found by its alternative names.',
'wikibase-aliases-empty' = 'No aliases defined.',
'wikibase-datatype-label' = 'Data type:',
+   'wikibase-property-footer' = '', # do not translate or duplicate this 
message to other languages
'wikibase-claimview-snak-tooltip' = 'Enter a value corresponding to 
the property named $1. If the property has no designated value or the actual 
value is not known, you may choose an alternative to specifying a custom value 
by clicking the icon next to the value input box.',
'wikibase-claimview-snak-new-tooltip' = 'After specifying a property 
you can enter a corresponding value. If the property has no designated value or 
the actual value is not known, you may choose an alternative to specifying a 
custom value by clicking the icon next to the value input box.',
'wikibase-statementview-referencesheading-pendingcountersubject' = 
'{{PLURAL:$1|source|sources}}',
diff --git a/repo/includes/PropertyView.php b/repo/includes/PropertyView.php
index e63cc53..e8df0bf 100644
--- a/repo/includes/PropertyView.php
+++ b/repo/includes/PropertyView.php
@@ -50,6 +50,11 @@
/** @var PropertyContent $property */
$html .= $this-getHtmlForDataType( 
$property-getProperty()-getDataType(), $lang, $editable );
// TODO: figure out where to display type information more 
nicely
+   # Customizable footer
+   $footer = $this-msg( 'wikibase-property-footer' );
+   if ( !$footer-isBlank() ) {
+   $html .= \n . $footer-parse();
+   }
 
wfProfileOut( __METHOD__ );
return $html;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f8c2de1a2b73f6d28c515ffe68ecebb5e9a46c5
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Multichill maar...@mdammers.nl
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Multichill maar...@mdammers.nl
Gerrit-Reviewer: Siebrand siebr...@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] (bug 48224) Format site link already used message with corre... - change (mediawiki...Wikibase)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: (bug 48224) Format site link already used message with correct 
link
..


(bug 48224) Format site link already used message with correct link

Together with https://gerrit.wikimedia.org/r/#/c/64083/, this would improve 
error messaging.

Change-Id: Ie9daf6bb4094ac8e41a3a874809cedd5ae2031a3
---
M repo/Wikibase.i18n.php
M repo/includes/content/ItemContent.php
M repo/tests/phpunit/includes/content/ItemContentTest.php
3 files changed, 86 insertions(+), 19 deletions(-)

Approvals:
  Tobias Gritschacher: Looks good to me, but someone else must approve
  Daniel Kinzler: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/Wikibase.i18n.php b/repo/Wikibase.i18n.php
index da1d4a4..a847571 100644
--- a/repo/Wikibase.i18n.php
+++ b/repo/Wikibase.i18n.php
@@ -102,7 +102,7 @@
'wikibase-error-constraint-violation-description' = 'There is 
{{PLURAL:$1|a constraint|constraints}} violation for 
{{PLURAL:$1|description|descriptions}} $3 for {{PLURAL:$1|language 
code|language codes}} $2.',
'wikibase-error-constraint-violation-aliases' = 'There is 
{{PLURAL:$1|a constraint|constraints}} violation for 
{{PLURAL:$1|alias|aliases}} $3 for {{PLURAL:$1|language code|language codes}} 
$2.',
 
-   'wikibase-error-sitelink-already-used' = 'Site link [[$1:$2]] already 
used by item [[$3]].',
+   'wikibase-error-sitelink-already-used' = 'Site link [$1 $2] already 
used by item [[$3]].',
'wikibase-error-label-not-unique-wikibase-property' = 'Another 
property ($3) already has label $1 associated with language code $2',
'wikibase-error-label-not-unique-wikibase-query' = 'Another query ($3) 
already has label $1 associated with language code $2',
'wikibase-error-label-not-unique-item' = 'Another item ($3) already 
has label $1 and description $4 associated with language code $2',
@@ -611,9 +611,9 @@
 * $2 - the violating languages
 * $3 - the violating string, but this is usually not very useful as the 
message is usually given in an edit window', # Fuzzy
'wikibase-error-sitelink-already-used' = Error message shown when an 
item can't be saved because it contains a site link already used by another 
item. Parameters:
-* $1 is the site id (interwiki prefix);
-* $2 is the title on the remote site;
-* $3 is the title of the conflicting item.,
+* $1 is the url to the remote client page;
+* $2 is the title on the remote client site;
+* $3 is the item (e.g. Q60) on the repo with the conflicting site link.,
'wikibase-error-label-not-unique-wikibase-property' = 'Error message 
shown when a user tries to save a property that has a non-unique label.
 * $1 is label text
 * $2 is the labels language code
@@ -1318,7 +1318,7 @@
'wikibase-shortcopyrightwarning' = 'Al calcar en $1, aceuta [[$2|les 
condiciones d\'usu]] y aceuta ensin vuelta lliberar les sos collaboraciones 
baxo la $3.',
'wikibase-copyrighttooltip-acknowledge' = 'Aceuto estes condiciones pa 
les mios futures ediciones. Nun volver a amosar esti mensaxe.',
'wikibase-entityselector-more' = 'más',
-   'wikibase-anonymouseditwarning' = Avisu: Nun anició sesión. 
+   'wikibase-anonymouseditwarning' = Avisu: Nun anició sesión.
 La direición IP quedará rexistrada nel historial d'ediciones de $1.,
'wikibase-restrictionedit-tooltip-message' = 'Esta páxina ta 
protexida. Nun se permite la edición.',
'wikibase-blockeduser-tooltip-message' = Nun tien permisu pa editar 
porque'l so nome d'usuariu o direición IP tan bloquiaos.,
diff --git a/repo/includes/content/ItemContent.php 
b/repo/includes/content/ItemContent.php
index 91adc7f..ad10807 100644
--- a/repo/includes/content/ItemContent.php
+++ b/repo/includes/content/ItemContent.php
@@ -147,27 +147,43 @@
$conflicts = 
StoreFactory::getStore()-newSiteLinkCache()-getConflictsForItem( 
$this-getItem(), $db );
 
foreach ( $conflicts as $conflict ) {
-   $id = new EntityId( Item::ENTITY_TYPE, 
$conflict['itemId'] );
+   $msg = $this-getConflictMessage( $conflict );
 
-   /**
-* @var WikiPage $ipsPage
-*/
-   $conflictingPage = 
EntityContentFactory::singleton()-getWikiPageForId( $id );
-
-   // NOTE: it would be nice to generate the link here and 
just pass it as HTML,
-   // but Status forces all parameters to be escaped.
-   $status-fatal(
-   'wikibase-error-sitelink-already-used',
-   $conflict['siteId'],
-   $conflict['sitePage'],
-   $conflictingPage-getTitle()-getFullText()
-   );
+   $status-fatal( $msg );

[MediaWiki-commits] [Gerrit] Fixed last patch I853496a860742ba906b756b26f4c13b51bacb82f - change (mediawiki...ZeroRatedMobileAccess)

2013-05-22 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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


Change subject: Fixed last patch I853496a860742ba906b756b26f4c13b51bacb82f
..

Fixed last patch I853496a860742ba906b756b26f4c13b51bacb82f

Removed duplicate returns

Change-Id: I3bac0cd2bc9423972c608bfc86bb15ccb3e4b4d7
---
M includes/CarrierConfig.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroRatedMobileAccess 
refs/changes/20/64920/1

diff --git a/includes/CarrierConfig.php b/includes/CarrierConfig.php
index 68e700e..14a5de1 100644
--- a/includes/CarrierConfig.php
+++ b/includes/CarrierConfig.php
@@ -217,7 +217,6 @@
 CarrierConfig::isArrayOfLangs( 
array_keys( $v ) )
 CarrierConfig::isArrayOfStrings( $v )
? null : 
'zeroconfig-lang_name_overrides';
-   return array( null, $v );
} );
 
// Background banner color

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3bac0cd2bc9423972c608bfc86bb15ccb3e4b4d7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess
Gerrit-Branch: master
Gerrit-Owner: Yurik yu...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Inject settings into api client info module - change (mediawiki...Wikibase)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Inject settings into api client info module
..


Inject settings into api client info module

Change-Id: Iba2a88813d177504fb71e47df2f8defc12d0abc8
---
M client/includes/api/ApiClientInfo.php
M client/tests/phpunit/includes/api/ApiClientInfoTest.php
2 files changed, 138 insertions(+), 37 deletions(-)

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



diff --git a/client/includes/api/ApiClientInfo.php 
b/client/includes/api/ApiClientInfo.php
index 9e201e1..563e241 100644
--- a/client/includes/api/ApiClientInfo.php
+++ b/client/includes/api/ApiClientInfo.php
@@ -33,14 +33,19 @@
  */
 class ApiClientInfo extends \ApiQueryBase {
 
+   protected $settings;
+
/**
 * @since 0.4
 *
-* @param $api ApiBase
-* @param $moduleName string
+* @param ApiBase $api
+* @param string $moduleName
 */
public function __construct( $api, $moduleName ) {
parent::__construct( $api, $moduleName, 'wb' );
+
+   // @todo inject this instead of using singleton here
+   $this-settings = Settings::singleton();
}
 
/**
@@ -51,34 +56,51 @@
public function execute() {
$params = $this-extractRequestParams();
 
+   $apiData = $this-getRepoInfo( $params );
+
+   $this-getResult()-addValue( 'query', 'wikibase', $apiData );
+   }
+
+   /**
+* Set settings for api module
+*
+* @since 0.4
+*
+* @param SettingsArray $settings
+*/
+   public function setSettings( SettingsArray $settings ) {
+   $this-settings = $settings;
+   }
+
+   /**
+* Gets repo url info to inject into the api module
+*
+* @since 0.4
+*
+* @param array $params[]
+*
+* @return array
+*/
+   public function getRepoInfo( array $params ) {
$data = array( 'repo' = array() );
+
+   $repoUrlArray = array(
+   'base' = $this-settings-getSetting( 'repoUrl' ),
+   'scriptpath' = $this-settings-getSetting( 
'repoScriptPath' ),
+   'articlepath' = $this-settings-getSetting( 
'repoArticlePath' ),
+   );
 
foreach ( $params['prop'] as $p ) {
switch ( $p ) {
case 'url':
-   $data['repo']['url'] = $this-urlInfo();
+   $data['repo']['url'] = $repoUrlArray;
break;
default;
break;
}
}
 
-   $this-getResult()-addValue( 'query', 'wikibase', $data );
-   }
-
-   /**
-* Provides url settings for the associated Wikibase repo
-*
-* @since 0.4
-*
-* @return array
-*/
-   public function urlInfo() {
-   return array(
-   'base' = Settings::get( 'repoUrl' ),
-   'scriptpath' = Settings::get( 'repoScriptPath' ),
-   'articlepath' = Settings::get( 'repoArticlePath' ),
-   );
+   return $data;
}
 
/**
diff --git a/client/tests/phpunit/includes/api/ApiClientInfoTest.php 
b/client/tests/phpunit/includes/api/ApiClientInfoTest.php
index 3294e26..808aa2a 100644
--- a/client/tests/phpunit/includes/api/ApiClientInfoTest.php
+++ b/client/tests/phpunit/includes/api/ApiClientInfoTest.php
@@ -1,6 +1,8 @@
 ?php
-
 namespace Wikibase\Test;
+
+use Wikibase\SettingsArray;
+use Wikibase\ApiClientInfo;
 
 /**
  * Tests for ApiClientInfo module.
@@ -37,23 +39,57 @@
  * @licence GNU GPL v2+
  * @author Katie Filbert  aude.w...@gmail.com 
  */
-class ApiClientInfoTest extends \ApiTestCase {
+class ApiClientInfoTest extends \MediaWikiTestCase {
 
-   public function testGetUrlInfo() {
-   $data = $this-doApiRequest(
-   array(
-   'action' = 'query',
-   'meta' = 'wikibase',
-   'wbprop' = 'url',
-   )
-   );
+   protected $apiContext;
 
-   $this-assertArrayHasKey( 'query', $data[0] );
-   $this-assertArrayHasKey( 'wikibase', $data[0]['query'] );
-   $this-assertArrayHasKey( 'repo', $data[0]['query']['wikibase'] 
);
-   $this-assertArrayHasKey( 'url', 
$data[0]['query']['wikibase']['repo'] );
+   public function setUp() {
+   parent::setUp();
 
-   $urlInfo = $data[0]['query']['wikibase']['repo']['url'];
+   $this-apiContext = 

[MediaWiki-commits] [Gerrit] More documentation of bz2 multistream and index files - change (operations/dumps)

2013-05-22 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review.

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


Change subject: More documentation of bz2 multistream and index files
..

More documentation of bz2 multistream and index files

Change-Id: I8878cde3327d9832840ff2e4296dd74dc0085f88
---
M toys/bz2multistream/INSTALL.txt
M toys/bz2multistream/README.txt
2 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps 
refs/changes/21/64921/1

diff --git a/toys/bz2multistream/INSTALL.txt b/toys/bz2multistream/INSTALL.txt
index c13fca5..733c686 100644
--- a/toys/bz2multistream/INSTALL.txt
+++ b/toys/bz2multistream/INSTALL.txt
@@ -1,7 +1,12 @@
 Here's the preparation you will need to do in order to use the reader:
 
 * Create a multistream bz2 file from the XML file of article texts you wish to 
use.
+  This will contain concatenated bz2 streams, each stream containing 100 pages,
+  and each stream capable of being treated as a separate bz2 file as far as
+  bzip2 libraries or the language bindings of your choice go.
 * Create an index file for the multistream bz2 file.
+  This will contain lines with the following:
+  file-offset:page-id:page-title lines
 * Create a sorted version of the index file (beware, on some platforms 
including linux
   you must specify the C locale for sort not to give an ordering useless for 
the next step)
 * Create a ToC file for the index file.
diff --git a/toys/bz2multistream/README.txt b/toys/bz2multistream/README.txt
index 64fe3de..a3c1bd4 100644
--- a/toys/bz2multistream/README.txt
+++ b/toys/bz2multistream/README.txt
@@ -15,8 +15,9 @@
 or contributors who may want to work with specific multiple article texts
 at once in an automated fashion.
 
-See INSTALL.txt for how to generated the needed files and how
-to run the article text retrieval script.
+See INSTALL.txt for how to generated the needed files, the contents
+of the bz2 content and index files, and how to run the article text
+retrieval script.
 
 Platforms:
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8878cde3327d9832840ff2e4296dd74dc0085f88
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: ariel
Gerrit-Owner: ArielGlenn ar...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Revert Remove redundant focus handler - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

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


Change subject: Revert Remove redundant focus handler
..

Revert Remove redundant focus handler

This reverts commit 739d952a819ca44e5e414c40e927c2d7f67fe89d.
Bug: 48703

Change-Id: Ib66ed3c824f0bd5e68258eb5a39b8affc8b50e9f
---
M resources/js/ext.uls.ime.js
1 file changed, 9 insertions(+), 2 deletions(-)


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

diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js
index ec1cd02..e645dc2 100644
--- a/resources/js/ext.uls.ime.js
+++ b/resources/js/ext.uls.ime.js
@@ -154,7 +154,8 @@
mw.ime.setup = function () {
 
$( 'body' ).on( 'focus.ime', inputSelector, function () {
-   var $input = $( this );
+   var imeselector,
+   $input = $( this );
 
$input.ime( {
languages: mw.ime.getIMELanguageList(),
@@ -179,7 +180,13 @@
 
return $ulsTrigger;
}
-   } ).focus();
+   } );
+
+   // Some fields may be uninitialized
+   imeselector = $input.data( 'imeselector' );
+   if ( imeselector ) {
+   imeselector.selectLanguage( 
$.ime.preferences.getLanguage() );
+   }
} );
 
};

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib66ed3c824f0bd5e68258eb5a39b8affc8b50e9f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com

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


[MediaWiki-commits] [Gerrit] More documentation of bz2 multistream and index files - change (operations/dumps)

2013-05-22 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: More documentation of bz2 multistream and index files
..


More documentation of bz2 multistream and index files

Change-Id: I8878cde3327d9832840ff2e4296dd74dc0085f88
---
M toys/bz2multistream/INSTALL.txt
M toys/bz2multistream/README.txt
2 files changed, 8 insertions(+), 2 deletions(-)

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



diff --git a/toys/bz2multistream/INSTALL.txt b/toys/bz2multistream/INSTALL.txt
index c13fca5..733c686 100644
--- a/toys/bz2multistream/INSTALL.txt
+++ b/toys/bz2multistream/INSTALL.txt
@@ -1,7 +1,12 @@
 Here's the preparation you will need to do in order to use the reader:
 
 * Create a multistream bz2 file from the XML file of article texts you wish to 
use.
+  This will contain concatenated bz2 streams, each stream containing 100 pages,
+  and each stream capable of being treated as a separate bz2 file as far as
+  bzip2 libraries or the language bindings of your choice go.
 * Create an index file for the multistream bz2 file.
+  This will contain lines with the following:
+  file-offset:page-id:page-title lines
 * Create a sorted version of the index file (beware, on some platforms 
including linux
   you must specify the C locale for sort not to give an ordering useless for 
the next step)
 * Create a ToC file for the index file.
diff --git a/toys/bz2multistream/README.txt b/toys/bz2multistream/README.txt
index 64fe3de..a3c1bd4 100644
--- a/toys/bz2multistream/README.txt
+++ b/toys/bz2multistream/README.txt
@@ -15,8 +15,9 @@
 or contributors who may want to work with specific multiple article texts
 at once in an automated fashion.
 
-See INSTALL.txt for how to generated the needed files and how
-to run the article text retrieval script.
+See INSTALL.txt for how to generated the needed files, the contents
+of the bz2 content and index files, and how to run the article text
+retrieval script.
 
 Platforms:
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8878cde3327d9832840ff2e4296dd74dc0085f88
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: ariel
Gerrit-Owner: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: ArielGlenn ar...@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] tidying up layout of SD 'filters' - change (mediawiki...SemanticDrilldown)

2013-05-22 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: tidying up layout of SD 'filters'
..


tidying up layout of SD 'filters'

Change-Id: I782e9b7b4c1e1e1314099ef3c5a85c6dcd5c76b1
---
M specials/SD_BrowseData.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Yaron Koren: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/specials/SD_BrowseData.php b/specials/SD_BrowseData.php
index 9bdf8e0..0ceac38 100644
--- a/specials/SD_BrowseData.php
+++ b/specials/SD_BrowseData.php
@@ -604,7 +604,7 @@
foreach ( $filter_values as $value_str = $num_results ) {
if ( $num_printed_values++  0 ) { $results_line .=  · 
; }
$filter_text = $this-printFilterValue( $f, $value_str 
);
-   $filter_text .=  ($num_results);
+   $filter_text .= nbsp;($num_results);
$filter_url = $cur_url . urlencode( str_replace( ' ', 
'_', $f-name ) ) . '=' . urlencode( str_replace( ' ', '_', $value_str ) );
if ( $sdgFiltersSmallestFontSize  0  
$sdgFiltersLargestFontSize  0 ) {
$font_size = round( $font_size_midpoint + ( ( 
$num_results - $num_results_midpoint ) / $num_results_per_font_pixel ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I782e9b7b4c1e1e1314099ef3c5a85c6dcd5c76b1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticDrilldown
Gerrit-Branch: master
Gerrit-Owner: Dan Bolser dan.bol...@gmail.com
Gerrit-Reviewer: Yaron Koren yaro...@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] Donot show ULS in weird positions - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

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


Change subject: Donot show ULS in weird positions
..

Donot show ULS in weird positions

ULS was shown relative to input field position. That will not work
always. Show it in default position(center of screen)

Change-Id: I5fd9f10d955322abd2623ce8b88792b391553dcd
---
M resources/js/ext.uls.ime.js
1 file changed, 1 insertion(+), 3 deletions(-)


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

diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js
index e645dc2..0b2c745 100644
--- a/resources/js/ext.uls.ime.js
+++ b/resources/js/ext.uls.ime.js
@@ -173,9 +173,7 @@
$input.focus();
},
lazyload: false,
-   languages: 
mw.ime.getLanguagesWithIME(),
-   top: $input.offset().top,
-   left: $input.offset().left
+   languages: 
mw.ime.getLanguagesWithIME()
} );
 
return $ulsTrigger;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fd9f10d955322abd2623ce8b88792b391553dcd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com

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


[MediaWiki-commits] [Gerrit] adding log-scale option for tag-cloud - change (mediawiki...SemanticDrilldown)

2013-05-22 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: adding log-scale option for tag-cloud
..


adding log-scale option for tag-cloud

Change-Id: Iaad92f14e055c714ae4dc0764f7677e694ee04b6
---
M SemanticDrilldown.php
M specials/SD_BrowseData.php
2 files changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Yaron Koren: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/SemanticDrilldown.php b/SemanticDrilldown.php
index 1b0c58b..98f05a5 100644
--- a/SemanticDrilldown.php
+++ b/SemanticDrilldown.php
@@ -121,6 +121,8 @@
 // set these to a positive value to trigger the tag cloud display
 $sdgFiltersSmallestFontSize = - 1;
 $sdgFiltersLargestFontSize = - 1;
+// logarithmic scale?
+$sdgFiltersLogScale = 0;
 // print categories list as tabs
 $sdgShowCategoriesAsTabs = false;
 
diff --git a/specials/SD_BrowseData.php b/specials/SD_BrowseData.php
index 8b502fe..7eeca19 100644
--- a/specials/SD_BrowseData.php
+++ b/specials/SD_BrowseData.php
@@ -587,7 +587,7 @@
}
 
function printUnappliedFilterValues( $cur_url, $f, $filter_values ) {
-   global $sdgFiltersSmallestFontSize, $sdgFiltersLargestFontSize;
+   global $sdgFiltersSmallestFontSize, $sdgFiltersLargestFontSize, 
$sdgFiltersLogScale;
 
$results_line = ;
// set font-size values for filter tag cloud, if the
@@ -596,6 +596,9 @@
$lowest_num_results = min( $filter_values );
$highest_num_results = max( $filter_values );
$scale_factor = ( $sdgFiltersLargestFontSize - 
$sdgFiltersSmallestFontSize ) / ( $highest_num_results - $lowest_num_results );
+if( $sdgFiltersLogScale ){
+  $scale_factor = ( $sdgFiltersLargestFontSize - 
$sdgFiltersSmallestFontSize ) / ( log($highest_num_results) - 
log($lowest_num_results) );
+}
}
// now print the values
$num_printed_values = 0;
@@ -606,6 +609,9 @@
$filter_url = $cur_url . urlencode( str_replace( ' ', 
'_', $f-name ) ) . '=' . urlencode( str_replace( ' ', '_', $value_str ) );
if ( $sdgFiltersSmallestFontSize  0  
$sdgFiltersLargestFontSize  0 ) {
$font_size = round( (($num_results - 
$lowest_num_results) * $scale_factor ) +  $sdgFiltersSmallestFontSize );
+if( $sdgFiltersLogScale ){
+  $font_size = round( ((log($num_results) - 
log($lowest_num_results)) * $scale_factor ) +  $sdgFiltersSmallestFontSize );
+}
$results_line .= \n
 . 'a href=' . $filter_url . ' title=' . wfMsg( 
'sd_browsedata_filterbyvalue' ) . ' style=font-size: ' . $font_size . 'px' 
. $filter_text . '/a';
} else {
$results_line .= \n
 . 'a href=' . $filter_url . ' title=' . wfMsg( 
'sd_browsedata_filterbyvalue' ) . '' . $filter_text . '/a';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaad92f14e055c714ae4dc0764f7677e694ee04b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticDrilldown
Gerrit-Branch: master
Gerrit-Owner: Dan Bolser dan.bol...@gmail.com
Gerrit-Reviewer: Yaron Koren yaro...@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] Revert Remove redundant focus handler - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert Remove redundant focus handler
..


Revert Remove redundant focus handler

This reverts commit 739d952a819ca44e5e414c40e927c2d7f67fe89d.
Bug: 48703

Change-Id: Ib66ed3c824f0bd5e68258eb5a39b8affc8b50e9f
---
M resources/js/ext.uls.ime.js
1 file changed, 9 insertions(+), 2 deletions(-)

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



diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js
index ec1cd02..e645dc2 100644
--- a/resources/js/ext.uls.ime.js
+++ b/resources/js/ext.uls.ime.js
@@ -154,7 +154,8 @@
mw.ime.setup = function () {
 
$( 'body' ).on( 'focus.ime', inputSelector, function () {
-   var $input = $( this );
+   var imeselector,
+   $input = $( this );
 
$input.ime( {
languages: mw.ime.getIMELanguageList(),
@@ -179,7 +180,13 @@
 
return $ulsTrigger;
}
-   } ).focus();
+   } );
+
+   // Some fields may be uninitialized
+   imeselector = $input.data( 'imeselector' );
+   if ( imeselector ) {
+   imeselector.selectLanguage( 
$.ime.preferences.getLanguage() );
+   }
} );
 
};

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib66ed3c824f0bd5e68258eb5a39b8affc8b50e9f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com
Gerrit-Reviewer: Amire80 amir.ahar...@mail.huji.ac.il
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Do not show ULS in weird positions - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Do not show ULS in weird positions
..


Do not show ULS in weird positions

ULS was shown relative to input field position. That will not work
always. Show it in default position - center of screen.

Change-Id: I5fd9f10d955322abd2623ce8b88792b391553dcd
---
M resources/js/ext.uls.ime.js
1 file changed, 1 insertion(+), 3 deletions(-)

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



diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js
index e645dc2..0b2c745 100644
--- a/resources/js/ext.uls.ime.js
+++ b/resources/js/ext.uls.ime.js
@@ -173,9 +173,7 @@
$input.focus();
},
lazyload: false,
-   languages: 
mw.ime.getLanguagesWithIME(),
-   top: $input.offset().top,
-   left: $input.offset().left
+   languages: 
mw.ime.getLanguagesWithIME()
} );
 
return $ulsTrigger;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5fd9f10d955322abd2623ce8b88792b391553dcd
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com
Gerrit-Reviewer: Amire80 amir.ahar...@mail.huji.ac.il
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Allow ntriples in Special:EntityData - change (mediawiki...Wikibase)

2013-05-22 Thread Daniel Kinzler (Code Review)
Daniel Kinzler has uploaded a new change for review.

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


Change subject: Allow ntriples in Special:EntityData
..

Allow ntriples in Special:EntityData

Change-Id: I410166bb96a60dc4851ac21917aee8fcd3eabb25
---
M repo/includes/specials/SpecialEntityData.php
M repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
2 files changed, 6 insertions(+), 3 deletions(-)


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

diff --git a/repo/includes/specials/SpecialEntityData.php 
b/repo/includes/specials/SpecialEntityData.php
index c086a97..7207cf0 100755
--- a/repo/includes/specials/SpecialEntityData.php
+++ b/repo/includes/specials/SpecialEntityData.php
@@ -44,7 +44,8 @@
'xml',
'rdfxml',
'n3',
-   'turtle'
+   'turtle',
+   'ntriples'
);
 
/**
diff --git a/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php 
b/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
index 32f7c47..30601ad 100644
--- a/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
@@ -276,18 +276,20 @@
'text/rdf+n3',
'text/turtle',
'application/turtle',
+   'application/ntriples',
);
 
static $rdfExtensions = array(
'rdf',
'n3',
-   'ttl'
+   'ttl',
+   'nt'
);
 
static $badMimeTypes = array(
'text/html',
'text/text',
-   'text/plain',
+   // 'text/plain', // ntriples presents as text/plain!
);
 
static $badExtensions = array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I410166bb96a60dc4851ac21917aee8fcd3eabb25
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] Allow ntriples in Special:EntityData - change (mediawiki...Wikibase)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: Allow ntriples in Special:EntityData
..


Allow ntriples in Special:EntityData

Change-Id: I410166bb96a60dc4851ac21917aee8fcd3eabb25
---
M repo/includes/specials/SpecialEntityData.php
M repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
2 files changed, 6 insertions(+), 3 deletions(-)

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



diff --git a/repo/includes/specials/SpecialEntityData.php 
b/repo/includes/specials/SpecialEntityData.php
index c086a97..7207cf0 100755
--- a/repo/includes/specials/SpecialEntityData.php
+++ b/repo/includes/specials/SpecialEntityData.php
@@ -44,7 +44,8 @@
'xml',
'rdfxml',
'n3',
-   'turtle'
+   'turtle',
+   'ntriples'
);
 
/**
diff --git a/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php 
b/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
index 32f7c47..30601ad 100644
--- a/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
@@ -276,18 +276,20 @@
'text/rdf+n3',
'text/turtle',
'application/turtle',
+   'application/ntriples',
);
 
static $rdfExtensions = array(
'rdf',
'n3',
-   'ttl'
+   'ttl',
+   'nt'
);
 
static $badMimeTypes = array(
'text/html',
'text/text',
-   'text/plain',
+   // 'text/plain', // ntriples presents as text/plain!
);
 
static $badExtensions = array(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I410166bb96a60dc4851ac21917aee8fcd3eabb25
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.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] Fixes for new logarithmic tag cloud display - change (mediawiki...SemanticDrilldown)

2013-05-22 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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


Change subject: Fixes for new logarithmic tag cloud display
..

Fixes for new logarithmic tag cloud display

The logarithmic display is now the only option (the LocalSettings.php
setting was removed), the display is now correct for subcategories as well
(before, it was just for filter values), and handling was fixed if there's
no difference between the lowest and highest number of values.

Change-Id: Ic6a7f38063d60b1b611a263a8e7f2a27e9f494a8
---
M SemanticDrilldown.php
M specials/SD_BrowseData.php
2 files changed, 17 insertions(+), 16 deletions(-)


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

diff --git a/SemanticDrilldown.php b/SemanticDrilldown.php
index 98f05a5..1b0c58b 100644
--- a/SemanticDrilldown.php
+++ b/SemanticDrilldown.php
@@ -121,8 +121,6 @@
 // set these to a positive value to trigger the tag cloud display
 $sdgFiltersSmallestFontSize = - 1;
 $sdgFiltersLargestFontSize = - 1;
-// logarithmic scale?
-$sdgFiltersLogScale = 0;
 // print categories list as tabs
 $sdgShowCategoriesAsTabs = false;
 
diff --git a/specials/SD_BrowseData.php b/specials/SD_BrowseData.php
index 7eeca19..7aa980a 100644
--- a/specials/SD_BrowseData.php
+++ b/specials/SD_BrowseData.php
@@ -587,7 +587,7 @@
}
 
function printUnappliedFilterValues( $cur_url, $f, $filter_values ) {
-   global $sdgFiltersSmallestFontSize, $sdgFiltersLargestFontSize, 
$sdgFiltersLogScale;
+   global $sdgFiltersSmallestFontSize, $sdgFiltersLargestFontSize;
 
$results_line = ;
// set font-size values for filter tag cloud, if the
@@ -595,10 +595,9 @@
if ( $sdgFiltersSmallestFontSize  0  
$sdgFiltersLargestFontSize  0 ) {
$lowest_num_results = min( $filter_values );
$highest_num_results = max( $filter_values );
-   $scale_factor = ( $sdgFiltersLargestFontSize - 
$sdgFiltersSmallestFontSize ) / ( $highest_num_results - $lowest_num_results );
-if( $sdgFiltersLogScale ){
-  $scale_factor = ( $sdgFiltersLargestFontSize - 
$sdgFiltersSmallestFontSize ) / ( log($highest_num_results) - 
log($lowest_num_results) );
-}
+   if ( $lowest_num_results != $highest_num_results ) {
+   $scale_factor = ( $sdgFiltersLargestFontSize - 
$sdgFiltersSmallestFontSize ) / ( log($highest_num_results) - 
log($lowest_num_results) );
+   }
}
// now print the values
$num_printed_values = 0;
@@ -608,10 +607,11 @@
$filter_text .= nbsp;($num_results);
$filter_url = $cur_url . urlencode( str_replace( ' ', 
'_', $f-name ) ) . '=' . urlencode( str_replace( ' ', '_', $value_str ) );
if ( $sdgFiltersSmallestFontSize  0  
$sdgFiltersLargestFontSize  0 ) {
-   $font_size = round( (($num_results - 
$lowest_num_results) * $scale_factor ) +  $sdgFiltersSmallestFontSize );
-if( $sdgFiltersLogScale ){
-  $font_size = round( ((log($num_results) - 
log($lowest_num_results)) * $scale_factor ) +  $sdgFiltersSmallestFontSize );
-}
+   if ( $lowest_num_results != 
$highest_num_results ) {
+   $font_size = round( ((log($num_results) 
- log($lowest_num_results)) * $scale_factor ) +  $sdgFiltersSmallestFontSize );
+   } else {
+   $font_size = ( 
$sdgFiltersSmallestFontSize + $sdgFiltersLargestFontSize ) / 2;
+   }
$results_line .= \n
 . 'a href=' . $filter_url . ' title=' . wfMsg( 
'sd_browsedata_filterbyvalue' ) . ' style=font-size: ' . $font_size . 'px' 
. $filter_text . '/a';
} else {
$results_line .= \n
 . 'a href=' . $filter_url . ' title=' . wfMsg( 
'sd_browsedata_filterbyvalue' ) . '' . $filter_text . '/a';
@@ -900,10 +900,9 @@
if ( $sdgFiltersSmallestFontSize  0  
$sdgFiltersLargestFontSize  0 ) {
$lowest_num_results = min( $subcat_values );
$highest_num_results = max( $subcat_values );
-   $num_results_midpoint = ( $lowest_num_results + 
$highest_num_results ) / 2;
-   $font_size_midpoint = ( 
$sdgFiltersSmallestFontSize + $sdgFiltersLargestFontSize ) / 2;
-

[MediaWiki-commits] [Gerrit] deprecate autoloading a class with mismatching case. - change (mediawiki/core)

2013-05-22 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

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


Change subject: deprecate autoloading a class with mismatching case.
..

deprecate autoloading a class with mismatching case.

PHP 4.x had a bug [26762] which caused unserialize() to produce an
object with a lower cased class name.  To workaround it, we normalized
the class lookup using lowercase() [r15226] / 2ff28872 .

The fix landed in PHP version 5.0.0 beta4 (January 2004).

Whenever a class is not matched directly, we end up doing a foreach with
two lowercase() calls.  Whenever we have registered other autoloader
(such as the PHPUnit one for unit tests), we slightly delay the class
lookup.

This patch deprecates the lowercase() lookup, letting extension authors
update their code.  MediaWiki will output a deprecation notice such as:

  Deprecated: Use of Class 'UnwatchedPagesPage' case  mismatch
  registered 'UnwatchedpagesPage'. Please update your call. was
  deprecated in MediaWiki 1.22.

Patch also fix two such occurences in core.

[26762] https://bugs.php.net/bug.php?id=26762
[r15226] https://www.mediawiki.org/wiki/Special:Code/MediaWiki/15226

Change-Id: I30128e5120b3a5e457a4bafa7b26c3b9babca650
---
M RELEASE-NOTES-1.22
M includes/AutoLoader.php
M includes/QueryPage.php
3 files changed, 17 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/26/64926/1

diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index 04861fc..8910911 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -170,6 +170,10 @@
   to redirect through Special:Redirect.
 * Monobook: Removed the old conditional stylesheets for Opera 6, 7 and 9.
 * Support for XHTML 1.0 has been removed. MediaWiki now only outputs (X)HTML5.
+* MediaWiki autoloader attempts to find the requested class using a form
+  normalized lower case. That adds unnecessary overhead and is now being
+  deprecated. Make sure your class call match the class name registered in
+  includes/AutoLoader.php or $wgAutoloadClasses.
 
 == Compatibility ==
 
diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php
index 3e08e74..371391e 100644
--- a/includes/AutoLoader.php
+++ b/includes/AutoLoader.php
@@ -1126,12 +1126,23 @@
} else {
# Try a different capitalisation
# The case can sometimes be wrong when unserializing 
PHP 4 objects
+   # https://bugs.php.net/bug.php?id=26762 (fixed in PHP 
v5.0.0 beta4).
+   #
+   # We want to eventually get rid of this and are thus 
emitting a
+   # deprecation warning.
+
$filename = false;
$lowerClass = strtolower( $className );
 
foreach ( $wgAutoloadLocalClasses as $class2 = $file2 
) {
if ( strtolower( $class2 ) == $lowerClass ) {
$filename = $file2;
+   if ( function_exists( 'wfDeprecated' ) 
) {
+   # Fixed in PHP v5.0.0 beta4!
+   wfDeprecated( Class 
'$className' case  mismatch registered '$class2'. .
+Please update your 
call., '1.22' );
+   }
+
}
}
 
diff --git a/includes/QueryPage.php b/includes/QueryPage.php
index a93639a..7ccad27 100644
--- a/includes/QueryPage.php
+++ b/includes/QueryPage.php
@@ -47,7 +47,7 @@
array( 'MostimagesPage','Mostimages'
),
array( 'MostinterwikisPage','Mostinterwikis'
),
array( 'MostlinkedCategoriesPage',  'Mostlinkedcategories'  
),
-   array( 'MostlinkedtemplatesPage',   'Mostlinkedtemplates'   
),
+   array( 'MostlinkedTemplatesPage',   'Mostlinkedtemplates'   
),
array( 'MostlinkedPage','Mostlinked'
),
array( 'MostrevisionsPage', 'Mostrevisions' 
),
array( 'FewestrevisionsPage',   'Fewestrevisions'   
),
@@ -62,7 +62,7 @@
array( 'WantedFilesPage',   'Wantedfiles'   
),
array( 'WantedPagesPage',   'Wantedpages'   
),
array( 'WantedTemplatesPage',   'Wantedtemplates'   
),
-   array( 'UnwatchedPagesPage','Unwatchedpages'
),
+   array( 'UnwatchedpagesPage','Unwatchedpages'
),
array( 'UnusedtemplatesPage',   'Unusedtemplates'   
),
array( 'WithoutInterwikiPage',  'Withoutinterwiki'

[MediaWiki-commits] [Gerrit] Fixes for new logarithmic tag cloud display - change (mediawiki...SemanticDrilldown)

2013-05-22 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Fixes for new logarithmic tag cloud display
..


Fixes for new logarithmic tag cloud display

The logarithmic display is now the only option (the LocalSettings.php
setting was removed), the display is now correct for subcategories as well
(before, it was just for filter values), and handling was fixed if there's
no difference between the lowest and highest number of values.

Change-Id: Ic6a7f38063d60b1b611a263a8e7f2a27e9f494a8
---
M SemanticDrilldown.php
M specials/SD_BrowseData.php
2 files changed, 17 insertions(+), 16 deletions(-)

Approvals:
  Yaron Koren: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/SemanticDrilldown.php b/SemanticDrilldown.php
index 98f05a5..1b0c58b 100644
--- a/SemanticDrilldown.php
+++ b/SemanticDrilldown.php
@@ -121,8 +121,6 @@
 // set these to a positive value to trigger the tag cloud display
 $sdgFiltersSmallestFontSize = - 1;
 $sdgFiltersLargestFontSize = - 1;
-// logarithmic scale?
-$sdgFiltersLogScale = 0;
 // print categories list as tabs
 $sdgShowCategoriesAsTabs = false;
 
diff --git a/specials/SD_BrowseData.php b/specials/SD_BrowseData.php
index 7eeca19..7aa980a 100644
--- a/specials/SD_BrowseData.php
+++ b/specials/SD_BrowseData.php
@@ -587,7 +587,7 @@
}
 
function printUnappliedFilterValues( $cur_url, $f, $filter_values ) {
-   global $sdgFiltersSmallestFontSize, $sdgFiltersLargestFontSize, 
$sdgFiltersLogScale;
+   global $sdgFiltersSmallestFontSize, $sdgFiltersLargestFontSize;
 
$results_line = ;
// set font-size values for filter tag cloud, if the
@@ -595,10 +595,9 @@
if ( $sdgFiltersSmallestFontSize  0  
$sdgFiltersLargestFontSize  0 ) {
$lowest_num_results = min( $filter_values );
$highest_num_results = max( $filter_values );
-   $scale_factor = ( $sdgFiltersLargestFontSize - 
$sdgFiltersSmallestFontSize ) / ( $highest_num_results - $lowest_num_results );
-if( $sdgFiltersLogScale ){
-  $scale_factor = ( $sdgFiltersLargestFontSize - 
$sdgFiltersSmallestFontSize ) / ( log($highest_num_results) - 
log($lowest_num_results) );
-}
+   if ( $lowest_num_results != $highest_num_results ) {
+   $scale_factor = ( $sdgFiltersLargestFontSize - 
$sdgFiltersSmallestFontSize ) / ( log($highest_num_results) - 
log($lowest_num_results) );
+   }
}
// now print the values
$num_printed_values = 0;
@@ -608,10 +607,11 @@
$filter_text .= nbsp;($num_results);
$filter_url = $cur_url . urlencode( str_replace( ' ', 
'_', $f-name ) ) . '=' . urlencode( str_replace( ' ', '_', $value_str ) );
if ( $sdgFiltersSmallestFontSize  0  
$sdgFiltersLargestFontSize  0 ) {
-   $font_size = round( (($num_results - 
$lowest_num_results) * $scale_factor ) +  $sdgFiltersSmallestFontSize );
-if( $sdgFiltersLogScale ){
-  $font_size = round( ((log($num_results) - 
log($lowest_num_results)) * $scale_factor ) +  $sdgFiltersSmallestFontSize );
-}
+   if ( $lowest_num_results != 
$highest_num_results ) {
+   $font_size = round( ((log($num_results) 
- log($lowest_num_results)) * $scale_factor ) +  $sdgFiltersSmallestFontSize );
+   } else {
+   $font_size = ( 
$sdgFiltersSmallestFontSize + $sdgFiltersLargestFontSize ) / 2;
+   }
$results_line .= \n
 . 'a href=' . $filter_url . ' title=' . wfMsg( 
'sd_browsedata_filterbyvalue' ) . ' style=font-size: ' . $font_size . 'px' 
. $filter_text . '/a';
} else {
$results_line .= \n
 . 'a href=' . $filter_url . ' title=' . wfMsg( 
'sd_browsedata_filterbyvalue' ) . '' . $filter_text . '/a';
@@ -900,10 +900,9 @@
if ( $sdgFiltersSmallestFontSize  0  
$sdgFiltersLargestFontSize  0 ) {
$lowest_num_results = min( $subcat_values );
$highest_num_results = max( $subcat_values );
-   $num_results_midpoint = ( $lowest_num_results + 
$highest_num_results ) / 2;
-   $font_size_midpoint = ( 
$sdgFiltersSmallestFontSize + $sdgFiltersLargestFontSize ) / 2;
-   $num_results_per_font_pixel = ( 

[MediaWiki-commits] [Gerrit] (hotfix) Fixed diff of claims with a time property - change (mediawiki...Wikibase)

2013-05-22 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has uploaded a new change for review.

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


Change subject: (hotfix) Fixed diff of claims with a time property
..

(hotfix) Fixed diff of claims with a time property

Bug: 48709

Change-Id: Icd7612f60b6595aa567fa634fa981d0be014f968
---
M lib/includes/ClaimDifferenceVisualizer.php
M repo/includes/ClaimSummaryBuilder.php
2 files changed, 10 insertions(+), 0 deletions(-)


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

diff --git a/lib/includes/ClaimDifferenceVisualizer.php 
b/lib/includes/ClaimDifferenceVisualizer.php
index 226829b..87abdc9 100644
--- a/lib/includes/ClaimDifferenceVisualizer.php
+++ b/lib/includes/ClaimDifferenceVisualizer.php
@@ -1,6 +1,7 @@
 ?php
 namespace Wikibase;
 
+use DataValues\TimeValue;
 use Html;
 use Diff\Diff;
 use Wikibase\Lib\EntityIdFormatter;
@@ -293,6 +294,10 @@
// FIXME! should use some value formatter
if ( $dataValue instanceof EntityId ) {
$diffValueString = $this-getEntityLabel( 
$dataValue );
+   } else if ( $dataValue instanceof TimeValue ) {
+   // TODO: this will just display the plain 
ISO8601-string,
+   // we should instead use a decent formatter
+   $diffValueString = $dataValue-getTime();
} else {
$diffValueString = $dataValue-getValue();
}
diff --git a/repo/includes/ClaimSummaryBuilder.php 
b/repo/includes/ClaimSummaryBuilder.php
index 50057d7..b1e2675 100644
--- a/repo/includes/ClaimSummaryBuilder.php
+++ b/repo/includes/ClaimSummaryBuilder.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase;
 
+use DataValues\TimeValue;
 use InvalidArgumentException;
 use Wikibase\Lib\EntityIdFormatter;
 
@@ -129,6 +130,10 @@
 
if ( $snak instanceof PropertyValueSnak ) {
$value = $snak-getDataValue();
+   // TODO: we should use value formatters 
here!
+   if ( $value instanceof TimeValue ) {
+   $value = $value-getTime();
+   }
} else {
$value = '-'; // todo handle no values 
in general way (needed elsewhere)
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd7612f60b6595aa567fa634fa981d0be014f968
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] (hotfix) Fixed diff of claims with a time property - change (mediawiki...Wikibase)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: (hotfix) Fixed diff of claims with a time property
..


(hotfix) Fixed diff of claims with a time property

Bug: 48709

Change-Id: Icd7612f60b6595aa567fa634fa981d0be014f968
---
M lib/includes/ClaimDifferenceVisualizer.php
M repo/includes/ClaimSummaryBuilder.php
2 files changed, 10 insertions(+), 0 deletions(-)

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



diff --git a/lib/includes/ClaimDifferenceVisualizer.php 
b/lib/includes/ClaimDifferenceVisualizer.php
index 226829b..87abdc9 100644
--- a/lib/includes/ClaimDifferenceVisualizer.php
+++ b/lib/includes/ClaimDifferenceVisualizer.php
@@ -1,6 +1,7 @@
 ?php
 namespace Wikibase;
 
+use DataValues\TimeValue;
 use Html;
 use Diff\Diff;
 use Wikibase\Lib\EntityIdFormatter;
@@ -293,6 +294,10 @@
// FIXME! should use some value formatter
if ( $dataValue instanceof EntityId ) {
$diffValueString = $this-getEntityLabel( 
$dataValue );
+   } else if ( $dataValue instanceof TimeValue ) {
+   // TODO: this will just display the plain 
ISO8601-string,
+   // we should instead use a decent formatter
+   $diffValueString = $dataValue-getTime();
} else {
$diffValueString = $dataValue-getValue();
}
diff --git a/repo/includes/ClaimSummaryBuilder.php 
b/repo/includes/ClaimSummaryBuilder.php
index 50057d7..b1e2675 100644
--- a/repo/includes/ClaimSummaryBuilder.php
+++ b/repo/includes/ClaimSummaryBuilder.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase;
 
+use DataValues\TimeValue;
 use InvalidArgumentException;
 use Wikibase\Lib\EntityIdFormatter;
 
@@ -129,6 +130,10 @@
 
if ( $snak instanceof PropertyValueSnak ) {
$value = $snak-getDataValue();
+   // TODO: we should use value formatters 
here!
+   if ( $value instanceof TimeValue ) {
+   $value = $value-getTime();
+   }
} else {
$value = '-'; // todo handle no values 
in general way (needed elsewhere)
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icd7612f60b6595aa567fa634fa981d0be014f968
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.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] code cleanup, remove tabs - change (mediawiki...TimedMediaHandler)

2013-05-22 Thread Mdale (Code Review)
Mdale has submitted this change and it was merged.

Change subject: code cleanup, remove tabs
..


code cleanup, remove tabs

Change-Id: I70b7e17ac775fa57ae55280812a58891ddb9068a
---
M TimedMediaHandler.i18n.php
M TimedMediaHandler.php
M TimedMediaHandler_body.php
M TimedMediaIframeOutput.php
M TimedMediaThumbnail.php
5 files changed, 29 insertions(+), 29 deletions(-)

Approvals:
  Mdale: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/TimedMediaHandler.i18n.php b/TimedMediaHandler.i18n.php
index d7fb5de..5b282e3 100644
--- a/TimedMediaHandler.i18n.php
+++ b/TimedMediaHandler.i18n.php
@@ -25,42 +25,42 @@
'timedmedia-mp4-short-video' = 'MP4 $1 video file, $2',
'timedmedia-mp4-long-video' = 'MP4 audio/video file, $1, length $2, $4 
× $5 pixels, $3 overall',
 
-   'timedmedia-no-player-js' = 'Sorry, your browser either has 
JavaScript disabled or does not have any supported player.br /
+   'timedmedia-no-player-js' = 'Sorry, your browser either has JavaScript 
disabled or does not have any supported player.br /
 You can a href=$1download the clip/a or a 
href=//www.mediawiki.org/wiki/Extension:TimedMediaHandler/Client_downloaddownload
 a player/a to play the clip in your browser.',
 
'timedmedia-more' = 'More…',
'timedmedia-dismiss'  = 'Close',
'timedmedia-download' = 'Download file',
-   'timedmedia-play-media'   = 'Play media',
+   'timedmedia-play-media'   = 'Play media',
'timedmedia-desc-link'= 'About this file',
'timedmedia-oggThumb-version' = 'OggHandler requires oggThumb version 
$1 or later.',
'timedmedia-oggThumb-failed'  = 'oggThumb failed to create the 
thumbnail.',
 
// Transcode status table:
 
-   'timedmedia-status-header'  = 'Transcode status',
-   'timedmedia-update-status'  = 'Update transcode status',
-   'timedmedia-status' = 'Status',
-   'timedmedia-status-unknown' = 'Unknown status',
-   'timedmedia-transcodeinfo'  = 'Transcode derivative 
description',
-   'timedmedia-actions'= 'Actions',
-   'timedmedia-direct-link'= 'Download derivative',
-   'timedmedia-not-ready'  = 'Not ready',
-   'timedmedia-completed-on'   = 'Completed transcode $1',
-   'timedmedia-error-on'   = 'Error in transcode on $1.',
-   'timedmedia-started-transcode'  = 'Transcode started $1 ago. $2',
-   'timedmedia-percent-done'   = 'About $1% done',
-   'timedmedia-in-job-queue'   = 'Added to Job queue $1 ago',
+   'timedmedia-status-header' = 'Transcode status',
+   'timedmedia-update-status' = 'Update transcode status',
+   'timedmedia-status'= 'Status',
+   'timedmedia-status-unknown' = 'Unknown status',
+   'timedmedia-transcodeinfo' = 'Transcode derivative description',
+   'timedmedia-actions' = 'Actions',
+   'timedmedia-direct-link' = 'Download derivative',
+   'timedmedia-not-ready' = 'Not ready',
+   'timedmedia-completed-on' = 'Completed transcode $1',
+   'timedmedia-error-on' = 'Error in transcode on $1.',
+   'timedmedia-started-transcode' = 'Transcode started $1 ago. $2',
+   'timedmedia-percent-done' = 'About $1% done',
+   'timedmedia-in-job-queue' = 'Added to Job queue $1 ago',
'timedmedia-unknown-target-size'= 'Unknown target size, $1 encoded',
-   'timedmedia-days'   = '{{PLURAL:$1|1 day|$1 
days}}',
-   'timedmedia-hours'  = '{{PLURAL:$1|1 hour|$1 
hours}}',
-   'timedmedia-minutes'= '{{PLURAL:$1|1 minute|$1 
minutes}}',
-   'timedmedia-seconds'= '{{PLURAL:$1|1 second|$1 
seconds}}',
-   'timedmedia-show-error' = 'Show error',
-   'timedmedia-reset'  = 'Reset transcode',
-   'timedmedia-reset-confirm'  = 'Resetting this transcode 
will remove any existing file (if present), and it will re-add the transcode to 
the job queue. It will take some time to re-transcode. br /br /
+   'timedmedia-days' = '{{PLURAL:$1|1 day|$1 days}}',
+   'timedmedia-hours' = '{{PLURAL:$1|1 hour|$1 hours}}',
+   'timedmedia-minutes' = '{{PLURAL:$1|1 minute|$1 minutes}}',
+   'timedmedia-seconds' = '{{PLURAL:$1|1 second|$1 seconds}}',
+   'timedmedia-show-error' = 'Show error',
+   'timedmedia-reset' = 'Reset transcode',
+   'timedmedia-reset-confirm' = 'Resetting this transcode will remove any 
existing file (if present), and it will re-add the transcode to the job queue. 
It will take some time to re-transcode. br /br /
 Are you sure you want to proceed?',
-   'timedmedia-reset-error' 

[MediaWiki-commits] [Gerrit] (bug 48473) Validate claim guid in api and return error - change (mediawiki...Wikibase)

2013-05-22 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has submitted this change and it was merged.

Change subject: (bug 48473) Validate claim guid in api and return error
..


(bug 48473) Validate claim guid in api and return error

- currently it throws an exception and returns a stack trace in the api results

Change-Id: Id388b510a18ddd3ccd899b78c97c77650df4dd2b
---
M lib/WikibaseLib.classes.php
M lib/WikibaseLib.hooks.php
A lib/includes/ClaimGuidValidator.php
A lib/tests/phpunit/ClaimGuidValidatorTest.php
M repo/includes/api/GetClaims.php
M repo/includes/api/RemoveClaims.php
M repo/includes/api/RemoveQualifiers.php
M repo/includes/api/RemoveReferences.php
M repo/includes/api/SetClaimValue.php
M repo/includes/api/SetQualifier.php
M repo/includes/api/SetReference.php
M repo/includes/api/SetStatementRank.php
M repo/tests/phpunit/includes/api/GetClaimsTest.php
M repo/tests/phpunit/includes/api/RemoveClaimsTest.php
M repo/tests/phpunit/includes/api/RemoveQualifiersTest.php
M repo/tests/phpunit/includes/api/RemoveReferencesTest.php
M repo/tests/phpunit/includes/api/SetClaimValueTest.php
M repo/tests/phpunit/includes/api/SetQualifierTest.php
M repo/tests/phpunit/includes/api/SetReferenceTest.php
M repo/tests/phpunit/includes/api/SetStatementRankTest.php
20 files changed, 633 insertions(+), 11 deletions(-)

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



diff --git a/lib/WikibaseLib.classes.php b/lib/WikibaseLib.classes.php
index 6dd483d..ec3aaec 100644
--- a/lib/WikibaseLib.classes.php
+++ b/lib/WikibaseLib.classes.php
@@ -44,6 +44,7 @@
'Wikibase\Lib\V4GuidGenerator' = 'includes/GuidGenerator.php',
'Wikibase\Lib\EntityRetrievingDataTypeLookup' = 
'includes/EntityRetrievingDataTypeLookup.php',
'Wikibase\Lib\ClaimGuidGenerator' = 
'includes/GuidGenerator.php',
+   'Wikibase\Lib\ClaimGuidValidator' = 
'includes/ClaimGuidValidator.php',
'Wikibase\Lib\InMemoryDataTypeLookup' = 
'includes/InMemoryDataTypeLookup.php',
'Wikibase\LibRegistry' = 'includes/LibRegistry.php',
'Wikibase\Template' = 'includes/TemplateRegistry.php',
diff --git a/lib/WikibaseLib.hooks.php b/lib/WikibaseLib.hooks.php
index dafd214..ed1c5a5 100644
--- a/lib/WikibaseLib.hooks.php
+++ b/lib/WikibaseLib.hooks.php
@@ -70,6 +70,7 @@
'ByPropertyIdArray',
'ChangesTable',
'ClaimDifference',
+   'ClaimGuidValidator',
'ReferencedEntitiesFinder',
'EntityRetrievingDataTypeLookup',
'InMemoryDataTypeLookup',
diff --git a/lib/includes/ClaimGuidValidator.php 
b/lib/includes/ClaimGuidValidator.php
new file mode 100644
index 000..bce056a
--- /dev/null
+++ b/lib/includes/ClaimGuidValidator.php
@@ -0,0 +1,132 @@
+?php
+
+namespace Wikibase\Lib;
+
+use Wikibase\Repo\WikibaseRepo;
+use ValueParsers\ParserOptions;
+
+/**
+ * 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
+ *
+ * @since 0.4
+ *
+ * @file
+ * @ingroup WikibaseLib
+ *
+ * @licence GNU GPL v2+
+ * @author Katie Filbert  aude.w...@gmail.com 
+ */
+class ClaimGuidValidator {
+
+   protected $entityPrefixes;
+
+   public function __construct( array $entityPrefixes ) {
+   $this-entityPrefixes = $entityPrefixes;
+   }
+
+   /**
+* Validates a claim guid
+*
+* @since 0.4
+*
+* @param string $guid
+*
+* @return boolean
+*/
+   public function validate( $guid ) {
+   if ( ! $this-validateFormat( $guid ) ) {
+   return false;
+   }
+
+   $guidParts = explode( '$', $guid );
+
+   if ( ! $this-validateClaimGuidPrefix( $guidParts[0] ) || ! 
$this-validateGuid( $guidParts[1] ) ) {
+   return false;
+   }
+
+   return true;
+   }
+
+   /**
+* Basic validation for claim guid format
+*
+* @since 0.4
+*
+* @param string $guid
+*
+* @return boolean
+*/
+   public function validateFormat( 

[MediaWiki-commits] [Gerrit] More fixes for removal of '_str' datatype in SMW 1.9 - change (mediawiki...SemanticDrilldown)

2013-05-22 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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


Change subject: More fixes for removal of '_str' datatype in SMW 1.9
..

More fixes for removal of '_str' datatype in SMW 1.9

Change-Id: I41e35b86c24a6f03895d98ba5d557c74c5a3fd48
---
M includes/SD_Filter.php
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/includes/SD_Filter.php b/includes/SD_Filter.php
index b4a2179..6a17bb5 100644
--- a/includes/SD_Filter.php
+++ b/includes/SD_Filter.php
@@ -108,6 +108,9 @@
// A bit inefficient, but it's the
// simplest approach.
$typeID = $types[0]-getFragment();
+   if ( $typeID == '_str'  
!array_key_exists( '_str', $datatypeLabels ) ) {
+   $typeID = '_txt';
+   }
$typeValue = $datatypeLabels[$typeID];
} else {
$typeValue = $types[0]-getWikiValue();
@@ -117,6 +120,8 @@
// _str stopped existing in SMW 1.9
} elseif ( array_key_exists( '_str', 
$datatypeLabels )  $typeValue == $datatypeLabels['_str'] ) {
$f-property_type = 'string';
+   } elseif ( !array_key_exists( '_str', 
$datatypeLabels )  $typeValue == $datatypeLabels['_txt'] ) {
+   $f-property_type = 'string';
} elseif ( $typeValue == 
$datatypeLabels['_num'] ) {
$f-property_type = 'number';
} elseif ( $typeValue == 
$datatypeLabels['_boo'] ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41e35b86c24a6f03895d98ba5d557c74c5a3fd48
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticDrilldown
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren yaro...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add @throws to QueryInterface interface - change (mediawiki...Wikibase)

2013-05-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Add @throws to QueryInterface interface
..

Add @throws to QueryInterface interface

Change-Id: I8caf8db70dbd4ab82b651767f7780aa6444526f3
---
M Database/includes/QueryInterface.php
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/Database/includes/QueryInterface.php 
b/Database/includes/QueryInterface.php
index 79ffc8e..052bbc5 100644
--- a/Database/includes/QueryInterface.php
+++ b/Database/includes/QueryInterface.php
@@ -49,6 +49,7 @@
 * @param TableDefinition $table
 *
 * @return boolean Success indicator
+* @throws TableCreationFailedException
 */
public function createTable( TableDefinition $table );
 
@@ -129,6 +130,7 @@
 * @param array $conditions
 *
 * @return ResultIterator
+* @throws SelectFailedException
 */
public function select( $tableName, array $fields, array $conditions );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8caf8db70dbd4ab82b651767f7780aa6444526f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com

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


[MediaWiki-commits] [Gerrit] Change EditEntity status failure from session-failure to ses... - change (mediawiki...Wikibase)

2013-05-22 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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


Change subject: Change EditEntity status failure from session-failure to 
sessionfailure
..

Change EditEntity status failure from session-failure to sessionfailure

There is no message for session-failure; instead it is sessionfailure.

If wrong, it displays session-failure in the error bubble in the UI.

Change-Id: I18c9e54ffb48f841461c76b4ec4bc845b9c2dc33
---
M repo/includes/EditEntity.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/repo/includes/EditEntity.php b/repo/includes/EditEntity.php
index 4a2e31c..73457ee 100644
--- a/repo/includes/EditEntity.php
+++ b/repo/includes/EditEntity.php
@@ -631,7 +631,7 @@
//   We should figure out which error codes the 
callers expect,
//   and only set the correct error code, in one 
place, probably here.
$this-errorType |= self::TOKEN_ERROR;
-   $this-status-fatal( 'session-failure' );
+   $this-status-fatal( 'sessionfailure' );
$this-status-setResult( false, array( 'errorFlags' = 
$this-errorType ) );
 
wfProfileOut( __METHOD__ );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18c9e54ffb48f841461c76b4ec4bc845b9c2dc33
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] Do not returning external title in ApiPageSet::getRedirectTa... - change (mediawiki/core)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Do not returning external title in 
ApiPageSet::getRedirectTargets
..


Do not returning external title in ApiPageSet::getRedirectTargets

Having a page with a redirect to en:Main Page will be added as Main
Page to the output, that is wrong

http://test.wikipedia.org/w/api.php?action=querytitles=Redirect%20to%20interwiki%20pageredirects

Change-Id: I7b59f592c1293dbb96f4c4279201bf04fcfea29d
---
M includes/api/ApiPageSet.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php
index fbe5973..9fdad2b 100644
--- a/includes/api/ApiPageSet.php
+++ b/includes/api/ApiPageSet.php
@@ -862,7 +862,7 @@
$from = 
$this-mPendingRedirectIDs[$rdfrom]-getPrefixedText();
$to = Title::makeTitle( $row-rd_namespace, 
$row-rd_title, $row-rd_fragment, $row-rd_interwiki );
unset( $this-mPendingRedirectIDs[$rdfrom] );
-   if ( !isset( 
$this-mAllPages[$row-rd_namespace][$row-rd_title] ) ) {
+   if ( !$to-isExternal()  !isset( 
$this-mAllPages[$row-rd_namespace][$row-rd_title] ) ) {
$lb-add( $row-rd_namespace, $row-rd_title );
}
$this-mRedirectTitles[$from] = $to;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7b59f592c1293dbb96f4c4279201bf04fcfea29d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender umherirrender_de...@web.de
Gerrit-Reviewer: Anomie bjor...@wikimedia.org
Gerrit-Reviewer: Yurik yu...@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] update TimedMediaTransformOutput options - change (mediawiki...Score)

2013-05-22 Thread J (Code Review)
J has uploaded a new change for review.

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


Change subject: update TimedMediaTransformOutput options
..

update TimedMediaTransformOutput options

disablecontrols is a player option not per source

Change-Id: I84a88628fa2601f50e58fe7884bce316402578e6
---
M Score.body.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/Score.body.php b/Score.body.php
index 147c27c..d88a1bf 100644
--- a/Score.body.php
+++ b/Score.body.php
@@ -492,10 +492,10 @@
'sources' = array(
array(
'src' = 
$oggUrl,
-   'type' = 
'audio/ogg; codecs=vorbis',
-   
'disablecontrols' = 'options,timedText'
+   'type' = 
'audio/ogg; codecs=vorbis'
)
),
+   'disablecontrols' = 
'options,timedText',
'width' = 
self::DEFAULT_PLAYER_WIDTH
) );
} else /* class_exists( 'OggAudioDisplay' ) */ {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84a88628fa2601f50e58fe7884bce316402578e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Score
Gerrit-Branch: master
Gerrit-Owner: J jger...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Change EditEntity status failure from session-failure to ses... - change (mediawiki...Wikibase)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Change EditEntity status failure from session-failure to 
sessionfailure
..


Change EditEntity status failure from session-failure to sessionfailure

There is no message for session-failure; instead it is sessionfailure.

If wrong, it displays session-failure in the error bubble in the UI.

Change-Id: I18c9e54ffb48f841461c76b4ec4bc845b9c2dc33
---
M repo/includes/EditEntity.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/repo/includes/EditEntity.php b/repo/includes/EditEntity.php
index 4a2e31c..73457ee 100644
--- a/repo/includes/EditEntity.php
+++ b/repo/includes/EditEntity.php
@@ -631,7 +631,7 @@
//   We should figure out which error codes the 
callers expect,
//   and only set the correct error code, in one 
place, probably here.
$this-errorType |= self::TOKEN_ERROR;
-   $this-status-fatal( 'session-failure' );
+   $this-status-fatal( 'sessionfailure' );
$this-status-setResult( false, array( 'errorFlags' = 
$this-errorType ) );
 
wfProfileOut( __METHOD__ );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I18c9e54ffb48f841461c76b4ec4bc845b9c2dc33
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.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] disablecontrols should only be set once not per source - change (mediawiki...TimedMediaHandler)

2013-05-22 Thread J (Code Review)
J has uploaded a new change for review.

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


Change subject: disablecontrols should only be set once not per source
..

disablecontrols should only be set once not per source

Change-Id: I23406ba236ee869081b1bda4ce37706b44b9ba93
---
M MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
M MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js
M TimedMediaTransformOutput.php
3 files changed, 16 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/32/64932/1

diff --git a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js 
b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
index 25500d1..0aa13cc 100644
--- a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
+++ b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
@@ -81,6 +81,9 @@
// can be displayed in the player without loading the media file
'data-durationhint': null,
 
+   // to disable menu or timedText for a given embed
+   'data-disablecontrols': null,
+
// Also support direct durationHint attribute ( backwards 
compatibly )
// @deprecated please use data-durationhint instead.
'durationHint' : null,
@@ -343,6 +346,11 @@
this.duration = parseFloat( this.duration );
mw.log( 'EmbedPlayer::init:' + this.id +  duration is: 
 + this.duration );
 
+   // Add disablecontrols property form 
data-disablecontrols:
+   if( _this['data-disablecontrols'] ){
+   _this.disablecontrols = 
_this['data-disablecontrols'];
+   }
+
// Set the playerElementId id
this.pid = 'pid_' + this.id;
 
diff --git 
a/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js 
b/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js
index 30f0204..b01a802 100644
--- a/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js
+++ b/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js
@@ -193,8 +193,11 @@
 
// Give embeds option to explicitly disable components via flag
var source = embedPlayer.mediaElement.getPlayableSources()[0];
-   if ( source  source.disablecontrols ) {
-   source.disablecontrols.split(',').forEach(function( key 
) {
+   if ( !embedPlayer.disablecontrols  source ) {
+   embedPlayer.disablecontrols = source.disablecontrols;
+   }
+   if ( embedPlayer.disablecontrols ) {
+   
embedPlayer.disablecontrols.split(',').forEach(function( key ) {
mw.log( 'PlayerControlBuilder:: disabled 
component via flag:' + key );
_this.supportedComponents[ key ] = false;
});
diff --git a/TimedMediaTransformOutput.php b/TimedMediaTransformOutput.php
index 17a21e8..d4f3836 100644
--- a/TimedMediaTransformOutput.php
+++ b/TimedMediaTransformOutput.php
@@ -211,9 +211,6 @@
// We prefix some source attributes with data- to pass along to 
the javascript player
$prefixedSourceAttr = Array( 'width', 'height', 'title', 
'shorttitle', 'bandwidth', 'framerate', 'disablecontrols' );
foreach( $mediaSources as $source ){
-   if ( $this-disablecontrols  !isset( 
$source['disablecontrols'] ) ) {
-   $source['disablecontrols'] = 
$this-disablecontrols;
-   }
foreach( $source as $attr = $val ){
if( in_array( $attr, $prefixedSourceAttr ) ){
$source[ 'data-' . $attr ] = $val;
@@ -348,6 +345,9 @@
$mediaAttr[ 'data-startoffset' ] = $offset;
}
}
+   if ( $this-disablecontrols ) {
+   $mediaAttr[ 'data-disablecontrols' ] = 
$this-disablecontrols;
+   }
return $mediaAttr;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I23406ba236ee869081b1bda4ce37706b44b9ba93
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: J jger...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Added UpdateFailedException - change (mediawiki...Wikibase)

2013-05-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Added UpdateFailedException
..

Added UpdateFailedException

Change-Id: Ifd963ef53a0c18566c502e08b58a3888b7e1a6e8
---
A Database/includes/UpdateFailedException.php
M Database/tests/phpunit/SelectFailedExceptionTest.php
M Database/tests/phpunit/TableCreationFailedExceptionTest.php
A Database/tests/phpunit/UpdateFailedExceptionTest.php
4 files changed, 132 insertions(+), 2 deletions(-)


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

diff --git a/Database/includes/UpdateFailedException.php 
b/Database/includes/UpdateFailedException.php
new file mode 100644
index 000..efd1e38
--- /dev/null
+++ b/Database/includes/UpdateFailedException.php
@@ -0,0 +1,64 @@
+?php
+
+namespace Wikibase\Database;
+
+/**
+ * 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
+ *
+ * @since 0.1
+ *
+ * @file
+ * @ingroup WikibaseDatabase
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw  jeroended...@gmail.com 
+ */
+class UpdateFailedException extends QueryInterfaceException {
+
+   protected $tableName;
+   protected $values;
+   protected $conditions;
+
+   public function __construct( $tableName, array $values, array 
$conditions, $message = '', \Exception $previous = null ) {
+   parent::__construct( $message, 0, $previous );
+
+   $this-tableName = $tableName;
+   $this-conditions = $conditions;
+   $this-values = $values;
+   }
+
+   /**
+* @return string
+*/
+   public function getTableName() {
+   return $this-tableName;
+   }
+
+   /**
+* @return array
+*/
+   public function getConditions() {
+   return $this-conditions;
+   }
+
+   /**
+* @return array
+*/
+   public function getValues() {
+   return $this-values;
+   }
+
+}
\ No newline at end of file
diff --git a/Database/tests/phpunit/SelectFailedExceptionTest.php 
b/Database/tests/phpunit/SelectFailedExceptionTest.php
index 52a1462..7496190 100644
--- a/Database/tests/phpunit/SelectFailedExceptionTest.php
+++ b/Database/tests/phpunit/SelectFailedExceptionTest.php
@@ -5,7 +5,7 @@
 use Wikibase\Database\SelectFailedException;
 
 /**
- * @covers Wikibase\Database\SelectFailedException class.
+ * @covers Wikibase\Database\SelectFailedException
  *
  * 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
diff --git a/Database/tests/phpunit/TableCreationFailedExceptionTest.php 
b/Database/tests/phpunit/TableCreationFailedExceptionTest.php
index 3b6a719..2570293 100644
--- a/Database/tests/phpunit/TableCreationFailedExceptionTest.php
+++ b/Database/tests/phpunit/TableCreationFailedExceptionTest.php
@@ -5,7 +5,7 @@
 use Wikibase\Database\TableCreationFailedException;
 
 /**
- * @covers Wikibase\Database\TableCreationFailedException class.
+ * @covers Wikibase\Database\TableCreationFailedException
  *
  * 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
diff --git a/Database/tests/phpunit/UpdateFailedExceptionTest.php 
b/Database/tests/phpunit/UpdateFailedExceptionTest.php
new file mode 100644
index 000..46627a7
--- /dev/null
+++ b/Database/tests/phpunit/UpdateFailedExceptionTest.php
@@ -0,0 +1,66 @@
+?php
+
+namespace Wikibase\Database\Tests;
+
+use Wikibase\Database\UpdateFailedException;
+
+/**
+ * @covers Wikibase\Database\UpdateFailedException
+ *
+ * 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 

[MediaWiki-commits] [Gerrit] Added DeleteFailedException - change (mediawiki...Wikibase)

2013-05-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Added DeleteFailedException
..

Added DeleteFailedException

Change-Id: Ib70c85b202c1db9c8735baa94f9eb373c4b022f3
---
A Database/includes/DeleteFailedException.php
A Database/tests/phpunit/DeleteFailedExceptionTest.php
2 files changed, 117 insertions(+), 0 deletions(-)


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

diff --git a/Database/includes/DeleteFailedException.php 
b/Database/includes/DeleteFailedException.php
new file mode 100644
index 000..e940cc0
--- /dev/null
+++ b/Database/includes/DeleteFailedException.php
@@ -0,0 +1,55 @@
+?php
+
+namespace Wikibase\Database;
+
+/**
+ * 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
+ *
+ * @since 0.1
+ *
+ * @file
+ * @ingroup WikibaseDatabase
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw  jeroended...@gmail.com 
+ */
+class DeleteFailedException extends QueryInterfaceException {
+
+   protected $tableName;
+   protected $conditions;
+
+   public function __construct( $tableName, array $conditions, $message = 
'', \Exception $previous = null ) {
+   parent::__construct( $message, 0, $previous );
+
+   $this-tableName = $tableName;
+   $this-conditions = $conditions;
+   }
+
+   /**
+* @return string
+*/
+   public function getTableName() {
+   return $this-tableName;
+   }
+
+   /**
+* @return array
+*/
+   public function getConditions() {
+   return $this-conditions;
+   }
+
+}
diff --git a/Database/tests/phpunit/DeleteFailedExceptionTest.php 
b/Database/tests/phpunit/DeleteFailedExceptionTest.php
new file mode 100644
index 000..4ffc7c6
--- /dev/null
+++ b/Database/tests/phpunit/DeleteFailedExceptionTest.php
@@ -0,0 +1,62 @@
+?php
+
+namespace Wikibase\Database\Tests;
+
+use Wikibase\Database\DeleteFailedException;
+
+/**
+ * @covers Wikibase\Database\DeleteFailedException
+ *
+ * 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
+ * @since 0.1
+ *
+ * @ingroup WikibaseDatabaseTest
+ *
+ * @group Wikibase
+ * @group WikibaseDatabase
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw  jeroended...@gmail.com 
+ */
+class DeleteFailedExceptionTest extends \PHPUnit_Framework_TestCase {
+
+   public function testConstructorWithOnlyRequiredArguments() {
+   $tableName = 'nyancats';
+   $conditions = array( 'foo' = 42, 'awesome  9000' );
+
+   $exception = new DeleteFailedException( $tableName, $conditions 
);
+
+   $this-assertEquals( $tableName, $exception-getTableName() );
+   $this-assertEquals( $conditions, $exception-getConditions() );
+   }
+
+   public function testConstructorWithAllArguments() {
+   $tableName = 'users';
+   $conditions = array( 'foo' = 42 );
+   $message = 'NyanData all the way accross the sky!';
+   $previous = new \Exception( 'Onoez!' );
+
+   $exception = new DeleteFailedException( $tableName, 
$conditions, $message, $previous );
+
+   $this-assertEquals( $tableName, $exception-getTableName() );
+   $this-assertEquals( $conditions, $exception-getConditions() );
+   $this-assertEquals( $message, $exception-getMessage() );
+   $this-assertEquals( 

[MediaWiki-commits] [Gerrit] update and delete methods in QueryInterface now throw except... - change (mediawiki...Wikibase)

2013-05-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: update and delete methods in QueryInterface now throw 
exceptions rather then retruning a boolean
..

update and delete methods in QueryInterface now throw exceptions rather then 
retruning a boolean

Change-Id: I08f665f1700381cdd30114d1cfd2bc02953922d8
---
M Database/includes/MediaWikiQueryInterface.php
M Database/includes/QueryInterface.php
M Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
3 files changed, 67 insertions(+), 8 deletions(-)


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

diff --git a/Database/includes/MediaWikiQueryInterface.php 
b/Database/includes/MediaWikiQueryInterface.php
index 52bdf78..306da96 100644
--- a/Database/includes/MediaWikiQueryInterface.php
+++ b/Database/includes/MediaWikiQueryInterface.php
@@ -132,15 +132,19 @@
 * @param array $values
 * @param array $conditions
 *
-* @return boolean Success indicator
+* @throws UpdateFailedException
 */
public function update( $tableName, array $values, array $conditions ) {
-   return $this-getDB()-update(
+   $success = $this-getDB()-update(
$tableName,
$values,
$conditions,
__METHOD__
) !== false;
+
+   if ( !$success ) {
+   throw new UpdateFailedException( $tableName, $values, 
$conditions );
+   }
}
 
/**
@@ -151,14 +155,18 @@
 * @param string $tableName
 * @param array $conditions
 *
-* @return boolean Success indicator
+* @throws DeleteFailedException
 */
public function delete( $tableName, array $conditions ) {
-   return $this-getDB()-delete(
+   $success = $this-getDB()-delete(
$tableName,
$conditions,
__METHOD__
) !== false;
+
+   if ( !$success ) {
+   throw new DeleteFailedException( $tableName, 
$conditions );
+   }
}
 
/**
diff --git a/Database/includes/QueryInterface.php 
b/Database/includes/QueryInterface.php
index 79ffc8e..31bd3c9 100644
--- a/Database/includes/QueryInterface.php
+++ b/Database/includes/QueryInterface.php
@@ -74,6 +74,7 @@
 * @param array $values
 *
 * @return boolean Success indicator
+* TODO: change to exception
 */
public function insert( $tableName, array $values );
 
@@ -88,7 +89,7 @@
 * @param array $values
 * @param array $conditions
 *
-* @return boolean Success indicator
+* @throws UpdateFailedException
 */
public function update( $tableName, array $values, array $conditions );
 
@@ -102,7 +103,7 @@
 * @param string $tableName
 * @param array $conditions
 *
-* @return boolean Success indicator
+* @throw DeleteFailedException
 */
public function delete( $tableName, array $conditions );
 
diff --git a/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php 
b/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
index 731551c..0041288 100644
--- a/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
+++ b/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
@@ -246,7 +246,34 @@
$this-equalTo( $tableName ),
$this-equalTo( $newValues ),
$this-equalTo( $conditions )
-   );
+   )
+   -will( $this-returnValue( true ) );
+
+   $queryInterface-update(
+   $tableName,
+   $newValues,
+   $conditions
+   );
+   }
+
+   /**
+* @dataProvider updateProvider
+*/
+   public function testUpdateFailure( $tableName, array $newValues, array 
$conditions ) {
+   $connection = $this-getMock( 'DatabaseMysql' );
+   $extendedAbstraction = $this-getMockBuilder( 
'\Wikibase\Database\MWDB\ExtendedMySQLAbstraction' )
+   -disableOriginalConstructor()-getMock();
+
+   $queryInterface = new MediaWikiQueryInterface(
+   new DirectConnectionProvider( $connection ),
+   $extendedAbstraction
+   );
+
+   $connection-expects( $this-once() )
+   -method( 'update' )
+   -will( $this-returnValue( false ) );
+
+   $this-setExpectedException( 
'\Wikibase\Database\UpdateFailedException' );
 
$queryInterface-update(
   

[MediaWiki-commits] [Gerrit] Stopgap to avoid excessively long string values (backport) - change (mediawiki...DataValues)

2013-05-22 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has uploaded a new change for review.

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


Change subject: Stopgap to avoid excessively long string values (backport)
..

Stopgap to avoid excessively long string values (backport)

Change-Id: I9b20d0d4bad5f68cd0cc440ee1995193ecec9abd
---
M DataValues/includes/values/StringValue.php
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues 
refs/changes/36/64936/1

diff --git a/DataValues/includes/values/StringValue.php 
b/DataValues/includes/values/StringValue.php
index a9164f8..678fa6d 100644
--- a/DataValues/includes/values/StringValue.php
+++ b/DataValues/includes/values/StringValue.php
@@ -51,6 +51,18 @@
throw new InvalidArgumentException( 'Can only construct 
StringValue from strings' );
}
 
+   // This is backporting the very evil hack I added for the last 
deployment as can be found
+   // here:
+   // 
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/DataValues.git;a=commitdiff;h=8a980bc893824dcf86be51350ede893fe950bce2
+   // 
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/DataValues.git;a=commitdiff;h=f049d35c3fd8cd69969396238a89e4dc31701f39
+   // It is still very evil. Last time I pledged that I would be 
loosing karma for a week.
+   // Since the following I had the unfortunate incident of a 
pulled hamstring - which, by
+   // the way, hurts a lot - I will refrain from committing any 
new karma this time. I hope
+   // that by the next deployment or two we can get rid of this 
terrible hack.
+   if ( mb_strlen( $value )  400 ) {
+   throw new InvalidArgumentException( 'String length 
exceeds limit of 400 characters' );
+   }
+
$this-value = $value;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b20d0d4bad5f68cd0cc440ee1995193ecec9abd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DataValues
Gerrit-Branch: mw1.22-wmf5
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] Stopgap to avoid excessively long string values (backport) - change (mediawiki...DataValues)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: Stopgap to avoid excessively long string values (backport)
..


Stopgap to avoid excessively long string values (backport)

Change-Id: I9b20d0d4bad5f68cd0cc440ee1995193ecec9abd
---
M DataValues/includes/values/StringValue.php
1 file changed, 12 insertions(+), 0 deletions(-)

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



diff --git a/DataValues/includes/values/StringValue.php 
b/DataValues/includes/values/StringValue.php
index a9164f8..678fa6d 100644
--- a/DataValues/includes/values/StringValue.php
+++ b/DataValues/includes/values/StringValue.php
@@ -51,6 +51,18 @@
throw new InvalidArgumentException( 'Can only construct 
StringValue from strings' );
}
 
+   // This is backporting the very evil hack I added for the last 
deployment as can be found
+   // here:
+   // 
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/DataValues.git;a=commitdiff;h=8a980bc893824dcf86be51350ede893fe950bce2
+   // 
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/DataValues.git;a=commitdiff;h=f049d35c3fd8cd69969396238a89e4dc31701f39
+   // It is still very evil. Last time I pledged that I would be 
loosing karma for a week.
+   // Since the following I had the unfortunate incident of a 
pulled hamstring - which, by
+   // the way, hurts a lot - I will refrain from committing any 
new karma this time. I hope
+   // that by the next deployment or two we can get rid of this 
terrible hack.
+   if ( mb_strlen( $value )  400 ) {
+   throw new InvalidArgumentException( 'String length 
exceeds limit of 400 characters' );
+   }
+
$this-value = $value;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9b20d0d4bad5f68cd0cc440ee1995193ecec9abd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DataValues
Gerrit-Branch: mw1.22-wmf5
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.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] Added UpdateFailedException - change (mediawiki...Wikibase)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: Added UpdateFailedException
..


Added UpdateFailedException

Change-Id: Ifd963ef53a0c18566c502e08b58a3888b7e1a6e8
---
A Database/includes/UpdateFailedException.php
M Database/tests/phpunit/SelectFailedExceptionTest.php
M Database/tests/phpunit/TableCreationFailedExceptionTest.php
A Database/tests/phpunit/UpdateFailedExceptionTest.php
4 files changed, 132 insertions(+), 2 deletions(-)

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



diff --git a/Database/includes/UpdateFailedException.php 
b/Database/includes/UpdateFailedException.php
new file mode 100644
index 000..efd1e38
--- /dev/null
+++ b/Database/includes/UpdateFailedException.php
@@ -0,0 +1,64 @@
+?php
+
+namespace Wikibase\Database;
+
+/**
+ * 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
+ *
+ * @since 0.1
+ *
+ * @file
+ * @ingroup WikibaseDatabase
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw  jeroended...@gmail.com 
+ */
+class UpdateFailedException extends QueryInterfaceException {
+
+   protected $tableName;
+   protected $values;
+   protected $conditions;
+
+   public function __construct( $tableName, array $values, array 
$conditions, $message = '', \Exception $previous = null ) {
+   parent::__construct( $message, 0, $previous );
+
+   $this-tableName = $tableName;
+   $this-conditions = $conditions;
+   $this-values = $values;
+   }
+
+   /**
+* @return string
+*/
+   public function getTableName() {
+   return $this-tableName;
+   }
+
+   /**
+* @return array
+*/
+   public function getConditions() {
+   return $this-conditions;
+   }
+
+   /**
+* @return array
+*/
+   public function getValues() {
+   return $this-values;
+   }
+
+}
\ No newline at end of file
diff --git a/Database/tests/phpunit/SelectFailedExceptionTest.php 
b/Database/tests/phpunit/SelectFailedExceptionTest.php
index 52a1462..7496190 100644
--- a/Database/tests/phpunit/SelectFailedExceptionTest.php
+++ b/Database/tests/phpunit/SelectFailedExceptionTest.php
@@ -5,7 +5,7 @@
 use Wikibase\Database\SelectFailedException;
 
 /**
- * @covers Wikibase\Database\SelectFailedException class.
+ * @covers Wikibase\Database\SelectFailedException
  *
  * 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
diff --git a/Database/tests/phpunit/TableCreationFailedExceptionTest.php 
b/Database/tests/phpunit/TableCreationFailedExceptionTest.php
index 3b6a719..2570293 100644
--- a/Database/tests/phpunit/TableCreationFailedExceptionTest.php
+++ b/Database/tests/phpunit/TableCreationFailedExceptionTest.php
@@ -5,7 +5,7 @@
 use Wikibase\Database\TableCreationFailedException;
 
 /**
- * @covers Wikibase\Database\TableCreationFailedException class.
+ * @covers Wikibase\Database\TableCreationFailedException
  *
  * 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
diff --git a/Database/tests/phpunit/UpdateFailedExceptionTest.php 
b/Database/tests/phpunit/UpdateFailedExceptionTest.php
new file mode 100644
index 000..46627a7
--- /dev/null
+++ b/Database/tests/phpunit/UpdateFailedExceptionTest.php
@@ -0,0 +1,66 @@
+?php
+
+namespace Wikibase\Database\Tests;
+
+use Wikibase\Database\UpdateFailedException;
+
+/**
+ * @covers Wikibase\Database\UpdateFailedException
+ *
+ * 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 

[MediaWiki-commits] [Gerrit] trim incoming string values - change (mediawiki...DataValues)

2013-05-22 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has uploaded a new change for review.

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


Change subject: trim incoming string values
..

trim incoming string values

Change-Id: I0055dddbb0b810432879d275e1e102069e7736c2
---
M DataValues/includes/values/StringValue.php
M DataValues/tests/phpunit/includes/values/StringValueTest.php
2 files changed, 5 insertions(+), 2 deletions(-)


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

diff --git a/DataValues/includes/values/StringValue.php 
b/DataValues/includes/values/StringValue.php
index 678fa6d..3c57840 100644
--- a/DataValues/includes/values/StringValue.php
+++ b/DataValues/includes/values/StringValue.php
@@ -63,7 +63,10 @@
throw new InvalidArgumentException( 'String length 
exceeds limit of 400 characters' );
}
 
-   $this-value = $value;
+   // The trim is not at the right place, but the right place 
would either need us to have
+   // the parsers or the options in place. So for now it seems 
that it is not hurting much
+   // here. It is only in the deployment branch. Like the one in 
the previous line of code.
+   $this-value = trim( $value );
}
 
/**
diff --git a/DataValues/tests/phpunit/includes/values/StringValueTest.php 
b/DataValues/tests/phpunit/includes/values/StringValueTest.php
index 3b588a1..ea0227d 100644
--- a/DataValues/tests/phpunit/includes/values/StringValueTest.php
+++ b/DataValues/tests/phpunit/includes/values/StringValueTest.php
@@ -64,7 +64,7 @@
$argLists[] = array( false, null );
$argLists[] = array( true, 'foo' );
$argLists[] = array( true, '' );
-   $argLists[] = array( true, ' foo bar baz foo bar baz foo bar 
baz foo bar baz foo bar baz foo bar baz ' );
+   $argLists[] = array( true, 'foo bar baz foo bar baz foo bar baz 
foo bar baz foo bar baz foo bar baz' );
 
return $argLists;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0055dddbb0b810432879d275e1e102069e7736c2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DataValues
Gerrit-Branch: mw1.22-wmf5
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] trim incoming string values - change (mediawiki...DataValues)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: trim incoming string values
..


trim incoming string values

Change-Id: I0055dddbb0b810432879d275e1e102069e7736c2
---
M DataValues/includes/values/StringValue.php
M DataValues/tests/phpunit/includes/values/StringValueTest.php
2 files changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/DataValues/includes/values/StringValue.php 
b/DataValues/includes/values/StringValue.php
index 678fa6d..3c57840 100644
--- a/DataValues/includes/values/StringValue.php
+++ b/DataValues/includes/values/StringValue.php
@@ -63,7 +63,10 @@
throw new InvalidArgumentException( 'String length 
exceeds limit of 400 characters' );
}
 
-   $this-value = $value;
+   // The trim is not at the right place, but the right place 
would either need us to have
+   // the parsers or the options in place. So for now it seems 
that it is not hurting much
+   // here. It is only in the deployment branch. Like the one in 
the previous line of code.
+   $this-value = trim( $value );
}
 
/**
diff --git a/DataValues/tests/phpunit/includes/values/StringValueTest.php 
b/DataValues/tests/phpunit/includes/values/StringValueTest.php
index 3b588a1..ea0227d 100644
--- a/DataValues/tests/phpunit/includes/values/StringValueTest.php
+++ b/DataValues/tests/phpunit/includes/values/StringValueTest.php
@@ -64,7 +64,7 @@
$argLists[] = array( false, null );
$argLists[] = array( true, 'foo' );
$argLists[] = array( true, '' );
-   $argLists[] = array( true, ' foo bar baz foo bar baz foo bar 
baz foo bar baz foo bar baz foo bar baz ' );
+   $argLists[] = array( true, 'foo bar baz foo bar baz foo bar baz 
foo bar baz foo bar baz foo bar baz' );
 
return $argLists;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0055dddbb0b810432879d275e1e102069e7736c2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DataValues
Gerrit-Branch: mw1.22-wmf5
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.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] Fix fatal when predefined properties are no longer exists - change (mediawiki...SemanticMediaWiki)

2013-05-22 Thread Mwjames (Code Review)
Mwjames has uploaded a new change for review.

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


Change subject: Fix fatal when predefined properties are no longer exists
..

Fix fatal when predefined properties are no longer exists

Bug: 48711

Change-Id: Ibfb2ceb33d0260c281b4d72a79deacdf14ac60d8
---
M SemanticMediaWiki.hooks.php
M includes/storage/SQLStore/SMW_DIHandler_WikiPage.php
M includes/storage/SQLStore/SMW_SQLStore3_Queries.php
M tests/phpunit/SemanticMediaWikiTestCase.php
A tests/phpunit/includes/storage/sqlstore/DIHandlerWikiPageTest.php
5 files changed, 163 insertions(+), 4 deletions(-)


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

diff --git a/SemanticMediaWiki.hooks.php b/SemanticMediaWiki.hooks.php
index 7be5ac8..77e1108 100644
--- a/SemanticMediaWiki.hooks.php
+++ b/SemanticMediaWiki.hooks.php
@@ -295,6 +295,7 @@
'storage/Store',
 
'storage/sqlstore/PropertyStatisticsTable',
+   'storage/sqlstore/DIHandlerWikiPage'
);
 
foreach ( $testFiles as $file ) {
diff --git a/includes/storage/SQLStore/SMW_DIHandler_WikiPage.php 
b/includes/storage/SQLStore/SMW_DIHandler_WikiPage.php
index 18faafb..88f37b5 100644
--- a/includes/storage/SQLStore/SMW_DIHandler_WikiPage.php
+++ b/includes/storage/SQLStore/SMW_DIHandler_WikiPage.php
@@ -112,6 +112,14 @@
if ( $namespace == SMW_NS_PROPERTY  $dbkeys[0] != '' 

$dbkeys[0]{0} == '_'  $dbkeys[2] == '' ) {
// Correctly interpret internal property keys
+
+   // Check id before invocation to avoid 
exception for non-existing
+   // but yet still residing as special properties 
in non-updated pages
+   // @see bug 48711
+   if ( 
SMWDIProperty::getPredefinedPropertyTypeId( $dbkeys[0] ) === '' ) {
+   return null;
+   }
+
$property = new SMWDIProperty( $dbkeys[0] );
$wikipage = $property-getDiWikiPage( 
$dbkeys[4] );
if ( !is_null( $wikipage ) ) {
diff --git a/includes/storage/SQLStore/SMW_SQLStore3_Queries.php 
b/includes/storage/SQLStore/SMW_SQLStore3_Queries.php
index 33f7d7e..1d03ff2 100644
--- a/includes/storage/SQLStore/SMW_SQLStore3_Queries.php
+++ b/includes/storage/SQLStore/SMW_SQLStore3_Queries.php
@@ -440,17 +440,21 @@
$diHandler = $this-m_store-getDataItemHandlerForDIType( 
SMWDataItem::TYPE_WIKIPAGE );
 
while ( ( $count  $query-getLimit() )  ( $row = 
$this-m_dbs-fetchObject( $res ) ) ) {
-   $count++;
if ( $row-iw === '' || $row-iw{0} != ':' )  {
-   $qr[] = $diHandler-dataItemFromDBKeys( array(
+   $dataItem = $diHandler-dataItemFromDBKeys( 
array(
$row-t,
intval( $row-ns ),
$row-iw,
'',
$row-so
) );
-   // These IDs are usually needed for displaying 
the page (esp. if more property values are displayed):
-   $this-m_store-smwIds-setCache( $row-t, 
$row-ns, $row-iw, $row-so, $row-id, $row-sortkey );
+
+   if ( $dataItem instanceof SMWDIWikiPage ) {
+   $count++;
+   $qr[] = $dataItem;
+   // These IDs are usually needed for 
displaying the page (esp. if more property values are displayed):
+   $this-m_store-smwIds-setCache( 
$row-t, $row-ns, $row-iw, $row-so, $row-id, $row-sortkey );
+   }
}
}
 
diff --git a/tests/phpunit/SemanticMediaWikiTestCase.php 
b/tests/phpunit/SemanticMediaWikiTestCase.php
index 76d9351..cdd93b7 100644
--- a/tests/phpunit/SemanticMediaWikiTestCase.php
+++ b/tests/phpunit/SemanticMediaWikiTestCase.php
@@ -109,6 +109,20 @@
}
 
/**
+* Helper method that returns a Store object
+*
+* @since 1.9
+*
+* @param string $id
+*
+* @return Store
+*/
+   protected function getStore( $id = null ) {
+   // FIXME Use StoreFactory here
+   return smwfGetStore();
+   }
+
+   /**
 * Helper method that returns a random string
 *
 * @since 

[MediaWiki-commits] [Gerrit] update and delete methods in QueryInterface now throw except... - change (mediawiki...Wikibase)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: update and delete methods in QueryInterface now throw 
exceptions rather then retruning a boolean
..


update and delete methods in QueryInterface now throw exceptions rather then 
retruning a boolean

Change-Id: I08f665f1700381cdd30114d1cfd2bc02953922d8
---
M Database/includes/MediaWikiQueryInterface.php
M Database/includes/QueryInterface.php
M Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
3 files changed, 67 insertions(+), 8 deletions(-)

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



diff --git a/Database/includes/MediaWikiQueryInterface.php 
b/Database/includes/MediaWikiQueryInterface.php
index 52bdf78..306da96 100644
--- a/Database/includes/MediaWikiQueryInterface.php
+++ b/Database/includes/MediaWikiQueryInterface.php
@@ -132,15 +132,19 @@
 * @param array $values
 * @param array $conditions
 *
-* @return boolean Success indicator
+* @throws UpdateFailedException
 */
public function update( $tableName, array $values, array $conditions ) {
-   return $this-getDB()-update(
+   $success = $this-getDB()-update(
$tableName,
$values,
$conditions,
__METHOD__
) !== false;
+
+   if ( !$success ) {
+   throw new UpdateFailedException( $tableName, $values, 
$conditions );
+   }
}
 
/**
@@ -151,14 +155,18 @@
 * @param string $tableName
 * @param array $conditions
 *
-* @return boolean Success indicator
+* @throws DeleteFailedException
 */
public function delete( $tableName, array $conditions ) {
-   return $this-getDB()-delete(
+   $success = $this-getDB()-delete(
$tableName,
$conditions,
__METHOD__
) !== false;
+
+   if ( !$success ) {
+   throw new DeleteFailedException( $tableName, 
$conditions );
+   }
}
 
/**
diff --git a/Database/includes/QueryInterface.php 
b/Database/includes/QueryInterface.php
index 79ffc8e..31bd3c9 100644
--- a/Database/includes/QueryInterface.php
+++ b/Database/includes/QueryInterface.php
@@ -74,6 +74,7 @@
 * @param array $values
 *
 * @return boolean Success indicator
+* TODO: change to exception
 */
public function insert( $tableName, array $values );
 
@@ -88,7 +89,7 @@
 * @param array $values
 * @param array $conditions
 *
-* @return boolean Success indicator
+* @throws UpdateFailedException
 */
public function update( $tableName, array $values, array $conditions );
 
@@ -102,7 +103,7 @@
 * @param string $tableName
 * @param array $conditions
 *
-* @return boolean Success indicator
+* @throw DeleteFailedException
 */
public function delete( $tableName, array $conditions );
 
diff --git a/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php 
b/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
index 731551c..0041288 100644
--- a/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
+++ b/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
@@ -246,7 +246,34 @@
$this-equalTo( $tableName ),
$this-equalTo( $newValues ),
$this-equalTo( $conditions )
-   );
+   )
+   -will( $this-returnValue( true ) );
+
+   $queryInterface-update(
+   $tableName,
+   $newValues,
+   $conditions
+   );
+   }
+
+   /**
+* @dataProvider updateProvider
+*/
+   public function testUpdateFailure( $tableName, array $newValues, array 
$conditions ) {
+   $connection = $this-getMock( 'DatabaseMysql' );
+   $extendedAbstraction = $this-getMockBuilder( 
'\Wikibase\Database\MWDB\ExtendedMySQLAbstraction' )
+   -disableOriginalConstructor()-getMock();
+
+   $queryInterface = new MediaWikiQueryInterface(
+   new DirectConnectionProvider( $connection ),
+   $extendedAbstraction
+   );
+
+   $connection-expects( $this-once() )
+   -method( 'update' )
+   -will( $this-returnValue( false ) );
+
+   $this-setExpectedException( 
'\Wikibase\Database\UpdateFailedException' );
 
$queryInterface-update(
$tableName,
@@ -312,7 +339,30 

[MediaWiki-commits] [Gerrit] Added DeleteFailedException - change (mediawiki...Wikibase)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: Added DeleteFailedException
..


Added DeleteFailedException

Change-Id: Ib70c85b202c1db9c8735baa94f9eb373c4b022f3
---
A Database/includes/DeleteFailedException.php
A Database/tests/phpunit/DeleteFailedExceptionTest.php
2 files changed, 117 insertions(+), 0 deletions(-)

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



diff --git a/Database/includes/DeleteFailedException.php 
b/Database/includes/DeleteFailedException.php
new file mode 100644
index 000..e940cc0
--- /dev/null
+++ b/Database/includes/DeleteFailedException.php
@@ -0,0 +1,55 @@
+?php
+
+namespace Wikibase\Database;
+
+/**
+ * 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
+ *
+ * @since 0.1
+ *
+ * @file
+ * @ingroup WikibaseDatabase
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw  jeroended...@gmail.com 
+ */
+class DeleteFailedException extends QueryInterfaceException {
+
+   protected $tableName;
+   protected $conditions;
+
+   public function __construct( $tableName, array $conditions, $message = 
'', \Exception $previous = null ) {
+   parent::__construct( $message, 0, $previous );
+
+   $this-tableName = $tableName;
+   $this-conditions = $conditions;
+   }
+
+   /**
+* @return string
+*/
+   public function getTableName() {
+   return $this-tableName;
+   }
+
+   /**
+* @return array
+*/
+   public function getConditions() {
+   return $this-conditions;
+   }
+
+}
diff --git a/Database/tests/phpunit/DeleteFailedExceptionTest.php 
b/Database/tests/phpunit/DeleteFailedExceptionTest.php
new file mode 100644
index 000..4ffc7c6
--- /dev/null
+++ b/Database/tests/phpunit/DeleteFailedExceptionTest.php
@@ -0,0 +1,62 @@
+?php
+
+namespace Wikibase\Database\Tests;
+
+use Wikibase\Database\DeleteFailedException;
+
+/**
+ * @covers Wikibase\Database\DeleteFailedException
+ *
+ * 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
+ * @since 0.1
+ *
+ * @ingroup WikibaseDatabaseTest
+ *
+ * @group Wikibase
+ * @group WikibaseDatabase
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw  jeroended...@gmail.com 
+ */
+class DeleteFailedExceptionTest extends \PHPUnit_Framework_TestCase {
+
+   public function testConstructorWithOnlyRequiredArguments() {
+   $tableName = 'nyancats';
+   $conditions = array( 'foo' = 42, 'awesome  9000' );
+
+   $exception = new DeleteFailedException( $tableName, $conditions 
);
+
+   $this-assertEquals( $tableName, $exception-getTableName() );
+   $this-assertEquals( $conditions, $exception-getConditions() );
+   }
+
+   public function testConstructorWithAllArguments() {
+   $tableName = 'users';
+   $conditions = array( 'foo' = 42 );
+   $message = 'NyanData all the way accross the sky!';
+   $previous = new \Exception( 'Onoez!' );
+
+   $exception = new DeleteFailedException( $tableName, 
$conditions, $message, $previous );
+
+   $this-assertEquals( $tableName, $exception-getTableName() );
+   $this-assertEquals( $conditions, $exception-getConditions() );
+   $this-assertEquals( $message, $exception-getMessage() );
+   $this-assertEquals( $previous, $exception-getPrevious() );
+   }
+
+}


[MediaWiki-commits] [Gerrit] Add @throws to QueryInterface interface - change (mediawiki...Wikibase)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: Add @throws to QueryInterface interface
..


Add @throws to QueryInterface interface

Change-Id: I8caf8db70dbd4ab82b651767f7780aa6444526f3
---
M Database/includes/QueryInterface.php
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Denny Vrandecic: Looks good to me, approved



diff --git a/Database/includes/QueryInterface.php 
b/Database/includes/QueryInterface.php
index 79ffc8e..052bbc5 100644
--- a/Database/includes/QueryInterface.php
+++ b/Database/includes/QueryInterface.php
@@ -49,6 +49,7 @@
 * @param TableDefinition $table
 *
 * @return boolean Success indicator
+* @throws TableCreationFailedException
 */
public function createTable( TableDefinition $table );
 
@@ -129,6 +130,7 @@
 * @param array $conditions
 *
 * @return ResultIterator
+* @throws SelectFailedException
 */
public function select( $tableName, array $fields, array $conditions );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8caf8db70dbd4ab82b651767f7780aa6444526f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.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] Updated depenedencies in composer.json - change (mediawiki...Wikibase)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: Updated depenedencies in composer.json
..


Updated depenedencies in composer.json

Change-Id: I8c1efb6f10681aa3ddcc0011e1a64210a1933c03
---
M composer.json
1 file changed, 4 insertions(+), 3 deletions(-)

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



diff --git a/composer.json b/composer.json
index e59854a..d19b577 100644
--- a/composer.json
+++ b/composer.json
@@ -13,8 +13,9 @@
 ],
 require: {
 php: =5.3.0,
-mediawiki/mediawiki: =1.20,
-diff/diff: =0.3,
-datavalues/datavalues: *
+mediawiki/core: =1.20,
+mediawiki/data-values: *,
+diff/diff: =0.6,
+ask/ask: *
 }
 }
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8c1efb6f10681aa3ddcc0011e1a64210a1933c03
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.de
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@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] Deprecated and removed some getPrefixedId usage in the DataM... - change (mediawiki...Wikibase)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Deprecated and removed some getPrefixedId usage in the 
DataModel component
..


Deprecated and removed some getPrefixedId usage in the DataModel component

Change-Id: Id80f31c8841c332d35dbf467cff1c739e0008613
---
M DataModel/DataModel/Entity/Entity.php
M DataModel/DataModel/Entity/EntityId.php
M DataModel/tests/phpunit/Snak/PropertyValueSnakTest.php
3 files changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/DataModel/DataModel/Entity/Entity.php 
b/DataModel/DataModel/Entity/Entity.php
index bf1ee16..0cba035 100644
--- a/DataModel/DataModel/Entity/Entity.php
+++ b/DataModel/DataModel/Entity/Entity.php
@@ -179,6 +179,7 @@
 * Returns a prefixed version of the entity's id or null if it is not 
in the datastore yet.
 *
 * @since 0.2
+* @deprecated since 0.4
 *
 * @return string|null
 */
@@ -897,6 +898,7 @@
 * Parses the claim GUID and returns the prefixed entity ID it contains.
 *
 * @since 0.3
+* @deprecated since 0.4
 *
 * @param string $claimKey
 *
diff --git a/DataModel/DataModel/Entity/EntityId.php 
b/DataModel/DataModel/Entity/EntityId.php
index d7f4a46..e51b855 100644
--- a/DataModel/DataModel/Entity/EntityId.php
+++ b/DataModel/DataModel/Entity/EntityId.php
@@ -187,7 +187,10 @@
}
 
/**
-* Return a string representation of this entity id. Equal to 
getPrefixedId().
+* Return a string representation of this entity id.
+*
+* Note: this was previously documented to be equal to the now 
deprecated getPrefixedId
+* This will stop being the case when getPrefixedId gets removed, so 
should not be relied upon.
 *
 * @since 0.3
 *
diff --git a/DataModel/tests/phpunit/Snak/PropertyValueSnakTest.php 
b/DataModel/tests/phpunit/Snak/PropertyValueSnakTest.php
index f5ae894..b82d3ac 100644
--- a/DataModel/tests/phpunit/Snak/PropertyValueSnakTest.php
+++ b/DataModel/tests/phpunit/Snak/PropertyValueSnakTest.php
@@ -109,7 +109,7 @@
 
$this-assertInstanceOf( '\Wikibase\PropertyValueSnak', 
$instance );
$this-assertTrue( $instance-getDataValue()-equals( 
$dataValue ) );
-   $this-assertEquals( $property-getPrefixedId(), 
$instance-getPropertyId()-getPrefixedId() );
+   $this-assertEquals( $property-getId(), 
$instance-getPropertyId() );
}
 
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id80f31c8841c332d35dbf467cff1c739e0008613
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Anja Jentzsch a...@anjeve.de
Gerrit-Reviewer: Ataherivand abraham.taheriv...@wikimedia.de
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Daniel Werner daniel.wer...@wikimedia.de
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.de
Gerrit-Reviewer: Henning Snater henning.sna...@wikimedia.de
Gerrit-Reviewer: Jens Ohlig jens.oh...@wikimedia.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: John Erling Blad jeb...@gmail.com
Gerrit-Reviewer: Lydia Pintscher lydia.pintsc...@wikimedia.de
Gerrit-Reviewer: Markus Kroetzsch mar...@semantic-mediawiki.org
Gerrit-Reviewer: Nikola Smolenski smole...@eunet.rs
Gerrit-Reviewer: Silke Meyer silke.me...@wikimedia.de
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.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] Have insert in QueryInterface throw an exception rather then... - change (mediawiki...Wikibase)

2013-05-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Have insert in QueryInterface throw an exception rather then 
returning a boolean
..

Have insert in QueryInterface throw an exception rather then returning a boolean

Change-Id: I244983421b62e78658bfd726e704922ec68646f4
---
M Database/includes/MediaWikiQueryInterface.php
M Database/includes/QueryInterface.php
M Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
3 files changed, 34 insertions(+), 5 deletions(-)


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

diff --git a/Database/includes/MediaWikiQueryInterface.php 
b/Database/includes/MediaWikiQueryInterface.php
index 306da96..d0c0026 100644
--- a/Database/includes/MediaWikiQueryInterface.php
+++ b/Database/includes/MediaWikiQueryInterface.php
@@ -113,14 +113,18 @@
 * @param string $tableName
 * @param array $values
 *
-* @return boolean Success indicator
+* @throws InsertFailedException
 */
public function insert( $tableName, array $values ) {
-   return $this-getDB()-insert(
+   $success = $this-getDB()-insert(
$tableName,
$values,
__METHOD__
) !== false;
+
+   if ( !$success ) {
+   throw new InsertFailedException( $tableName, $values );
+   }
}
 
/**
diff --git a/Database/includes/QueryInterface.php 
b/Database/includes/QueryInterface.php
index add6206..647c205 100644
--- a/Database/includes/QueryInterface.php
+++ b/Database/includes/QueryInterface.php
@@ -74,8 +74,7 @@
 * @param string $tableName
 * @param array $values
 *
-* @return boolean Success indicator
-* TODO: change to exception
+* @throws InsertFailedException
 */
public function insert( $tableName, array $values );
 
diff --git a/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php 
b/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
index 0041288..94ee771 100644
--- a/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
+++ b/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
@@ -202,7 +202,33 @@
-with(
$this-equalTo( $tableName ),
$this-equalTo( $fieldValues )
-   );
+   )
+   -will( $this-returnValue( true ) );
+
+   $queryInterface-insert(
+   $tableName,
+   $fieldValues
+   );
+   }
+
+   /**
+* @dataProvider insertProvider
+*/
+   public function testInsertFailure( $tableName, array $fieldValues ) {
+   $connection = $this-getMock( 'DatabaseMysql' );
+   $extendedAbstraction = $this-getMockBuilder( 
'\Wikibase\Database\MWDB\ExtendedMySQLAbstraction' )
+   -disableOriginalConstructor()-getMock();
+
+   $queryInterface = new MediaWikiQueryInterface(
+   new DirectConnectionProvider( $connection ),
+   $extendedAbstraction
+   );
+
+   $connection-expects( $this-once() )
+   -method( 'insert' )
+   -will( $this-returnValue( false ) );
+
+   $this-setExpectedException( 
'\Wikibase\Database\InsertFailedException' );
 
$queryInterface-insert(
$tableName,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I244983421b62e78658bfd726e704922ec68646f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com

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


[MediaWiki-commits] [Gerrit] Added InsertFailedException - change (mediawiki...Wikibase)

2013-05-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Added InsertFailedException
..

Added InsertFailedException

Change-Id: I12a18822c4f4ee2e8ea3cf950edba33fa53e59dc
---
M Database/includes/DeleteFailedException.php
A Database/includes/InsertFailedException.php
A Database/tests/phpunit/InsertFailedExceptionTest.php
3 files changed, 119 insertions(+), 2 deletions(-)


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

diff --git a/Database/includes/DeleteFailedException.php 
b/Database/includes/DeleteFailedException.php
index e940cc0..41b135b 100644
--- a/Database/includes/DeleteFailedException.php
+++ b/Database/includes/DeleteFailedException.php
@@ -31,11 +31,11 @@
protected $tableName;
protected $conditions;
 
-   public function __construct( $tableName, array $conditions, $message = 
'', \Exception $previous = null ) {
+   public function __construct( $tableName, array $values, $message = '', 
\Exception $previous = null ) {
parent::__construct( $message, 0, $previous );
 
$this-tableName = $tableName;
-   $this-conditions = $conditions;
+   $this-conditions = $values;
}
 
/**
diff --git a/Database/includes/InsertFailedException.php 
b/Database/includes/InsertFailedException.php
new file mode 100644
index 000..aa7cb19
--- /dev/null
+++ b/Database/includes/InsertFailedException.php
@@ -0,0 +1,55 @@
+?php
+
+namespace Wikibase\Database;
+
+/**
+ * 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
+ *
+ * @since 0.1
+ *
+ * @file
+ * @ingroup WikibaseDatabase
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw  jeroended...@gmail.com 
+ */
+class InsertFailedException extends QueryInterfaceException {
+
+   protected $tableName;
+   protected $values;
+
+   public function __construct( $tableName, array $values, $message = '', 
\Exception $previous = null ) {
+   parent::__construct( $message, 0, $previous );
+
+   $this-tableName = $tableName;
+   $this-values = $values;
+   }
+
+   /**
+* @return string
+*/
+   public function getTableName() {
+   return $this-tableName;
+   }
+
+   /**
+* @return array
+*/
+   public function getValues() {
+   return $this-values;
+   }
+
+}
diff --git a/Database/tests/phpunit/InsertFailedExceptionTest.php 
b/Database/tests/phpunit/InsertFailedExceptionTest.php
new file mode 100644
index 000..d3dc897
--- /dev/null
+++ b/Database/tests/phpunit/InsertFailedExceptionTest.php
@@ -0,0 +1,62 @@
+?php
+
+namespace Wikibase\Database\Tests;
+
+use Wikibase\Database\InsertFailedException;
+
+/**
+ * @covers Wikibase\Database\InsertFailedException
+ *
+ * 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
+ * @since 0.1
+ *
+ * @ingroup WikibaseDatabaseTest
+ *
+ * @group Wikibase
+ * @group WikibaseDatabase
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw  jeroended...@gmail.com 
+ */
+class InsertFailedExceptionTest extends \PHPUnit_Framework_TestCase {
+
+   public function testConstructorWithOnlyRequiredArguments() {
+   $tableName = 'nyancats';
+   $values = array( 'foo' = 42, 'awesome  9000' );
+
+   $exception = new InsertFailedException( $tableName, $values );
+
+   $this-assertEquals( 

[MediaWiki-commits] [Gerrit] Have insert in QueryInterface throw an exception rather then... - change (mediawiki...Wikibase)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Have insert in QueryInterface throw an exception rather then 
returning a boolean
..


Have insert in QueryInterface throw an exception rather then returning a boolean

Change-Id: I244983421b62e78658bfd726e704922ec68646f4
---
M Database/includes/MediaWikiQueryInterface.php
M Database/includes/QueryInterface.php
M Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
3 files changed, 34 insertions(+), 5 deletions(-)

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



diff --git a/Database/includes/MediaWikiQueryInterface.php 
b/Database/includes/MediaWikiQueryInterface.php
index 306da96..d0c0026 100644
--- a/Database/includes/MediaWikiQueryInterface.php
+++ b/Database/includes/MediaWikiQueryInterface.php
@@ -113,14 +113,18 @@
 * @param string $tableName
 * @param array $values
 *
-* @return boolean Success indicator
+* @throws InsertFailedException
 */
public function insert( $tableName, array $values ) {
-   return $this-getDB()-insert(
+   $success = $this-getDB()-insert(
$tableName,
$values,
__METHOD__
) !== false;
+
+   if ( !$success ) {
+   throw new InsertFailedException( $tableName, $values );
+   }
}
 
/**
diff --git a/Database/includes/QueryInterface.php 
b/Database/includes/QueryInterface.php
index add6206..647c205 100644
--- a/Database/includes/QueryInterface.php
+++ b/Database/includes/QueryInterface.php
@@ -74,8 +74,7 @@
 * @param string $tableName
 * @param array $values
 *
-* @return boolean Success indicator
-* TODO: change to exception
+* @throws InsertFailedException
 */
public function insert( $tableName, array $values );
 
diff --git a/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php 
b/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
index 0041288..94ee771 100644
--- a/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
+++ b/Database/tests/phpunit/MediaWikiQueryInterfaceTest.php
@@ -202,7 +202,33 @@
-with(
$this-equalTo( $tableName ),
$this-equalTo( $fieldValues )
-   );
+   )
+   -will( $this-returnValue( true ) );
+
+   $queryInterface-insert(
+   $tableName,
+   $fieldValues
+   );
+   }
+
+   /**
+* @dataProvider insertProvider
+*/
+   public function testInsertFailure( $tableName, array $fieldValues ) {
+   $connection = $this-getMock( 'DatabaseMysql' );
+   $extendedAbstraction = $this-getMockBuilder( 
'\Wikibase\Database\MWDB\ExtendedMySQLAbstraction' )
+   -disableOriginalConstructor()-getMock();
+
+   $queryInterface = new MediaWikiQueryInterface(
+   new DirectConnectionProvider( $connection ),
+   $extendedAbstraction
+   );
+
+   $connection-expects( $this-once() )
+   -method( 'insert' )
+   -will( $this-returnValue( false ) );
+
+   $this-setExpectedException( 
'\Wikibase\Database\InsertFailedException' );
 
$queryInterface-insert(
$tableName,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I244983421b62e78658bfd726e704922ec68646f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Denny Vrandecic denny.vrande...@wikimedia.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] Added InsertFailedException - change (mediawiki...Wikibase)

2013-05-22 Thread Denny Vrandecic (Code Review)
Denny Vrandecic has submitted this change and it was merged.

Change subject: Added InsertFailedException
..


Added InsertFailedException

Change-Id: I12a18822c4f4ee2e8ea3cf950edba33fa53e59dc
---
M Database/includes/DeleteFailedException.php
A Database/includes/InsertFailedException.php
A Database/tests/phpunit/InsertFailedExceptionTest.php
3 files changed, 119 insertions(+), 2 deletions(-)

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



diff --git a/Database/includes/DeleteFailedException.php 
b/Database/includes/DeleteFailedException.php
index e940cc0..41b135b 100644
--- a/Database/includes/DeleteFailedException.php
+++ b/Database/includes/DeleteFailedException.php
@@ -31,11 +31,11 @@
protected $tableName;
protected $conditions;
 
-   public function __construct( $tableName, array $conditions, $message = 
'', \Exception $previous = null ) {
+   public function __construct( $tableName, array $values, $message = '', 
\Exception $previous = null ) {
parent::__construct( $message, 0, $previous );
 
$this-tableName = $tableName;
-   $this-conditions = $conditions;
+   $this-conditions = $values;
}
 
/**
diff --git a/Database/includes/InsertFailedException.php 
b/Database/includes/InsertFailedException.php
new file mode 100644
index 000..aa7cb19
--- /dev/null
+++ b/Database/includes/InsertFailedException.php
@@ -0,0 +1,55 @@
+?php
+
+namespace Wikibase\Database;
+
+/**
+ * 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
+ *
+ * @since 0.1
+ *
+ * @file
+ * @ingroup WikibaseDatabase
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw  jeroended...@gmail.com 
+ */
+class InsertFailedException extends QueryInterfaceException {
+
+   protected $tableName;
+   protected $values;
+
+   public function __construct( $tableName, array $values, $message = '', 
\Exception $previous = null ) {
+   parent::__construct( $message, 0, $previous );
+
+   $this-tableName = $tableName;
+   $this-values = $values;
+   }
+
+   /**
+* @return string
+*/
+   public function getTableName() {
+   return $this-tableName;
+   }
+
+   /**
+* @return array
+*/
+   public function getValues() {
+   return $this-values;
+   }
+
+}
diff --git a/Database/tests/phpunit/InsertFailedExceptionTest.php 
b/Database/tests/phpunit/InsertFailedExceptionTest.php
new file mode 100644
index 000..d3dc897
--- /dev/null
+++ b/Database/tests/phpunit/InsertFailedExceptionTest.php
@@ -0,0 +1,62 @@
+?php
+
+namespace Wikibase\Database\Tests;
+
+use Wikibase\Database\InsertFailedException;
+
+/**
+ * @covers Wikibase\Database\InsertFailedException
+ *
+ * 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
+ * @since 0.1
+ *
+ * @ingroup WikibaseDatabaseTest
+ *
+ * @group Wikibase
+ * @group WikibaseDatabase
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw  jeroended...@gmail.com 
+ */
+class InsertFailedExceptionTest extends \PHPUnit_Framework_TestCase {
+
+   public function testConstructorWithOnlyRequiredArguments() {
+   $tableName = 'nyancats';
+   $values = array( 'foo' = 42, 'awesome  9000' );
+
+   $exception = new InsertFailedException( $tableName, $values );
+
+   $this-assertEquals( $tableName, $exception-getTableName() );
+ 

[MediaWiki-commits] [Gerrit] User::saveOptions() optimization - change (mediawiki/core)

2013-05-22 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

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


Change subject: User::saveOptions() optimization
..

User::saveOptions() optimization

Since we only want to save non default user options, we have to strip
out any user option that match the default ones. We did that by calling
User::getDefaultOption( 'some option name' ); on each of the option.

Since the User mOptions property is a merge of the default option, we
end up doing a lot of unneeded processing. The loop roughly looks like:

 User::getDefaultOption()
   User::getDefaultOptions()
 Language-getCode()
 SearchEngine::searchableNamespaces()
   language-getNamespaces()
   wfRunHooks('SearcheableNamespaces')
 wfRunHooks('UserGetDefaultOptions')

For EACH of the mOptions.

Instead this patch does an array_diff to strip out from mObjects any
default option.  We still skip options whose value is false or null.

Test provided to make sure we only save what we want.

Change-Id: Ie98d3a17edab74401ed32f759ba11f723b56e376
---
M includes/User.php
M tests/phpunit/includes/UserTest.php
2 files changed, 54 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/41/64941/1

diff --git a/includes/User.php b/includes/User.php
index e2cbb81..52b58f4 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -4455,20 +4455,22 @@
return;
}
 
+   $defaultOptions = self::getDefaultOptions();
+
$userId = $this-getId();
$insert_rows = array();
-   foreach ( $saveOptions as $key = $value ) {
-   # Don't bother storing default values
-   $defaultOption = self::getDefaultOption( $key );
-   if ( ( is_null( $defaultOption ) 
-   !( $value === false || is_null( $value 
) ) ) ||
-   $value != $defaultOption ) {
-   $insert_rows[] = array(
-   'up_user' = $userId,
-   'up_property' = $key,
-   'up_value' = $value,
-   );
+
+   # Only bother storing values that changed
+   $changedOptions = array_diff( $saveOptions, $defaultOptions );
+   foreach( $changedOptions as $key = $value ) {
+   if( $value === false || is_null($value) ) {
+   continue;
}
+   $insert_rows[] = array(
+   'up_user' = $userId,
+   'up_property' = $key,
+   'up_value' = $value,
+   );
}
 
$dbw = wfGetDB( DB_MASTER );
diff --git a/tests/phpunit/includes/UserTest.php 
b/tests/phpunit/includes/UserTest.php
index e777179..e22b339 100644
--- a/tests/phpunit/includes/UserTest.php
+++ b/tests/phpunit/includes/UserTest.php
@@ -214,4 +214,45 @@
$this-assertEquals( $wgDefaultUserOptions['cols'], 
$this-user-getOption( 'cols' ) );
$this-assertEquals( 'test', $this-user-getOption( 
'someoption' ) );
}
+
+   /**
+* Helper, fetch user properties from the database.
+* @param int $userId
+*/
+   function dbUserProperties( $userId ) {
+   $res = wfGetDB(DB_SLAVE)-select(
+   'user_properties',
+   array( 'up_property', 'up_value' ),
+   array( 'up_user' = $userId ),
+   __METHOD__
+   );
+
+   return $res-fetchRow();
+   }
+
+   public function testOnlySaveChangedOptions() {
+   $user = User::newFromName( 'UnitTestUser2' );
+   $user-addToDatabase();
+
+   // Fresh user only has default, so nothing should be in the DB
+   $dbProps = $this-dbUserProperties( $user-getId() );
+   $this-assertEquals( false, $dbProps,
+   A new user should not have any user property saved in 
the DB );
+
+   // Make sure we only save the altered option
+   $user-setOption( 'changed_opt', 'alix_20281' );
+   $user-saveSettings();
+
+   $expected = array (
+   'up_property' = 'changed_opt',
+   0 = 'changed_opt',
+   'up_value' = 'alix_20281',
+   1 = 'alix_20281',
+   );
+   $dbProps = $this-dbUserProperties( $user-getId() );
+
+   $this-assertEquals( $expected, $dbProps,
+   non default options should be saved, and default ones 
should not );
+
+  

[MediaWiki-commits] [Gerrit] Improvements to EntityContentFactory and its tests - change (mediawiki...Wikibase)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Improvements to EntityContentFactory and its tests
..


Improvements to EntityContentFactory and its tests

Change-Id: I563d902b3d6a5c9b84b4a43652dc8d0f90c7d57b
---
M DataModel/DataModel/Snak/PropertyValueSnak.php
M lib/tests/phpunit/store/WikiPageEntityLookupTest.php
M repo/includes/WikibaseRepo.php
M repo/includes/content/EntityContentFactory.php
M repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
5 files changed, 106 insertions(+), 18 deletions(-)

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



diff --git a/DataModel/DataModel/Snak/PropertyValueSnak.php 
b/DataModel/DataModel/Snak/PropertyValueSnak.php
index 2a9e3db..fcc4d7b 100644
--- a/DataModel/DataModel/Snak/PropertyValueSnak.php
+++ b/DataModel/DataModel/Snak/PropertyValueSnak.php
@@ -124,6 +124,7 @@
 * The DataValue
 *
 * @since 0.3
+* @deprecated since 0.4
 *
 * @param EntityId $propertyId
 * @param mixed $rawDataValue
diff --git a/lib/tests/phpunit/store/WikiPageEntityLookupTest.php 
b/lib/tests/phpunit/store/WikiPageEntityLookupTest.php
index cacbe41..1b9636e 100644
--- a/lib/tests/phpunit/store/WikiPageEntityLookupTest.php
+++ b/lib/tests/phpunit/store/WikiPageEntityLookupTest.php
@@ -111,6 +111,7 @@
throw new \MWException( Can't generate test entities 
in a client database. );
}
 
+   // FIXME: this is using repo functionality
$content = 
\Wikibase\EntityContentFactory::singleton()-newFromEntity( $entity );
$status = $content-save( storeTestEntity );
 
diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index d63ec1b..62e40f2 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -5,6 +5,7 @@
 use DataTypes\DataTypeFactory;
 use ValueFormatters\FormatterOptions;
 use ValueParsers\ParserOptions;
+use Wikibase\EntityContentFactory;
 use Wikibase\Lib\EntityIdFormatter;
 use Wikibase\Lib\EntityIdLabelFormatter;
 use Wikibase\Lib\EntityIdParser;
@@ -84,6 +85,20 @@
/**
 * @since 0.4
 *
+* @return EntityContentFactory
+*/
+   public function getEntityContentFactory() {
+   $entityNamespaces = $this-settings-getSetting( 
'entityNamespaces' );
+
+   return new EntityContentFactory(
+   $this-getIdFormatter(),
+   is_array( $entityNamespaces ) ? array_keys( 
$entityNamespaces ) : array()
+   );
+   }
+
+   /**
+* @since 0.4
+*
 * @return EntityIdFormatter
 */
public function getIdFormatter() {
diff --git a/repo/includes/content/EntityContentFactory.php 
b/repo/includes/content/EntityContentFactory.php
index 6e47e9b..10f71c5 100644
--- a/repo/includes/content/EntityContentFactory.php
+++ b/repo/includes/content/EntityContentFactory.php
@@ -1,7 +1,13 @@
 ?php
 
 namespace Wikibase;
-use MWException, Title, WikiPage, Revision;
+
+use MWException;
+use Title;
+use WikiPage;
+use Revision;
+use Wikibase\Lib\EntityIdFormatter;
+use Wikibase\Repo\WikibaseRepo;
 
 /**
  * Factory for EntityContent objects.
@@ -33,6 +39,7 @@
 
/**
 * @since 0.2
+* @deprecated since 0.4
 *
 * @return EntityContentFactory
 */
@@ -40,10 +47,24 @@
static $instance = false;
 
if ( $instance === false ) {
-   $instance = new static();
+   $instance = 
WikibaseRepo::newInstance()-getEntityContentFactory();
}
 
return $instance;
+   }
+
+   // TODO: inject this map and allow extensions to somehow extend it
+   protected static $typeMap = array(
+   Item::ENTITY_TYPE = CONTENT_MODEL_WIKIBASE_ITEM,
+   Property::ENTITY_TYPE = CONTENT_MODEL_WIKIBASE_PROPERTY,
+   );
+
+   protected $idFormatter;
+   protected $contentModelIds;
+
+   public function __construct( EntityIdFormatter $idFormatter, array 
$contentModelIds ) {
+   $this-idFormatter = $idFormatter;
+   $this-contentModelIds = $contentModelIds;
}
 
/**
@@ -62,15 +83,13 @@
 
/**
 * Returns a list of content model IDs that are used to represent 
Wikibase entities.
-* Configured via $wgWBRepoSettings['entityNamespaces'].
 *
 * @since 0.2
 *
 * @return array An array of string content model IDs.
 */
public function getEntityContentModels() {
-   $namespaces = Settings::get( 'entityNamespaces' );
-   return is_array( $namespaces ) ? array_keys( $namespaces ) : 
array();
+   return $this-contentModelIds;
}
 
/**
@@ -139,7 +158,7 

[MediaWiki-commits] [Gerrit] Changing metrics.wikimedia.org htpasswd - change (operations/puppet)

2013-05-22 Thread Ottomata (Code Review)
Ottomata has uploaded a new change for review.

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


Change subject: Changing metrics.wikimedia.org htpasswd
..

Changing metrics.wikimedia.org htpasswd

Change-Id: I3a785546d8d5ed1c46df21ab4c6ae62ce908d27b
---
M manifests/misc/statistics.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/42/64942/1

diff --git a/manifests/misc/statistics.pp b/manifests/misc/statistics.pp
index ca7baaa..423e6d6 100644
--- a/manifests/misc/statistics.pp
+++ b/manifests/misc/statistics.pp
@@ -383,7 +383,7 @@
 
# install a .htpasswd file for E3
file { $e3_home/.htpasswd:
-   content  = 'e3:$apr1$krR9Lhez$Yr0Ya9GpCW8KRQLeyR5Rn.',
+   content  = $passwords::e3::metrics::htpasswd_content,
owner= $metrics_user,
group= wikidev,
mode = 0664,

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

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

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


[MediaWiki-commits] [Gerrit] Changing metrics.wikimedia.org htpasswd - change (operations/puppet)

2013-05-22 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged.

Change subject: Changing metrics.wikimedia.org htpasswd
..


Changing metrics.wikimedia.org htpasswd

Change-Id: I3a785546d8d5ed1c46df21ab4c6ae62ce908d27b
---
M manifests/misc/statistics.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/manifests/misc/statistics.pp b/manifests/misc/statistics.pp
index ca7baaa..423e6d6 100644
--- a/manifests/misc/statistics.pp
+++ b/manifests/misc/statistics.pp
@@ -383,7 +383,7 @@
 
# install a .htpasswd file for E3
file { $e3_home/.htpasswd:
-   content  = 'e3:$apr1$krR9Lhez$Yr0Ya9GpCW8KRQLeyR5Rn.',
+   content  = $passwords::e3::metrics::htpasswd_content,
owner= $metrics_user,
group= wikidev,
mode = 0664,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3a785546d8d5ed1c46df21ab4c6ae62ce908d27b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata o...@wikimedia.org
Gerrit-Reviewer: Ottomata o...@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] Y U NO DECENT LOAD MEACHANISM? [DO NOT MERGE] - change (mediawiki...Wikibase)

2013-05-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Y U NO DECENT LOAD MEACHANISM? [DO NOT MERGE]
..

Y U NO DECENT LOAD MEACHANISM? [DO NOT MERGE]

Change-Id: I6ea07de3d42ba75ccd9a36f865b230f4e0d3efbb
---
M Database/tests/bootstrap.php
1 file changed, 18 insertions(+), 0 deletions(-)


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

diff --git a/Database/tests/bootstrap.php b/Database/tests/bootstrap.php
index 185a4e6..a17be67 100644
--- a/Database/tests/bootstrap.php
+++ b/Database/tests/bootstrap.php
@@ -12,6 +12,24 @@
  * @author Jeroen De Dauw  jeroended...@gmail.com 
  */
 
+$IP = getenv( 'MW_INSTALL_PATH' );
+
+if ( $IP === false ) {
+   $IP = dirname( __FILE__ ) . '/../../../..';
+}
+
+require_once( $IP . '/maintenance/Maintenance.php' );
+
+class WhyYouNoHasDecentLoadingMechanism extends Maintenance {
+   public function execute() {}
+}
+
+$maintClass = 'WhyYouNoHasDecentLoadingMechanism';
+require_once( DO_MAINTENANCE );
+
+require_once( $IP . '/includes/AutoLoader.php' );
+
+
 require_once( __DIR__ . '/../Database.php' );
 
 require_once( __DIR__ . '/testLoader.php' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ea07de3d42ba75ccd9a36f865b230f4e0d3efbb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com

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


[MediaWiki-commits] [Gerrit] Take care of TableBuilder TODO in QueryEngine component - change (mediawiki...Wikibase)

2013-05-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Take care of TableBuilder TODO in QueryEngine component
..

Take care of TableBuilder TODO in QueryEngine component

Change-Id: I8599380fdc8b931a112eae98213ee402a855982d
---
M QueryEngine/includes/SQLStore/Factory.php
M QueryEngine/includes/SQLStore/Store.php
M QueryEngine/tests/phpunit/SQLStore/FactoryTest.php
3 files changed, 12 insertions(+), 23 deletions(-)


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

diff --git a/QueryEngine/includes/SQLStore/Factory.php 
b/QueryEngine/includes/SQLStore/Factory.php
index c00562c..c07f695 100644
--- a/QueryEngine/includes/SQLStore/Factory.php
+++ b/QueryEngine/includes/SQLStore/Factory.php
@@ -3,6 +3,7 @@
 namespace Wikibase\QueryEngine\SQLStore;
 
 use Wikibase\Database\QueryInterface;
+use Wikibase\Database\TableBuilder;
 use Wikibase\QueryEngine\SQLStore\ClaimStore\ClaimInserter;
 use Wikibase\QueryEngine\SQLStore\ClaimStore\ClaimRowBuilder;
 use Wikibase\QueryEngine\SQLStore\ClaimStore\ClaimsTable;
@@ -154,4 +155,8 @@
);
}
 
+   public function getTableBuilder() {
+   return new TableBuilder( $this-queryInterface );
+   }
+
 }
diff --git a/QueryEngine/includes/SQLStore/Store.php 
b/QueryEngine/includes/SQLStore/Store.php
index ac14857..68a7cfa 100644
--- a/QueryEngine/includes/SQLStore/Store.php
+++ b/QueryEngine/includes/SQLStore/Store.php
@@ -4,7 +4,6 @@
 
 use MessageReporter;
 use Wikibase\Database\QueryInterface;
-use Wikibase\Database\TableBuilder;
 use Wikibase\QueryEngine\QueryStore;
 use Wikibase\QueryEngine\SQLStore\Engine\DescriptionMatchFinder;
 use Wikibase\QueryEngine\SQLStore\Engine\Engine;
@@ -54,13 +53,6 @@
/**
 * @since 0.1
 *
-* @var TableBuilder|null
-*/
-   private $tableBuilder;
-
-   /**
-* @since 0.1
-*
 * @var Factory
 */
private $factory;
@@ -75,21 +67,6 @@
$this-config = $config;
$this-queryInterface = $queryInterface;
$this-factory = new Factory( $config, $queryInterface );
-
-   $this-tableBuilder = new TableBuilder( $this-queryInterface );
-   }
-
-   /**
-* Sets the table builder to use for creating tables.
-*
-* @deprecated TODO: move to config
-*
-* @since 0.1
-*
-* @param TableBuilder $tableBuilder
-*/
-   public function setTableBuilder( TableBuilder $tableBuilder ) {
-   $this-tableBuilder = $tableBuilder;
}
 
/**
diff --git a/QueryEngine/tests/phpunit/SQLStore/FactoryTest.php 
b/QueryEngine/tests/phpunit/SQLStore/FactoryTest.php
index 72cbb59..7081b5c 100644
--- a/QueryEngine/tests/phpunit/SQLStore/FactoryTest.php
+++ b/QueryEngine/tests/phpunit/SQLStore/FactoryTest.php
@@ -83,4 +83,11 @@
);
}
 
+   public function testGetTableBuilderReturnType() {
+   $this-assertInstanceOf(
+   'Wikibase\Database\TableBuilder',
+   $this-newInstance()-getTableBuilder()
+   );
+   }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8599380fdc8b931a112eae98213ee402a855982d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com

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


[MediaWiki-commits] [Gerrit] Revert HTMLCheckMatrix support for forcing options on/off - change (mediawiki/core)

2013-05-22 Thread Catrope (Code Review)
Catrope has uploaded a new change for review.

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


Change subject: Revert HTMLCheckMatrix support for forcing options on/off
..

Revert HTMLCheckMatrix support for forcing options on/off

This reverts commit fe15256643a0a5b52372fd865ad15108a0f22454.

Change-Id: Ie1f8f2a815c956764fbf02a05259133353c8d340
---
M includes/HTMLForm.php
M includes/Preferences.php
D tests/phpunit/includes/HTMLCheckMatrixTest.php
3 files changed, 46 insertions(+), 214 deletions(-)


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

diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php
index e2fa5fd..5e3bb06 100644
--- a/includes/HTMLForm.php
+++ b/includes/HTMLForm.php
@@ -1844,33 +1844,9 @@
  * A checkbox matrix
  * Operates similarly to HTMLMultiSelectField, but instead of using an array of
  * options, uses an array of rows and an array of columns to dynamically
- * construct a matrix of options. The tags used to identify a particular cell
- * are of the form columnName-rowName
- *
- * Options:
- *   columns:   Required list of columns in the matrix.
- *   rows:  Required list of rows in the matrix.
- *   force-options-on:  Accepts array of column-row tags to be displayed as 
enabled
- *  but unavailable to change
- *   force-options-off: Accepts array of column-row tags to be displayed as 
disabled
- *  but unavailable to change.
+ * construct a matrix of options.
  */
-class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable {
-
-   static private $requiredParams = array(
-   // Required by underlying HTMLFormField
-   'fieldname',
-   // Required by HTMLCheckMatrix
-   'rows', 'columns'
-   );
-
-   public function __construct( $params ) {
-   $missing = array_diff( self::$requiredParams, array_keys( 
$params ) );
-   if ( $missing ) {
-   throw HTMLFormFieldRequiredOptionsException::create( 
$this, $missing );
-   }
-   parent::__construct( $params );
-   }
+class HTMLCheckMatrix extends HTMLFormField {
 
function validate( $value, $alldata ) {
$rows = $this-mParams['rows'];
@@ -1934,25 +1910,23 @@
foreach ( $rows as $rowLabel = $rowTag ) {
$rowContents = Html::rawElement( 'td', array(), 
$rowLabel );
foreach ( $columns as $columnTag ) {
-   $thisTag = $columnTag-$rowTag;
-   // Construct the checkbox
-   $thisAttribs = array(
-   'id' = {$this-mID}-$thisTag,
-   'value' = $thisTag,
-   );
-   $checked = in_array( $thisTag, (array)$value, 
true);
-   if ( $this-isTagForcedOff( $thisTag ) ) {
-   $checked = false;
-   $thisAttribs['disabled'] = 1;
-   } elseif ( $this-isTagForcedOn( $thisTag ) ) {
-   $checked = true;
-   $thisAttribs['disabled'] = 1;
+   // Knock out any options that are not wanted
+   if ( isset( $this-mParams['remove-options'] )
+in_array( $columnTag-$rowTag, 
$this-mParams['remove-options'] ) )
+   {
+   $rowContents .= Html::rawElement( 'td', 
array(), '#160;' );
+   } else {
+   // Construct the checkbox
+   $thisAttribs = array(
+   'id' = 
{$this-mID}-$columnTag-$rowTag,
+   'value' = $columnTag . '-' . 
$rowTag
+   );
+   $checkbox = Xml::check(
+   $this-mName . '[]',
+   in_array( $columnTag . '-' . 
$rowTag, (array)$value, true ),
+   $attribs + $thisAttribs );
+   $rowContents .= Html::rawElement( 'td', 
array(), $checkbox );
}
-   $rowContents .= Html::rawElement(
-   'td',
-   array(),
-   Xml::check( {$this-mName}[], 
$checked, $attribs + $thisAttribs )
-   );

[MediaWiki-commits] [Gerrit] Use square brackets instead of curly braces for char of a st... - change (mediawiki/core)

2013-05-22 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review.

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


Change subject: Use square brackets instead of curly braces for char of a string
..

Use square brackets instead of curly braces for char of a string

The use of curly braces is deprecated in php 4.0, so changing it to
square brackets

Change-Id: Iffab398c8d18b386ec2e1a5de751c095b7a9cc77
---
M includes/db/DatabasePostgres.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/64947/1

diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php
index 367335e..e564a16 100644
--- a/includes/db/DatabasePostgres.php
+++ b/includes/db/DatabasePostgres.php
@@ -1032,11 +1032,11 @@
return $output;
}
do {
-   if ( '{' != $text{$offset} ) {
+   if ( '{' != $text[$offset] ) {
preg_match( 
/(\\{?\([^\]|.)*\|[^,{}]+)+([,}]+)/,
$text, $match, 0, $offset );
$offset += strlen( $match[0] );
-   $output[] = ( '' != $match[1]{0}
+   $output[] = ( '' != $match[1][0]
? $match[1]
: stripcslashes( substr( 
$match[1], 1, -1 ) ) );
if ( '},' == $match[3] ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iffab398c8d18b386ec2e1a5de751c095b7a9cc77
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] Rename EntityIdTransformer and implementation for clarity - change (mediawiki...Wikibase)

2013-05-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Rename EntityIdTransformer and implementation for clarity
..

Rename EntityIdTransformer and implementation for clarity

Change-Id: I8061e6d0716bdf806995e3afb143f013af4502dc
---
M QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
M QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
M QueryEngine/includes/SQLStore/EntityInserter.php
M QueryEngine/includes/SQLStore/Factory.php
R QueryEngine/includes/SQLStore/InternalEntityIdTransformer.php
R QueryEngine/includes/SQLStore/SimpleEntityIdTransformer.php
M QueryEngine/includes/SQLStore/SnakStore/SnakRowBuilder.php
M QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimInserterTest.php
M QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimRowBuilderTest.php
M QueryEngine/tests/phpunit/SQLStore/Engine/DescriptionMatchFinderTest.php
M QueryEngine/tests/phpunit/SQLStore/EntityInserterTest.php
R QueryEngine/tests/phpunit/SQLStore/SimpleEntityIdTransformerTest.php
M QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakInserterTest.php
M QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakRowBuilderTest.php
14 files changed, 31 insertions(+), 31 deletions(-)


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

diff --git a/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php 
b/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
index 9b01ad0..f266b40 100644
--- a/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
+++ b/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
@@ -4,7 +4,7 @@
 
 use Wikibase\Claim;
 use Wikibase\EntityId;
-use Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder;
+use Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer;
 use Wikibase\Statement;
 
 /**
@@ -37,7 +37,7 @@
 
protected $idFinder;
 
-   public function __construct( InternalEntityIdFinder $idFinder ) {
+   public function __construct( InternalEntityIdTransformer $idFinder ) {
$this-idFinder = $idFinder;
}
 
diff --git a/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php 
b/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
index b91d52d..a4a2a49 100644
--- a/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
+++ b/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
@@ -11,7 +11,7 @@
 use Wikibase\Lib\EntityIdParser;
 use Wikibase\QueryEngine\QueryNotSupportedException;
 use Wikibase\QueryEngine\SQLStore\DataValueHandler;
-use Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder;
+use Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer;
 use Wikibase\QueryEngine\SQLStore\PropertyDataValueTypeLookup;
 use Wikibase\QueryEngine\SQLStore\Schema;
 use Wikibase\SnakRole;
@@ -52,7 +52,7 @@
public function __construct( QueryInterface $queryInterface,
Schema $schema,
PropertyDataValueTypeLookup 
$propertyDataValueTypeLookup,
-   InternalEntityIdFinder $idFinder ) {
+   InternalEntityIdTransformer $idFinder ) {
$this-queryInterface = $queryInterface;
$this-schema = $schema;
$this-propertyDataValueTypeLookup = 
$propertyDataValueTypeLookup;
diff --git a/QueryEngine/includes/SQLStore/EntityInserter.php 
b/QueryEngine/includes/SQLStore/EntityInserter.php
index fc5eae8..a9f6086 100644
--- a/QueryEngine/includes/SQLStore/EntityInserter.php
+++ b/QueryEngine/includes/SQLStore/EntityInserter.php
@@ -45,7 +45,7 @@
 * @param EntityTable $entityTable
 * @param ClaimInserter $claimInserter
 */
-   public function __construct( EntityTable $entityTable, ClaimInserter 
$claimInserter, InternalEntityIdFinder $idFinder ) {
+   public function __construct( EntityTable $entityTable, ClaimInserter 
$claimInserter, InternalEntityIdTransformer $idFinder ) {
$this-entityTable = $entityTable;
$this-claimInserter = $claimInserter;
$this-idFinder = $idFinder;
diff --git a/QueryEngine/includes/SQLStore/Factory.php 
b/QueryEngine/includes/SQLStore/Factory.php
index c00562c..82ee3a2 100644
--- a/QueryEngine/includes/SQLStore/Factory.php
+++ b/QueryEngine/includes/SQLStore/Factory.php
@@ -74,7 +74,7 @@
return new EntityInserter(
$this-newEntityTable(),
$this-newClaimInserter(),
-   $this-getInternalEntityIdFinder()
+   $this-getInternalEntityIdTransformer()
);
}
 
@@ -89,7 +89,7 @@
return new ClaimInserter(
$this-newClaimsTable(),
$this-newSnakInserter(),
-   new ClaimRowBuilder( $this-getInternalEntityIdFinder() 
)
+  

[MediaWiki-commits] [Gerrit] getInternalIdForEntity now takes an EntityId rather then its... - change (mediawiki...Wikibase)

2013-05-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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


Change subject: getInternalIdForEntity now takes an EntityId rather then its 
components
..

getInternalIdForEntity now takes an EntityId rather then its components

Change-Id: Ib476cc1eac306996823bfc15f7be73478985bcfe
---
M QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
M QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
M QueryEngine/includes/SQLStore/EntityInserter.php
M QueryEngine/includes/SQLStore/InternalEntityIdTransformer.php
M QueryEngine/includes/SQLStore/SimpleEntityIdTransformer.php
M QueryEngine/includes/SQLStore/SnakStore/SnakRowBuilder.php
M QueryEngine/tests/phpunit/SQLStore/EntityInserterTest.php
M QueryEngine/tests/phpunit/SQLStore/SimpleEntityIdTransformerTest.php
8 files changed, 20 insertions(+), 32 deletions(-)


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

diff --git a/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php 
b/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
index f266b40..9bfbf00 100644
--- a/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
+++ b/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
@@ -53,10 +53,7 @@
}
 
protected function getInternalIdFor( EntityId $entityId ) {
-   return $this-idFinder-getInternalIdForEntity(
-   $entityId-getEntityType(),
-   $entityId-getNumericId()
-   );
+   return $this-idFinder-getInternalIdForEntity( $entityId );
}
 
 }
\ No newline at end of file
diff --git a/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php 
b/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
index a4a2a49..5a45be0 100644
--- a/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
+++ b/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
@@ -114,10 +114,7 @@
}
 
protected function getInternalId( EntityId $id ) {
-   return $this-idFinder-getInternalIdForEntity(
-   $id-getEntityType(),
-   $id-getNumericId()
-   );
+   return $this-idFinder-getInternalIdForEntity( $id );
}
 
protected function getExtraConditions( SomeProperty $description, 
DataValueHandler $dvHandler ) {
diff --git a/QueryEngine/includes/SQLStore/EntityInserter.php 
b/QueryEngine/includes/SQLStore/EntityInserter.php
index a9f6086..7fd84ca 100644
--- a/QueryEngine/includes/SQLStore/EntityInserter.php
+++ b/QueryEngine/includes/SQLStore/EntityInserter.php
@@ -74,10 +74,7 @@
}
 
protected function getInternalId( EntityId $entityId ) {
-   return $this-idFinder-getInternalIdForEntity(
-   $entityId-getEntityType(),
-   $entityId-getNumericId()
-   );
+   return $this-idFinder-getInternalIdForEntity( $entityId );
}
 
 }
diff --git a/QueryEngine/includes/SQLStore/InternalEntityIdTransformer.php 
b/QueryEngine/includes/SQLStore/InternalEntityIdTransformer.php
index ea721f5..189566d 100644
--- a/QueryEngine/includes/SQLStore/InternalEntityIdTransformer.php
+++ b/QueryEngine/includes/SQLStore/InternalEntityIdTransformer.php
@@ -2,6 +2,8 @@
 
 namespace Wikibase\QueryEngine\SQLStore;
 
+use Wikibase\EntityId;
+
 /**
  * Finds the internal entity id for the given external entity id.
  *
@@ -31,13 +33,10 @@
 interface InternalEntityIdTransformer {
 
/**
-* TODO: taking an EntityId would be a lot more convenient
-*
-* @param string $entityType
-* @param int $entityNumber
+* @param EntityId $entityId
 *
 * @return int
 */
-   public function getInternalIdForEntity( $entityType, $entityNumber );
+   public function getInternalIdForEntity( EntityId $entityId );
 
 }
diff --git a/QueryEngine/includes/SQLStore/SimpleEntityIdTransformer.php 
b/QueryEngine/includes/SQLStore/SimpleEntityIdTransformer.php
index bc0245a..fc58363 100644
--- a/QueryEngine/includes/SQLStore/SimpleEntityIdTransformer.php
+++ b/QueryEngine/includes/SQLStore/SimpleEntityIdTransformer.php
@@ -2,6 +2,8 @@
 
 namespace Wikibase\QueryEngine\SQLStore;
 
+use Wikibase\EntityId;
+
 /**
  * Transforms entity types and numbers into internal store ids.
  *
@@ -43,15 +45,14 @@
/**
 * @see InternalEntityIdTransformer::getInternalIdForEntity
 *
-* @param string $entityType
-* @param int $entityNumber
+* @param EntityId $entityId
 *
 * @return int
 */
-   public function getInternalIdForEntity( $entityType, $entityNumber ) {
-   $this-ensureEntityTypeIsKnown( $entityType );
+   public function getInternalIdForEntity( EntityId $entityId ) {
+  

[MediaWiki-commits] [Gerrit] Tool Labs: install 'dc' package (user request) - change (operations/puppet)

2013-05-22 Thread coren (Code Review)
coren has uploaded a new change for review.

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


Change subject: Tool Labs: install 'dc' package (user request)
..

Tool Labs: install 'dc' package (user request)

Change-Id: Ia768db8af0f492fe006db11b95111c1a6f60b750
---
M modules/toollabs/manifests/exec_environ.pp
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/50/64950/1

diff --git a/modules/toollabs/manifests/exec_environ.pp 
b/modules/toollabs/manifests/exec_environ.pp
index 75461dd..f0b9b88 100644
--- a/modules/toollabs/manifests/exec_environ.pp
+++ b/modules/toollabs/manifests/exec_environ.pp
@@ -87,6 +87,7 @@
   'tcllib',
   'libthreads-shared-perl',
   'libthreads-perl',
+  'dc',
   'p7zip' ]:
 ensure = present
   }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia768db8af0f492fe006db11b95111c1a6f60b750
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: coren mpellet...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Tool Labs: install 'dc' package (user request) - change (operations/puppet)

2013-05-22 Thread coren (Code Review)
coren has submitted this change and it was merged.

Change subject: Tool Labs: install 'dc' package (user request)
..


Tool Labs: install 'dc' package (user request)

Change-Id: Ia768db8af0f492fe006db11b95111c1a6f60b750
---
M modules/toollabs/manifests/exec_environ.pp
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/modules/toollabs/manifests/exec_environ.pp 
b/modules/toollabs/manifests/exec_environ.pp
index 75461dd..f0b9b88 100644
--- a/modules/toollabs/manifests/exec_environ.pp
+++ b/modules/toollabs/manifests/exec_environ.pp
@@ -87,6 +87,7 @@
   'tcllib',
   'libthreads-shared-perl',
   'libthreads-perl',
+  'dc',
   'p7zip' ]:
 ensure = present
   }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia768db8af0f492fe006db11b95111c1a6f60b750
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: coren mpellet...@wikimedia.org
Gerrit-Reviewer: coren mpellet...@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] Hide the ULS trigger for users who disabled JS - change (mediawiki...UniversalLanguageSelector)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Hide the ULS trigger for users who disabled JS
..


Hide the ULS trigger for users who disabled JS

Bug: 42500
Change-Id: I297a8d3bb9d9031e21dd6842f5d27dd54f469c29
---
M Resources.php
M UniversalLanguageSelector.hooks.php
A resources/css/ext.uls.nojs.css
3 files changed, 14 insertions(+), 1 deletion(-)

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



diff --git a/Resources.php b/Resources.php
index 0018022..3e00380 100644
--- a/Resources.php
+++ b/Resources.php
@@ -38,6 +38,12 @@
),
 ) + $resourcePaths;
 
+// Styles for users who disabled JavaScript
+$wgResourceModules['ext.uls.nojs'] = array(
+   'styles' = 'resources/css/ext.uls.nojs.css',
+   'position' = 'top',
+) + $resourcePaths;
+
 // Base ULS module
 $wgResourceModules['ext.uls.init'] = array(
'scripts' = 'resources/js/ext.uls.init.js',
diff --git a/UniversalLanguageSelector.hooks.php 
b/UniversalLanguageSelector.hooks.php
index 1aa0adc..2f175d9 100644
--- a/UniversalLanguageSelector.hooks.php
+++ b/UniversalLanguageSelector.hooks.php
@@ -43,7 +43,10 @@
public static function addModules( $out, $skin ) {
global $wgULSGeoService;
 
-   // If extension is enabled, basic features(API, language data) 
available.
+   // Load the style for users without JS, to hide the useless 
links
+   $out-addModuleStyles( 'ext.uls.nojs' );
+
+   // If the extension is enabled, basic features (API, language 
data) available.
$out-addModules( 'ext.uls.init' );
 
if ( is_string( $wgULSGeoService ) ) {
diff --git a/resources/css/ext.uls.nojs.css b/resources/css/ext.uls.nojs.css
new file mode 100644
index 000..d902d27
--- /dev/null
+++ b/resources/css/ext.uls.nojs.css
@@ -0,0 +1,4 @@
+/* Don't show it to users who disabled JS */
+.client-nojs #pt-uls {
+   visibility: hidden;
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I297a8d3bb9d9031e21dd6842f5d27dd54f469c29
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il
Gerrit-Reviewer: Nikerabbit niklas.laxst...@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] Fixed last patch I853496a860742ba906b756b26f4c13b51bacb82f - change (mediawiki...ZeroRatedMobileAccess)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fixed last patch I853496a860742ba906b756b26f4c13b51bacb82f
..


Fixed last patch I853496a860742ba906b756b26f4c13b51bacb82f

Removed duplicate returns

Change-Id: I3bac0cd2bc9423972c608bfc86bb15ccb3e4b4d7
---
M includes/CarrierConfig.php
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/includes/CarrierConfig.php b/includes/CarrierConfig.php
index 68e700e..14a5de1 100644
--- a/includes/CarrierConfig.php
+++ b/includes/CarrierConfig.php
@@ -217,7 +217,6 @@
 CarrierConfig::isArrayOfLangs( 
array_keys( $v ) )
 CarrierConfig::isArrayOfStrings( $v )
? null : 
'zeroconfig-lang_name_overrides';
-   return array( null, $v );
} );
 
// Background banner color

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3bac0cd2bc9423972c608bfc86bb15ccb3e4b4d7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess
Gerrit-Branch: master
Gerrit-Owner: Yurik yu...@wikimedia.org
Gerrit-Reviewer: Dr0ptp4kt ab...@wikimedia.org
Gerrit-Reviewer: MaxSem maxsem.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 page language to prop=info - change (mediawiki/core)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add page language to prop=info
..


Add page language to prop=info

This can be useful to determine the language of a page, for example
javascript has english as page language. MediaWiki pages has it page
language corresponding to the lang code in the sub page.

Change-Id: Idd0412574b314ecf52d92243a3f8a08755474663
---
M RELEASE-NOTES-1.22
M includes/api/ApiQueryInfo.php
2 files changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index 04861fc..361ab25 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -129,7 +129,7 @@
   stored in the database.
 * (bug 47219) Allow specifying change type of Wikipedia feed items
 * prop=imageinfo now allows setting iiurlheight without setting iiurlwidth
-* prop=info now adds the content model of the title.
+* prop=info now adds the content model and page language of the title.
 * New upload log entries will now contain information on the relavent
   image (sha1 and timestamp).
 
diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php
index 787057d..5f8c497 100644
--- a/includes/api/ApiQueryInfo.php
+++ b/includes/api/ApiQueryInfo.php
@@ -353,6 +353,7 @@
$dbkey = $title-getDBkey();
 
$pageInfo['contentmodel'] = $title-getContentModel();
+   $pageInfo['pagelanguage'] = 
$title-getPageLanguage()-getCode();
 
if ( $titleExists ) {
global $wgDisableCounters;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idd0412574b314ecf52d92243a3f8a08755474663
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender umherirrender_de...@web.de
Gerrit-Reviewer: Anomie bjor...@wikimedia.org
Gerrit-Reviewer: Umherirrender umherirrender_de...@web.de
Gerrit-Reviewer: Yurik yu...@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] Ensure edit form doesn't clear the right floated meta - change (mediawiki...erudite)

2013-05-22 Thread Njw (Code Review)
Njw has uploaded a new change for review.

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


Change subject: Ensure edit form doesn't clear the right floated meta
..

Ensure edit form doesn't clear the right floated meta

Change-Id: Ieb595e70013948f78473c5682822d43bdfa3d327
---
M assets/wiki-style.css
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/erudite 
refs/changes/51/64951/1

diff --git a/assets/wiki-style.css b/assets/wiki-style.css
index f4fa6c4..4a5fd35 100644
--- a/assets/wiki-style.css
+++ b/assets/wiki-style.css
@@ -490,3 +490,11 @@
 table h3 {
 margin-top: 1ex;
 }
+
+/* ensure edit form doesn't clear the right floated meta
+ * (.action-edit is selected so that preview content is cleared) */
+body.action-edit #editform,
+body.action-edit #toolbar,
+body.action-edit #wpTextbox1 {
+   clear: none;
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb595e70013948f78473c5682822d43bdfa3d327
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/erudite
Gerrit-Branch: master
Gerrit-Owner: Njw nick.wh...@durham.ac.uk

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


[MediaWiki-commits] [Gerrit] Fix for wrong prefixing of multi checkbox - change (mediawiki/core)

2013-05-22 Thread EBernhardson (WMF) (Code Review)
EBernhardson (WMF) has uploaded a new change for review.

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


Change subject: Fix for wrong prefixing of multi checkbox
..

Fix for wrong prefixing of multi checkbox

Bug: 48693
Change-Id: Ifd8d1d54d5252da958c30cdc0ffa1155ba4cf924
---
M includes/Preferences.php
1 file changed, 3 insertions(+), 2 deletions(-)


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

diff --git a/includes/Preferences.php b/includes/Preferences.php
index 1b01750..226e379 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -1571,9 +1571,10 @@
foreach ( $this-mFlatFields as $fieldname = $field ) {
if ( $field instanceof HTMLNestedFilterable ) {
$info = $field-mParams;
-   $prefix = isset( $info['prefix'] ) ? 
$info['prefix'] : $fieldname;
+   $prefix = isset( $info['prefix'] ) ? 
$info['prefix'] : $fieldname-;
foreach ( $field-filterDataForSubmit( 
$data[$fieldname] ) as $key = $value ) {
-   $data[$prefix-$key] = $value;
+   wfDebug( Set $prefix$key to $value );
+   $data[$prefix$key] = $value;
}
unset( $data[$fieldname] );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd8d1d54d5252da958c30cdc0ffa1155ba4cf924
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: EBernhardson (WMF) ebernhard...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating to last zero ext - change (mediawiki/core)

2013-05-22 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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


Change subject: Updating to last zero ext
..

Updating to last zero ext

Change-Id: Ie930d96980a8bcfa77ae6c6815089f5c62f8a9f1
---
M extensions/ZeroRatedMobileAccess
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/extensions/ZeroRatedMobileAccess b/extensions/ZeroRatedMobileAccess
index c0df4af..585aa7f 16
--- a/extensions/ZeroRatedMobileAccess
+++ b/extensions/ZeroRatedMobileAccess
-Subproject commit c0df4afdbeb8e18720e4e812e4359f92061bee68
+Subproject commit 585aa7fe5a78fd5ae689c12eda2be1c1923ae6a2

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie930d96980a8bcfa77ae6c6815089f5c62f8a9f1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf4
Gerrit-Owner: Yurik yu...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating to last zero ext - change (mediawiki/core)

2013-05-22 Thread Yurik (Code Review)
Yurik has submitted this change and it was merged.

Change subject: Updating to last zero ext
..


Updating to last zero ext

Change-Id: Ie930d96980a8bcfa77ae6c6815089f5c62f8a9f1
---
M extensions/ZeroRatedMobileAccess
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/extensions/ZeroRatedMobileAccess b/extensions/ZeroRatedMobileAccess
index c0df4af..585aa7f 16
--- a/extensions/ZeroRatedMobileAccess
+++ b/extensions/ZeroRatedMobileAccess
-Subproject commit c0df4afdbeb8e18720e4e812e4359f92061bee68
+Subproject commit 585aa7fe5a78fd5ae689c12eda2be1c1923ae6a2

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie930d96980a8bcfa77ae6c6815089f5c62f8a9f1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf4
Gerrit-Owner: Yurik yu...@wikimedia.org
Gerrit-Reviewer: Yurik yu...@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] bugfixes: handle deleted text; workaround dupl text ids - change (operations/dumps)

2013-05-22 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review.

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


Change subject: bugfixes: handle deleted text; workaround dupl text ids
..

bugfixes: handle deleted text; workaround dupl text ids

Revisions with deleted text will get text id of 0 and len of 0
The rest will get a text id identical to the rev id to avoid collisions:
in live mediawiki projects it is possible for two revs to
have the same text id (example: revision created by protecting
a page), but rev ids are guaranteed to be unique.

If the 'nodrop' option is supplied, which means that
INSERT IGNORE statements will be generated for these
tables, the original text ids from the xml will be used.

That last workaround needs to be documented better. Way better.

Change-Id: I8ca20d7fb7c65713c7b62b74c963d2f298953932
---
M xmlfileutils/mwxmlelts.c
1 file changed, 17 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps 
refs/changes/55/64955/1

diff --git a/xmlfileutils/mwxmlelts.c b/xmlfileutils/mwxmlelts.c
index 0bd1b1a..df8ac36 100644
--- a/xmlfileutils/mwxmlelts.c
+++ b/xmlfileutils/mwxmlelts.c
@@ -358,8 +358,8 @@
   }
   /* text: old_text old_flags */
   /* write the beginning piece */
-  snprintf(buf, sizeof(buf),   \
-  (%s, ',r-text_id);
+  snprintf(buf, sizeof(buf),(%s, ',r-text_id);
+
   put_line_all(sqlt, buf);
 
   if (verbose  1) fprintf(stderr,text info: insert start of line written\n);
@@ -656,9 +656,23 @@
 }
 else if (! result) break;
 if (!strcmp(name, id))
-  strcpy(r.text_id, value);
+  if (insert_ignore)
+   /* separate revisions can have the same text id if only the metadata 
was changed,
+  e.g. the page was protected.  use the original text ids therefore 
only
+  if we are going to write INSERT IGNORE to ignore dup entries */
+   strcpy(r.text_id, value);
+  else
+   /* fallback since the rev id is guaranteed to be unique, is use this as 
the text
+  id, this means the resulting db won't be quite identical to the one 
from
+  which data was dumped */
+   strcpy(r.text_id, r.id);
 else if (!strcmp(name, bytes))
   strcpy(r.text_len, value);
+else if (!strcmp(name, deleted)) {
+  strcpy(r.text_id, 0);
+  strcpy(r.text_len, 0);
+  break;
+}
 else {
   whine(unknown attribute in text tag);
   break;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ca20d7fb7c65713c7b62b74c963d2f298953932
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: ariel
Gerrit-Owner: ArielGlenn ar...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating to last zero ext - change (mediawiki/core)

2013-05-22 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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


Change subject: Updating to last zero ext
..

Updating to last zero ext

Change-Id: I1910e7191ba0d1b1ed5b94e3c7c36391fef4766e
---
M extensions/ZeroRatedMobileAccess
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/64956/1

diff --git a/extensions/ZeroRatedMobileAccess b/extensions/ZeroRatedMobileAccess
index c0df4af..585aa7f 16
--- a/extensions/ZeroRatedMobileAccess
+++ b/extensions/ZeroRatedMobileAccess
-Subproject commit c0df4afdbeb8e18720e4e812e4359f92061bee68
+Subproject commit 585aa7fe5a78fd5ae689c12eda2be1c1923ae6a2

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1910e7191ba0d1b1ed5b94e3c7c36391fef4766e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf3
Gerrit-Owner: Yurik yu...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Updating to last zero ext - change (mediawiki/core)

2013-05-22 Thread Yurik (Code Review)
Yurik has submitted this change and it was merged.

Change subject: Updating to last zero ext
..


Updating to last zero ext

Change-Id: I1910e7191ba0d1b1ed5b94e3c7c36391fef4766e
---
M extensions/ZeroRatedMobileAccess
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/extensions/ZeroRatedMobileAccess b/extensions/ZeroRatedMobileAccess
index c0df4af..585aa7f 16
--- a/extensions/ZeroRatedMobileAccess
+++ b/extensions/ZeroRatedMobileAccess
-Subproject commit c0df4afdbeb8e18720e4e812e4359f92061bee68
+Subproject commit 585aa7fe5a78fd5ae689c12eda2be1c1923ae6a2

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1910e7191ba0d1b1ed5b94e3c7c36391fef4766e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf3
Gerrit-Owner: Yurik yu...@wikimedia.org
Gerrit-Reviewer: Yurik yu...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] bugfixes: handle deleted text; workaround dupl text ids - change (operations/dumps)

2013-05-22 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: bugfixes: handle deleted text; workaround dupl text ids
..


bugfixes: handle deleted text; workaround dupl text ids

Revisions with deleted text will get text id of 0 and len of 0
The rest will get a text id identical to the rev id to avoid collisions:
in live mediawiki projects it is possible for two revs to
have the same text id (example: revision created by protecting
a page), but rev ids are guaranteed to be unique.

If the 'nodrop' option is supplied, which means that
INSERT IGNORE statements will be generated for these
tables, the original text ids from the xml will be used.

That last workaround needs to be documented better. Way better.

Change-Id: I8ca20d7fb7c65713c7b62b74c963d2f298953932
---
M xmlfileutils/mwxmlelts.c
1 file changed, 17 insertions(+), 3 deletions(-)

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



diff --git a/xmlfileutils/mwxmlelts.c b/xmlfileutils/mwxmlelts.c
index 0bd1b1a..df8ac36 100644
--- a/xmlfileutils/mwxmlelts.c
+++ b/xmlfileutils/mwxmlelts.c
@@ -358,8 +358,8 @@
   }
   /* text: old_text old_flags */
   /* write the beginning piece */
-  snprintf(buf, sizeof(buf),   \
-  (%s, ',r-text_id);
+  snprintf(buf, sizeof(buf),(%s, ',r-text_id);
+
   put_line_all(sqlt, buf);
 
   if (verbose  1) fprintf(stderr,text info: insert start of line written\n);
@@ -656,9 +656,23 @@
 }
 else if (! result) break;
 if (!strcmp(name, id))
-  strcpy(r.text_id, value);
+  if (insert_ignore)
+   /* separate revisions can have the same text id if only the metadata 
was changed,
+  e.g. the page was protected.  use the original text ids therefore 
only
+  if we are going to write INSERT IGNORE to ignore dup entries */
+   strcpy(r.text_id, value);
+  else
+   /* fallback since the rev id is guaranteed to be unique, is use this as 
the text
+  id, this means the resulting db won't be quite identical to the one 
from
+  which data was dumped */
+   strcpy(r.text_id, r.id);
 else if (!strcmp(name, bytes))
   strcpy(r.text_len, value);
+else if (!strcmp(name, deleted)) {
+  strcpy(r.text_id, 0);
+  strcpy(r.text_len, 0);
+  break;
+}
 else {
   whine(unknown attribute in text tag);
   break;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8ca20d7fb7c65713c7b62b74c963d2f298953932
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: ariel
Gerrit-Owner: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: ArielGlenn ar...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Correctly populate internalList for example documents - change (mediawiki...VisualEditor)

2013-05-22 Thread Catrope (Code Review)
Catrope has uploaded a new change for review.

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


Change subject: Correctly populate internalList for example documents
..

Correctly populate internalList for example documents

Right now the internal list is very much HTML-based, so it's not
populated at all when creating a document from data. So hack this in by
specifying what should be in the internal list as a property of the
example document's data array.

Change-Id: I51c7b7b4dcd9fd777c1287b7ba544887aa32
---
M modules/ve/test/dm/ve.dm.example.js
1 file changed, 11 insertions(+), 1 deletion(-)


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

diff --git a/modules/ve/test/dm/ve.dm.example.js 
b/modules/ve/test/dm/ve.dm.example.js
index 3d6c7c7..56a813a 100644
--- a/modules/ve/test/dm/ve.dm.example.js
+++ b/modules/ve/test/dm/ve.dm.example.js
@@ -97,14 +97,22 @@
  * @throws {Error} Example data not found
  */
 ve.dm.example.createExampleDocument = function ( name, store ) {
+   var doc, i;
name = name || 'data';
store = store || new ve.dm.IndexValueStore();
if ( ve.dm.example[name] === undefined ) {
throw new Error( 'Example data \'' + name + '\' not found' );
}
-   return new ve.dm.Document(
+   doc = new ve.dm.Document(
ve.dm.example.preprocessAnnotations( ve.copyArray( 
ve.dm.example[name] ), store )
);
+   // HACK internalList isn't populated when creating a document from data
+   if ( ve.dm.example[name].internalItems ) {
+   for ( i = 0; i  ve.dm.example[name].internalItems.length; i++ 
) {
+   doc.internalList.addItem( 
ve.dm.example[name].internalItems[i] );
+   }
+   }
+   return doc;
 };
 
 ve.dm.example.testDir = window.mw ?
@@ -357,6 +365,8 @@
{ 'type': '/paragraph' }
 ];
 
+ve.dm.example.internalData.internalItems = [ 'Bar', 'Baz' ];
+
 ve.dm.example.withMeta = [
{
'type': 'alienMeta',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I51c7b7b4dcd9fd777c1287b7ba544887aa32
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope roan.katt...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add getDocumentSlice() - change (mediawiki...VisualEditor)

2013-05-22 Thread Catrope (Code Review)
Catrope has uploaded a new change for review.

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


Change subject: Add getDocumentSlice()
..

Add getDocumentSlice()

A document slice is a document built from a data slice of an existing
document. It's completely separate from the original document and has
its own store and internalList. The new document's data also contains
the entirety of the original document's internal list. It's possible
to create a document slice of data located inside the internal list,
in which case the resulting document will contain that data twice (one
mutable copy at the top level, and one immutable copy in the internal
list).

ve.dm.Document.js:
* Optionally take an internalList in the constructor. This allows us to
  create a document with a clone of an existing internalList rather than
  an empty one.
* Add edgeMetadata flag to getFullData()

ve.dm.IndexValueStore.js, ve.dm.InternalList.js:
* Make these classes cloneable

Change-Id: I93e06f764ace16aee9df941b07f8c2bff1a28e2b
---
M modules/ve/dm/ve.dm.Document.js
M modules/ve/dm/ve.dm.IndexValueStore.js
M modules/ve/dm/ve.dm.InternalList.js
M modules/ve/test/dm/ve.dm.Document.test.js
4 files changed, 132 insertions(+), 8 deletions(-)


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

diff --git a/modules/ve/dm/ve.dm.Document.js b/modules/ve/dm/ve.dm.Document.js
index 859e9f3..ab7bfe2 100644
--- a/modules/ve/dm/ve.dm.Document.js
+++ b/modules/ve/dm/ve.dm.Document.js
@@ -18,8 +18,9 @@
  * @constructor
  * @param {HTMLDocument|Array|ve.dm.LinearData} documentOrData HTML document, 
raw linear model data or LinearData to start with
  * @param {ve.dm.Document} [parentDocument] Document to use as root for 
created nodes
+ * @param {ve.dm.InternalList} [internalList] Internal list to clone; passed 
when creating a document slice
  */
-ve.dm.Document = function VeDmDocument( documentOrData, parentDocument ) {
+ve.dm.Document = function VeDmDocument( documentOrData, parentDocument, 
internalList ) {
// Parent constructor
ve.Document.call( this, new ve.dm.DocumentNode() );
 
@@ -41,7 +42,7 @@
currentNode = this.documentNode;
this.documentNode.setDocument( doc );
this.documentNode.setRoot( root );
-   this.internalList = new ve.dm.InternalList( this );
+   this.internalList = internalList ? internalList.clone( this ) : new 
ve.dm.InternalList( this );
 
// Properties
this.parentDocument = parentDocument;
@@ -293,6 +294,35 @@
 };
 
 /**
+ * Get a document from a slice of this document. The new document's store and 
internal list will be
+ * clones of the ones in this document.
+ *
+ * @param {ve.Range|ve.dm.Node} rangeOrNode Range of data to clone, or node 
whose contents should be cloned
+ * @returns {ve.dm.Document} New document
+ */
+ve.dm.Document.prototype.getDocumentSlice = function ( rangeOrNode ) {
+   var data, range,
+   store = this.store.clone(),
+   listRange = this.internalList.getListNode().getOuterRange();
+   if ( rangeOrNode instanceof ve.dm.Node ) {
+   range = rangeOrNode.getRange();
+   } else if ( rangeOrNode instanceof ve.Range ) {
+   range = rangeOrNode;
+   } else {
+   throw new Error( 'rangeOrNode must be a ve.Range or a 
ve.dm.Node' );
+   }
+   data = ve.copyArray( this.getFullData( range, true ) );
+   if ( range.start  listRange.start || range.end  listRange.end ) {
+   // The range does not include the entire internal list, so add 
it
+   data = data.concat( this.getFullData( listRange ) );
+   }
+   return new this.constructor(
+   new ve.dm.ElementLinearData( store, data ),
+   undefined, this.internalList
+   );
+};
+
+/**
  * Get the metadata replace operation required to keep data  metadata in sync 
after a splice
  *
  * @method
@@ -349,14 +379,25 @@
 /**
  * Get the full document data including metadata.
  *
- * Metadata will be into the document data to produce the full data result.
+ * Metadata will be into the document data to produce the full data result. 
If a range is passed,
+ * metadata at the edges of the range won't be included unless edgeMetadata is 
set to true. If
+ * no range is passed, the entire document's data is returned and metadata at 
the edges is
+ * included.
  *
+ * @param {ve.Range} [range] Range to get full data for. If omitted, all data 
will be returned
+ * @param {boolean} [edgeMetadata=fales] Include metadata at the edges of the 
range
  * @returns {Array} Data with metadata interleaved
  */
-ve.dm.Document.prototype.getFullData = function () {
-   var result = [], i, j, jLen, iLen = this.data.getLength();
-   for ( i = 0; i = iLen; i++ ) {
-   if ( this.metadata.getData( i ) ) {
+ve.dm.Document.prototype.getFullData = 

[MediaWiki-commits] [Gerrit] Merging and remapping - change (mediawiki...VisualEditor)

2013-05-22 Thread Catrope (Code Review)
Catrope has uploaded a new change for review.

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


Change subject: Merging and remapping
..

Merging and remapping

Add merge() methods to IndexValueStore and InternalList, which merge
another store/list in to the current one and return a mapping
translating old indexes to new ones.

Also add functions that, given such a mapping, traverse a linear
model data array and remap store/list indexes using simple logic for
annotations and node type-specific functions for node attributes.

Change-Id: I1e90755ced1a87c190947c037cf151c4d17cf8b7
---
M modules/ve/dm/lineardata/ve.dm.ElementLinearData.js
M modules/ve/dm/nodes/ve.dm.MWReferenceNode.js
M modules/ve/dm/ve.dm.IndexValueStore.js
M modules/ve/dm/ve.dm.InternalList.js
M modules/ve/dm/ve.dm.Node.js
5 files changed, 119 insertions(+), 0 deletions(-)


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

diff --git a/modules/ve/dm/lineardata/ve.dm.ElementLinearData.js 
b/modules/ve/dm/lineardata/ve.dm.ElementLinearData.js
index c6c83de..6fc8631 100644
--- a/modules/ve/dm/lineardata/ve.dm.ElementLinearData.js
+++ b/modules/ve/dm/lineardata/ve.dm.ElementLinearData.js
@@ -741,4 +741,44 @@
valueStore[i] = this.getStore().value( i );
}
return valueStore;
+};
+
+/**
+ * Remap the store indexes used in this linear data.
+ *
+ * Remaps annotations and calls remapStoreIndexes() on each node.
+ *
+ * @method
+ * @param {Object} mapping Mapping from store indexes to store indexes
+ */
+ve.dm.ElementLinearData.prototype.remapStoreIndexes = function ( mapping ) {
+   var i, ilen, j, jlen, indexes, nodeClass;
+   for ( i = 0, ilen = this.data.length; i  ilen; i++ ) {
+   indexes = this.getAnnotationIndexesFromOffset( i ); // returns 
by reference
+   for ( j = 0, jlen = indexes.length; j  jlen; j++ ) {
+   indexes[j] = mapping[indexes[j]];
+   }
+   if ( this.isOpenElementData( i ) ) {
+   nodeClass = ve.dm.nodeFactory.lookup( this.getType( i ) 
);
+   nodeClass.static.remapStoreIndexes( this.data[i], 
mapping );
+   }
+   }
+};
+
+/**
+ * Remap the internal list indexes used in this linear data.
+ *
+ * Calls remapInternalListIndexes() for each node.
+ *
+ * @method
+ * @param {Object} mapping Mapping from internal list indexes to internal list 
indexes
+ */
+ve.dm.ElementLinearData.prototype.remapInteralListIndexes = function ( mapping 
) {
+   var i, ilen, nodeClass;
+   for ( i = 0, ilen = this.data.length; i  ilen; i++ ) {
+   if ( this.isOpenElementData( i ) ) {
+   nodeClass = ve.dm.nodeFactory.lookup( this.getType( i ) 
);
+   nodeClass.static.remapInternalListIndexes( 
this.data[i], mapping );
+   }
+   }
 };
\ No newline at end of file
diff --git a/modules/ve/dm/nodes/ve.dm.MWReferenceNode.js 
b/modules/ve/dm/nodes/ve.dm.MWReferenceNode.js
index eebdc72..9855603 100644
--- a/modules/ve/dm/nodes/ve.dm.MWReferenceNode.js
+++ b/modules/ve/dm/nodes/ve.dm.MWReferenceNode.js
@@ -80,6 +80,10 @@
return [ span ];
 };
 
+ve.dm.MWReferenceNode.static.remapInternalListIndexes = function ( 
dataElement, mapping ) {
+   dataElement.attributes.listIndex = 
mapping[dataElement.attributes.listIndex];
+};
+
 /* Methods */
 
 /**
diff --git a/modules/ve/dm/ve.dm.IndexValueStore.js 
b/modules/ve/dm/ve.dm.IndexValueStore.js
index 513766c..da940ce 100644
--- a/modules/ve/dm/ve.dm.IndexValueStore.js
+++ b/modules/ve/dm/ve.dm.IndexValueStore.js
@@ -123,4 +123,28 @@
clone.hashStore[key] = this.hashStore[key];
}
return clone;
+};
+
+/**
+ * Merge another store into this store.
+ *
+ * Objects that are in other but not in this are added to this, possibly with 
a different index.
+ * Objects present in both stores may have different indexes in each store. An 
object is returned
+ * mapping each index in other to the corresponding index in this.
+ *
+ * Objects added to the store are added by reference, not cloned like in 
.index()
+ *
+ * @param {ve.dm.IndexValueStore} other Store to merge into this one
+ * @returns {Object} Object mapping store indexes in other to store indexes in 
this store
+ */
+ve.dm.IndexValueStore.prototype.merge = function ( other ) {
+   var key, index, mapping = {};
+   for ( key in other.hashStore ) {
+   if ( !( key in this.hashStore ) ) {
+   index = this.valueStore.push( 
other.valueStore[other.hashStore[key]] ) - 1;
+   this.hashStore[key] = index;
+   }
+   mapping[other.hashStore[key]] = this.hashStore[key];
+   }
+   return mapping;
 };
\ No newline at end of file
diff --git a/modules/ve/dm/ve.dm.InternalList.js 

[MediaWiki-commits] [Gerrit] Add newFromDocumentInsertion() - change (mediawiki...VisualEditor)

2013-05-22 Thread Catrope (Code Review)
Catrope has uploaded a new change for review.

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


Change subject: Add newFromDocumentInsertion()
..

Add newFromDocumentInsertion()

This function builds a transaction that takes a document slice and
inserts it back into the document it came from, applying any changes
that were made.

This makes editing document slices simple:
slicedDoc = doc.getDocumentSlice( captionNode );
// Edit slicedDoc using a surface
tx = ve.dm.Transaction.newFromDocumentInsertion( doc, captionNode, slicedDoc );
surface.change( tx );

Specifically, newFromDocumentInsertion() replaces the node's contents
with the document's contents (meaning any changes made to the node in
the meantime are lost). It also merges the stores and internal lists
of the two documents and remaps indexes accordingly.

ve.dm.MetaLinearData.js:
* Make merge( [ undefined, undefined, ... ] ) return undefined rather
  than []

ve.dm.Document.js:
* In getMetadataReplace(), optionally take the inserted metadata as a
  parameter, to allow for operations that insert both data and metadata

ve.dm.Transaction.js:
* Remove newFromNodeReplacement() and replace it with
  newFromDocumentInsertion()
* In pushReplace() optionally take the inserted metadata as a parameter

Change-Id: I786ee7bad796aa54bc242993b4de3ad18ad0773e
---
M modules/ve/dm/lineardata/ve.dm.MetaLinearData.js
M modules/ve/dm/ve.dm.Document.js
M modules/ve/dm/ve.dm.Transaction.js
M modules/ve/test/dm/ve.dm.Transaction.test.js
M modules/ve/test/dm/ve.dm.example.js
5 files changed, 293 insertions(+), 47 deletions(-)


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

diff --git a/modules/ve/dm/lineardata/ve.dm.MetaLinearData.js 
b/modules/ve/dm/lineardata/ve.dm.MetaLinearData.js
index 32467e6..19bf0f9 100644
--- a/modules/ve/dm/lineardata/ve.dm.MetaLinearData.js
+++ b/modules/ve/dm/lineardata/ve.dm.MetaLinearData.js
@@ -39,13 +39,14 @@
  * @returns {Array} Merged data
  */
 ve.dm.MetaLinearData.static.merge = function ( data ) {
-   var i, merged = [];
+   var i, merged = [], allUndefined = true;
for ( i = 0; i  data.length; i++ ) {
if ( data[i] !== undefined ) {
+   allUndefined = false;
merged = merged.concat( data[i] );
}
}
-   return [ merged ];
+   return allUndefined ? [ undefined ] : [ merged ];
 };
 
 /* Methods */
diff --git a/modules/ve/dm/ve.dm.Document.js b/modules/ve/dm/ve.dm.Document.js
index ab7bfe2..334eb98 100644
--- a/modules/ve/dm/ve.dm.Document.js
+++ b/modules/ve/dm/ve.dm.Document.js
@@ -329,11 +329,28 @@
  * @param {number} offset Data offset to start at
  * @param {number} remove Number of elements being removed
  * @param {Array} insert Element data being inserted
+ * @oaram {Array} [insertMeta] Metadata being inserted
  * @returns {Object} Metadata replace operation to keep data  metadata in sync
  */
-ve.dm.Document.prototype.getMetadataReplace = function ( offset, remove, 
insert ) {
-   var removeMetadata, insertMetadata, replace = {};
-   if ( remove  insert.length ) {
+ve.dm.Document.prototype.getMetadataReplace = function ( offset, remove, 
insert, insertMeta ) {
+   var i, len, removeMetadata, insertMetadata, replace = {};
+   if ( insertMeta ) {
+   // Find the first non-empty metadata insertion
+   for ( i = 0, len = insertMeta.length; i  len; i++ ) {
+   if ( insertMeta[i]  insertMeta[i].length  0 ) {
+   break;
+   }
+   }
+   if ( i === len ) {
+   // Nothing out of the ordinary
+   return {};
+   }
+   replace.retain = i;
+   replace.remove = i  remove ?
+   this.getMetadata( new ve.Range( offset + i, offset + 
remove + 1 ) ) :
+   [];
+   replace.insert = insertMeta.slice( i );
+   } else if ( remove  insert.length ) {
// if we are removing more than we are inserting we need to 
collapse the excess metadata
removeMetadata = this.getMetadata( new ve.Range( offset + 
insert.length, offset + remove + 1 ) );
// check removeMetadata is non-empty
@@ -343,9 +360,8 @@
replace.remove = removeMetadata;
replace.insert = insertMetadata;
}
-   }
// if insert.length === remove metadata can just stay where it is
-   if ( insert.length  remove ) {
+   } else if ( insert.length  remove ) {
// if we are inserting more than we are removing then we need 
to pad out with undefineds
replace.retain = remove;
replace.insert = new Array( insert.length - remove );
diff --git 

[MediaWiki-commits] [Gerrit] Adding interstitials for MobileFrontend 'Read in other langu... - change (mediawiki...ZeroRatedMobileAccess)

2013-05-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Adding interstitials for MobileFrontend 'Read in other 
language' section and footer.
..


Adding interstitials for MobileFrontend 'Read in other language' section and 
footer.

Change-Id: If0940ebf1b23ee7ccde9c7bf3a3fdf2f375c2732
---
M ZeroRatedMobileAccess.php
M includes/PageRenderingHooks.php
2 files changed, 62 insertions(+), 1 deletion(-)

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



diff --git a/ZeroRatedMobileAccess.php b/ZeroRatedMobileAccess.php
index 89dcce9..984afbe 100644
--- a/ZeroRatedMobileAccess.php
+++ b/ZeroRatedMobileAccess.php
@@ -86,6 +86,7 @@
 $wgHooks['ResourceLoaderTestModules'][] = $ns . 
'PageRenderingHooks::onResourceLoaderTestModules';
 $wgHooks['BeforePageDisplayMobile'][] = $ns . 
'PageRenderingHooks::onBeforePageDisplay';
 $wgHooks['GetMobileUrl'][] = $ns . 'PageRenderingHooks::onGetMobileUrl';
+$wgHooks['MinervaPreRender'][] = $ns . 
'PageRenderingHooks::onMinervaPreRender';
 
 // Registers hook and content handlers for JSON Zero config pages iff
 // running on the MediaWiki instance housing the zero configs (i.e. meta).
diff --git a/includes/PageRenderingHooks.php b/includes/PageRenderingHooks.php
index 059983e..1ca9efd 100644
--- a/includes/PageRenderingHooks.php
+++ b/includes/PageRenderingHooks.php
@@ -11,6 +11,7 @@
 use RawMessage;
 use ResourceLoader;
 use Title;
+use SkinTemplate;
 
 /**
  * Main class for ZeroRatedMobileAccess extension.
@@ -37,6 +38,47 @@
return true;
}
 
+
+   public static function onMinervaPreRender( \BaseTemplate $template ) {
+   global $wgRequest;
+
+   $config = self::getConfig();
+
+   if ( $config !== null ) {
+   $skin = new SkinTemplate();
+   $redirectWarning = 
'renderZeroRatedRedirect=truereturnto=';
+   $pattern = '/href=[\'](.*?)[\']/';
+
+   $licenseText = wfMessage( 
'mobile-frontend-footer-license' )-parse();
+   $privacyText = $skin-footerLink( 
'mobile-frontend-privacy-link-text', 'privacypage' );
+   $termsText = wfMessage( 
'mobile-frontend-terms-use-text' )-parse();
+
+   $licenseText = self::addWarning( $wgRequest, $pattern, 
$licenseText, $redirectWarning ) ;
+   $privacyText = self::addWarning( $wgRequest, $pattern, 
$privacyText, $redirectWarning );
+   $termsText = self::addWarning( $wgRequest, $pattern, 
$termsText, $redirectWarning );
+
+   $template-set( 'mobile-license', $licenseText );
+   $template-set( 'privacy', $privacyText );
+   $template-set( 'terms-use', $termsText );
+
+   $redirectWarningQPS = 
'?renderZeroRatedRedirect=truereturnto=';
+
+   if (isset( $template-data['language_urls'] )
+0  count( $template-data['language_urls'] )
+   ) {
+   $languageUrls = 
$template-data['language_urls'];
+
+   foreach ($languageUrls as $lang ) {
+   $lang['href'] = $redirectWarningQPS . 
urlencode( $lang['href'] );
+   }
+
+   $template-set( 'language_urls', $languageUrls 
);
+   }
+   }
+
+   return true;
+
+   }
 
/**
 * BeforePageDisplayMobile hook handler
@@ -109,7 +151,6 @@
}
 
if ( $showBanner  $config !== null ) {
-   $options = array();
$options['toggle_view_desktop'] = 
'renderZeroRatedBanner=truerenderwarning=yesreturnto=';
$options['supported_languages'] = $config['showLangs'];
}
@@ -591,6 +632,25 @@
return self::isZeroRequest();
}
 
+   /**
+* Adds parameters to URLs. Helper for onMinervaPreRender( 
\BaseTemplate $template )
+* @param \WebRequest $request The request object that will contain the 
request path.
+* @param $pattern The regular expression string capturing the URI.
+* @param $link The full link, usually parsed wikitext.
+* @param $redirectQuery The name-value query param string to add to 
the URI.
+* @return mixed The link with URIs rewritten.
+*/
+   private static function addWarning( \WebRequest $request, $pattern, 
$link, $redirectQuery ) {
+   if ( preg_match( $pattern, $link, $match ) ) {
+   $link = str_replace(
+   $match[1],
+   $request-appendQuery( $redirectQuery ) . 
urlencode($match[1]),
+   $link
+   

  1   2   >