[MediaWiki-commits] [Gerrit] Thanks is not using namespaces - change (mediawiki...Thanks)
jenkins-bot has submitted this change and it was merged. Change subject: Thanks is not using namespaces .. Thanks is not using namespaces Added in 422f0f6062ea57e46fcf7b58ce7121b31fcf3362 Change-Id: I8809348d30fdd8b569affd00cc061de22b38e6dc --- M tests/ApiThankTest.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Mattflaschen: Looks good to me, approved Addshore: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/tests/ApiThankTest.php b/tests/ApiThankTest.php index e92efc6..ab1237c 100644 --- a/tests/ApiThankTest.php +++ b/tests/ApiThankTest.php @@ -10,7 +10,7 @@ * * @author Adam Shorland */ -class ApiThankTest extends \ApiTestCase { +class ApiThankTest extends ApiTestCase { public function setUp() { parent::setUp(); -- To view, visit https://gerrit.wikimedia.org/r/97195 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8809348d30fdd8b569affd00cc061de22b38e6dc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Thanks Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Addshore addshorew...@gmail.com Gerrit-Reviewer: Kaldari rkald...@wikimedia.org Gerrit-Reviewer: Mattflaschen mflasc...@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 local names in Japanese - change (mediawiki...cldr)
Whym has uploaded a new change for review. https://gerrit.wikimedia.org/r/99623 Change subject: Add local names in Japanese .. Add local names in Japanese This patch includes language names that are not covered by CLDR. Sources: * https://ja.wikipedia.org/wiki/MediaWiki:Gadget-SetInterlangTooltip.js * titles of articles about Wikipedias at Japanese Wikipedia Change-Id: Ic68a0329516df07a33244943549905cd435fa283 --- A LocalNames/LocalNamesJa.php 1 file changed, 409 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/cldr refs/changes/23/99623/1 diff --git a/LocalNames/LocalNamesJa.php b/LocalNames/LocalNamesJa.php new file mode 100644 index 000..2d3327e --- /dev/null +++ b/LocalNames/LocalNamesJa.php @@ -0,0 +1,409 @@ +?php +$languageNames = array( + /* Not in CLDR 21.0.1. Name Arabic, Tunisian Spoken used by Ethnologue: +* http://www.ethnologue.com/show_language.asp?code=aeb +* Added 2012-11-13. +*/ + 'aeb' = 'アラビア語チュニジア方言', + + /* Not in CLDR 21.0.1. Name Gheg Albanian used by Ethnologue: +* http://www.ethnologue.com/show_language.asp?code=aln +* Added 2008-01-04. +*/ + // 'aln' = 'Gheg Albanian', + + /* Not in CLDR 21.0.1. Arabic language +* http://www.ethnologue.com/show_language.asp?code=arq +* Added 2009-08-27. +*/ + 'arq' = 'アラビア語アルジェリア方言', + + /* Not in CLDR 21.0.1. Arabic language +* http://www.ethnologue.com/show_language.asp?code=ary +* Added 2008-04-12. +*/ + 'ary' = 'アラビア語モロッコ方言', + + /* Not in CLDR 21.0.1. Arabic language +* http://www.ethnologue.com/show_language.asp?code=arz +* Added 2009-08-23. +*/ + 'arz' = 'アラビア語エジプト方言', + + /* Not in CLDR 21.0.1. Southern Turkic +* http://www.ethnologue.com/show_language.asp?code=azb +* Added 2012-11-28. +*/ + 'azb' = '南部アゼルバイジャン語', + + /* Not in CLDR 21.0.1. Name Bavarian used by Ethnologue: +* http://www.ethnologue.com/show_language.asp?code=bar +* Added 2007-11-10. +*/ + 'bar' = 'バイエルン・オーストリア語', + + /* Not in CLDR 21.0.1. Balochi language +* http://www.ethnologue.org/show_language.asp?code=bcc +* Added 2008-07-02. +*/ + 'bcc' = '南部バローチー語', + + /* Not in CLDR 21.0.1. Betawi language. +* http://www.ethnologue.com/show_language.asp?code=bew +* Added 2011-11-10. +*/ + 'bew' = 'ベタウィ語', + + /* Not in CLDR 21.0.1. Malay language. +* http://www.ethnologue.org/show_language.asp?code=bjn +* Added 2011-09-10. +*/ + // 'bjn' = 'Banjar', + + /* Not in CLDR 21.0.1. Name Bishnupriya used by Ethnologue: +* http://www.ethnologue.org/show_language.asp?code=bpy +* Added 2007-11-10. +*/ + 'bpy' = 'ビシュヌプリヤ・マニプリ語', + + /* Not in CLDR 21.0.1. Luri language +* http://www.ethnologue.org/show_language.asp?code=bqi +* Added 2007-11-10. +*/ + // 'bqi' = 'Bakhtiari', + + /* Not in CLDR 21.0.1. Bihari language +* http://www.ethnologue.org/show_language.asp?code=brh +* Added 2011-04-16. +*/ + 'brh' = 'ブラーフーイー語', + + /* Not in CLDR 21.0.1. Bisayan language +* http://www.ethnologue.org/show_language.asp?code=cps +* Added 2010-01-11. +*/ + // 'cps' = 'Capiznon', + + /* Not in CLDR 21.0.1. Swedish language +* http://www.ethnologue.org/show_language.asp?code=dlc +* Added 2008-02-16. +*/ + // 'dlc' = 'Dalecarlian', + + /* Not in CLDR 21.0.1. Central Dusun language +* http://www.ethnologue.org/show_language.asp?code=dtp +* Added 2011-04-16. +*/ + // 'dtp' = 'Central Dusun', + + /* Not in CLDR 21.0.1. Romance language. +* http://www.ethnologue.org/show_language.asp?code=eml +* Added 2008-01-17. +*/ + 'eml' = 'エミリア・ロマーニャ語', + + /* Not in CLDR 21.0.1. Romance language. +* http://www.ethnologue.org/show_language.asp?code=ext +* Added 2007-12-02. +*/ + 'ext' = 'エストレマドゥーラ語', + + /* Not in CLDR 21.0.1. Variety of French. +* http://www.ethnologue.org/show_language.asp?code=frc +* Added 2007-12-02. +*/ + // 'frc' = 'Cajun French', + + /* Not in CLDR 21.0.1. Romance language. +* http://www.ethnologue.org/show_language.asp?code=frp +* Added 2007-12-02. +*/ + 'frp' = 'アルピタン語', + + /* Not in CLDR 21.0.1. Chinese language. +* http://www.ethnologue.org/show_language.asp?code=hak +* Added 2007-12-02. +*/ + 'hak' = '客家語', + + /* Not in CLDR 21.0.1. Turkic language. +* Added 2008-01-14. +*/ + // 'gag' =
[MediaWiki-commits] [Gerrit] Use % substitution instead of str.format - change (pywikibot/compat)
Xqt has submitted this change and it was merged. Change subject: Use % substitution instead of str.format .. Use % substitution instead of str.format Python 2.5 does not have str.format() and it is not strictly necessary here. Change-Id: If23c8d2a42947381d25d26fced3437cbe35a900f --- M wikipedia.py 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Xqt: Looks good to me, approved diff --git a/wikipedia.py b/wikipedia.py index d0d8488..6d30811 100644 --- a/wikipedia.py +++ b/wikipedia.py @@ -185,7 +185,7 @@ # Format string for the default user agent. -USER_AGENT_FORMAT = '{script}/r{version[rev]} Pywikipediabot/1.0' +USER_AGENT_FORMAT = '%(script)s/r%(versionrev)s Pywikipediabot/1.0' SaxError = xml.sax._exceptions.SAXParseException @@ -5982,9 +5982,9 @@ useragent = s # Default User-agent -setUserAgent(USER_AGENT_FORMAT.format( +setUserAgent(USER_AGENT_FORMAT % dict( script=('-'.join(version.get_executing_script())), -version=version.getversiondict() +versionrev=(version.getversiondict()[rev]) )) -- To view, visit https://gerrit.wikimedia.org/r/98395 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If23c8d2a42947381d25d26fced3437cbe35a900f Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Xqt i...@gno.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] [BUGFIX] site object or language code is necessary for trans... - change (pywikibot/core)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/99624 Change subject: [BUGFIX] site object or language code is necessary for translation .. [BUGFIX] site object or language code is necessary for translation Change-Id: Ia0c6f416a788b0726573c4c5091c354a1ff04c6d --- M scripts/basic.py 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/24/99624/1 diff --git a/scripts/basic.py b/scripts/basic.py index 96285e6..9f191f2 100755 --- a/scripts/basic.py +++ b/scripts/basic.py @@ -49,6 +49,7 @@ what would have been changed. @type dry: boolean. +site = pywikibot.getSite() self.generator = generator self.dry = dry # Set the edit summary message -- To view, visit https://gerrit.wikimedia.org/r/99624 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia0c6f416a788b0726573c4c5091c354a1ff04c6d Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt i...@gno.de Gerrit-Reviewer: Mdupont jamesmikedup...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Sort the translator requests by number of translations and r... - change (mediawiki...Translate)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/99625 Change subject: Sort the translator requests by number of translations and request data .. Sort the translator requests by number of translations and request data Change-Id: I5e4071ed9d11434aaef050e143e5bee935b5453e --- M specials/SpecialTranslateSandbox.php 1 file changed, 33 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/25/99625/1 diff --git a/specials/SpecialTranslateSandbox.php b/specials/SpecialTranslateSandbox.php index c2a8671..da2664d 100644 --- a/specials/SpecialTranslateSandbox.php +++ b/specials/SpecialTranslateSandbox.php @@ -14,7 +14,7 @@ * @ingroup SpecialPage TranslateSpecialPage */ class SpecialTranslateSandbox extends SpecialPage { - /// @param TranslationStashStorage + /// @param TranslationStashStorage protected $stash; function __construct() { @@ -53,7 +53,7 @@ foreach ( array( 'Pupu', 'Orava' ) as $prefix ) { for ( $i = 0; $i 5; $i++ ) { $user = TranslateSandbox::addUser( $prefix$i, $prefix$i...@pupun.kolo, 'porkkana' ); - for( $j = 0; $j $i; $j++ ) { + for ( $j = 0; $j $i; $j++ ) { $title = Title::makeTitle( NS_MEDIAWIKI, wfRandomString( 24 ) . '/fi' ); $translation = 'plop'; $stashedTranslation = new StashedTranslation( $user, $title, $translation ); @@ -117,14 +117,28 @@ protected function makeList() { $items = array(); - + $requests = array(); $users = TranslateSandbox::getUsers(); foreach ( $users as $user ) { - $items[] = $this-makeRequestItem( $user ); + $requests[] = array( + 'username' = $user-getName(), + 'email' = $user-getEmail(), + 'registrationdate' = $user-getRegistration(), + 'translations' = rand( 0, 20 ),// count( $this-stash-getTranslations( $user ) ), + 'languagepreferences' = FormatJson::decode( $user-getOption( 'translate-sandbox' ) ), + 'userid' = $user-getId(), + ); } - $count = count( $items ); + // Sort the requests based on translations and registration date + usort( $requests, array( __CLASS__, 'translatorRequestSort' ) ); + + $count = count( $users ); + foreach ( $requests as $request ) { + $items[] = $this-makeRequestItem( $request ); + } + $requestsList = implode( \n, $items ); return HTML @@ -147,18 +161,8 @@ HTML; } - protected function makeRequestItem( User $user ) { - $request = array( - 'username' = $user-getName(), - 'email' = $user-getEmail(), - 'registrationdate' = $user-getRegistration(), - 'translations' = count( $this-stash-getTranslations( $user ) ), - 'languagepreferences' = FormatJson::decode( $user-getOption( 'translate-sandbox' ) ), - 'userid' = $user-getId(), - ); - + protected function makeRequestItem( $request ) { $requestdataEnc = htmlspecialchars( FormatJson::encode( $request ) ); - $nameEnc = htmlspecialchars( $request['username'] ); $emailEnc = htmlspecialchars( $request['email'] ); $countEnc = htmlspecialchars( $request['translations'] ); @@ -182,4 +186,17 @@ /div HTML; } + + /// Sorts groups by descending order of translations and registration date + public static function translatorRequestSort( $a, $b ) { + $aTranslations = $a['translations']; + $bTranslations = $b['translations']; + + $translations = $bTranslations - $aTranslations; + + if ( $translations === 0 ) { + return strcmp ( $a['registrationdate'], $b['registrationdate'] ); + } + return $translations; + } } -- To view, visit https://gerrit.wikimedia.org/r/99625 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5e4071ed9d11434aaef050e143e5bee935b5453e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Santhosh
[MediaWiki-commits] [Gerrit] [BUGFIX] site object or language code is necessary for trans... - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [BUGFIX] site object or language code is necessary for translation .. [BUGFIX] site object or language code is necessary for translation Change-Id: Ia0c6f416a788b0726573c4c5091c354a1ff04c6d --- M scripts/basic.py 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/basic.py b/scripts/basic.py index 96285e6..9f191f2 100755 --- a/scripts/basic.py +++ b/scripts/basic.py @@ -49,6 +49,7 @@ what would have been changed. @type dry: boolean. +site = pywikibot.getSite() self.generator = generator self.dry = dry # Set the edit summary message -- To view, visit https://gerrit.wikimedia.org/r/99624 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia0c6f416a788b0726573c4c5091c354a1ff04c6d Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt i...@gno.de Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Mdupont jamesmikedup...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Xqt i...@gno.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] [VisualEditor] Ignore a new message key - change (translatewiki)
Raimond Spekking has submitted this change and it was merged. Change subject: [VisualEditor] Ignore a new message key .. [VisualEditor] Ignore a new message key https://gerrit.wikimedia.org/r/#/c/90940/30/VisualEditor.i18n.php,unified Change-Id: Ia6873d1b609c22626d0fcc8a2642e7fa50ec6eab --- M groups/MediaWiki/mediawiki-defines.txt 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Raimond Spekking: Verified; Looks good to me, approved diff --git a/groups/MediaWiki/mediawiki-defines.txt b/groups/MediaWiki/mediawiki-defines.txt index 537e9e8..7576409 100644 --- a/groups/MediaWiki/mediawiki-defines.txt +++ b/groups/MediaWiki/mediawiki-defines.txt @@ -1731,7 +1731,7 @@ optional = visualeditor-preference-mwalienextension-discussion-link, visualeditor-preference-mwalienextension-info-link optional = visualeditor-preference-mwhiero-discussion-link, visualeditor-preference-mwhiero-info-link optional = visualeditor-preference-mwmath-discussion-link, visualeditor-preference-mwmath-info-link -ignored = visualeditor-help-link +ignored = visualeditor-help-link, visualeditor-specialcharinspector-characterlist-insert Vote NY file = VoteNY/Vote.i18n.php -- To view, visit https://gerrit.wikimedia.org/r/99626 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia6873d1b609c22626d0fcc8a2642e7fa50ec6eab Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [VisualEditor] Ignore a new message key - change (translatewiki)
Raimond Spekking has uploaded a new change for review. https://gerrit.wikimedia.org/r/99626 Change subject: [VisualEditor] Ignore a new message key .. [VisualEditor] Ignore a new message key https://gerrit.wikimedia.org/r/#/c/90940/30/VisualEditor.i18n.php,unified Change-Id: Ia6873d1b609c22626d0fcc8a2642e7fa50ec6eab --- M groups/MediaWiki/mediawiki-defines.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/26/99626/1 diff --git a/groups/MediaWiki/mediawiki-defines.txt b/groups/MediaWiki/mediawiki-defines.txt index 537e9e8..7576409 100644 --- a/groups/MediaWiki/mediawiki-defines.txt +++ b/groups/MediaWiki/mediawiki-defines.txt @@ -1731,7 +1731,7 @@ optional = visualeditor-preference-mwalienextension-discussion-link, visualeditor-preference-mwalienextension-info-link optional = visualeditor-preference-mwhiero-discussion-link, visualeditor-preference-mwhiero-info-link optional = visualeditor-preference-mwmath-discussion-link, visualeditor-preference-mwmath-info-link -ignored = visualeditor-help-link +ignored = visualeditor-help-link, visualeditor-specialcharinspector-characterlist-insert Vote NY file = VoteNY/Vote.i18n.php -- To view, visit https://gerrit.wikimedia.org/r/99626 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia6873d1b609c22626d0fcc8a2642e7fa50ec6eab Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update ProofreadPage to master - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Update ProofreadPage to master .. Update ProofreadPage to master Change-Id: I2bbfff09bf7f69b35574f3d03a756cda7aa4ef81 --- M extensions/ProofreadPage 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/extensions/ProofreadPage b/extensions/ProofreadPage index 32ac099..5026f35 16 --- a/extensions/ProofreadPage +++ b/extensions/ProofreadPage -Subproject commit 32ac09909c09a1e53aff83fa253dd3cc19ebfa00 +Subproject commit 5026f35e146986c8d3021365052e523aec795ceb -- To view, visit https://gerrit.wikimedia.org/r/99522 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2bbfff09bf7f69b35574f3d03a756cda7aa4ef81 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf5 Gerrit-Owner: Tpt thoma...@hotmail.fr Gerrit-Reviewer: Hashar has...@free.fr Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adds the capacity to zoom by mouse wheel - change (mediawiki...ProofreadPage)
jenkins-bot has submitted this change and it was merged. Change subject: Adds the capacity to zoom by mouse wheel .. Adds the capacity to zoom by mouse wheel Change-Id: Ia3e0cdf1e28dfb3a6153f32d707864e5e88a46c6 --- M ProofreadPage.php A modules/jquery/jquery.mousewheel.js M modules/jquery/jquery.prpZoom.js 3 files changed, 165 insertions(+), 13 deletions(-) Approvals: Tpt: Looks good to me, approved Rtdwivedi: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/ProofreadPage.php b/ProofreadPage.php index f32e9a1..2e62ef1 100644 --- a/ProofreadPage.php +++ b/ProofreadPage.php @@ -108,9 +108,12 @@ 'remoteExtPath' = 'ProofreadPage/modules' ); $wgResourceModules += array( + 'jquery.mousewheel' = $prpResourceTemplate + array( + 'scripts' = 'jquery/jquery.mousewheel.js' + ), 'jquery.prpZoom' = $prpResourceTemplate + array( 'scripts' = 'jquery/jquery.prpZoom.js', - 'dependencies' = array( 'jquery.ui.widget', 'jquery.ui.draggable' ) + 'dependencies' = array( 'jquery.ui.widget', 'jquery.ui.draggable', 'jquery.mousewheel' ) ), 'ext.proofreadpage.base' = $prpResourceTemplate + array( 'styles' = 'ext.proofreadpage.base.css', diff --git a/modules/jquery/jquery.mousewheel.js b/modules/jquery/jquery.mousewheel.js new file mode 100755 index 000..ad013e9 --- /dev/null +++ b/modules/jquery/jquery.mousewheel.js @@ -0,0 +1,129 @@ +/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh) + * Licensed under the MIT License. + * + * Version: 3.1.6 + * + * Requires: jQuery 1.2.2+ + */ + +(function ($) { + +var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'], +toBind = ( 'onwheel' in document || document.documentMode = 9 ) ? +['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'], +slice = Array.prototype.slice, +nullLowestDeltaTimeout, lowestDelta; + +if ( $.event.fixHooks ) { +for ( var i = toFix.length; i; ) { +$.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; +} +} + +$.event.special.mousewheel = { +version: '3.1.6', + +setup: function() { +if ( this.addEventListener ) { +for ( var i = toBind.length; i; ) { +this.addEventListener( toBind[--i], handler, false ); +} +} else { +this.onmousewheel = handler; +} +}, + +teardown: function() { +if ( this.removeEventListener ) { +for ( var i = toBind.length; i; ) { +this.removeEventListener( toBind[--i], handler, false ); +} +} else { +this.onmousewheel = null; +} +} +}; + +$.fn.extend({ +mousewheel: function(fn) { +return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel'); +}, + +unmousewheel: function(fn) { +return this.unbind('mousewheel', fn); +} +}); + + +function handler(event) { +var orgEvent = event || window.event, +args = slice.call(arguments, 1), +delta = 0, +deltaX = 0, +deltaY = 0, +absDelta = 0; +event = $.event.fix(orgEvent); +event.type = 'mousewheel'; + +// Old school scrollwheel delta +if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; } +if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; } +if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; } +if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; } + +// Firefox 17 horizontal scrolling related to DOMMouseScroll event +if ( 'axis' in orgEvent orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { +deltaX = deltaY * -1; +deltaY = 0; +} + +// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy +delta = deltaY === 0 ? deltaX : deltaY; + +// New school wheel delta (wheel event) +if ( 'deltaY' in orgEvent ) { + deltaY = orgEvent.deltaY * -1; + delta = deltaY; +} +if ( 'deltaX' in orgEvent ) { + deltaX = orgEvent.deltaX; + if ( deltaY === 0 ) { delta = deltaX * -1; } +} + +// No change actually happened, no reason to go any further +if ( deltaY === 0 deltaX === 0 ) { return; } + +// Store lowest absolute delta to normalize the delta values +absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) ); +if ( !lowestDelta || absDelta lowestDelta ) { + lowestDelta = absDelta; +} + +
[MediaWiki-commits] [Gerrit] Update ProofreadPage to master - change (mediawiki/core)
Tpt has uploaded a new change for review. https://gerrit.wikimedia.org/r/99627 Change subject: Update ProofreadPage to master .. Update ProofreadPage to master Change-Id: Iac8f802e7bb8d2f606b718dbab39ae78e8a6f218 --- M extensions/ProofreadPage 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/27/99627/1 diff --git a/extensions/ProofreadPage b/extensions/ProofreadPage index 6018f0f..7f886e8 16 --- a/extensions/ProofreadPage +++ b/extensions/ProofreadPage -Subproject commit 6018f0fd38728b0bd4df7af82c30e2702bf021d5 +Subproject commit 7f886e8d6d95e7a4eafed665c901c805d623b18d -- To view, visit https://gerrit.wikimedia.org/r/99627 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac8f802e7bb8d2f606b718dbab39ae78e8a6f218 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf6 Gerrit-Owner: Tpt thoma...@hotmail.fr ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update ProofreadPage to master - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Update ProofreadPage to master .. Update ProofreadPage to master Change-Id: Iac8f802e7bb8d2f606b718dbab39ae78e8a6f218 --- M extensions/ProofreadPage 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/extensions/ProofreadPage b/extensions/ProofreadPage index 6018f0f..7f886e8 16 --- a/extensions/ProofreadPage +++ b/extensions/ProofreadPage -Subproject commit 6018f0fd38728b0bd4df7af82c30e2702bf021d5 +Subproject commit 7f886e8d6d95e7a4eafed665c901c805d623b18d -- To view, visit https://gerrit.wikimedia.org/r/99627 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iac8f802e7bb8d2f606b718dbab39ae78e8a6f218 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf6 Gerrit-Owner: Tpt thoma...@hotmail.fr Gerrit-Reviewer: Hashar has...@free.fr 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 logout link code to use Userlogout instead of alias - change (mediawiki...MobileFrontend)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/99628 Change subject: Fix logout link code to use Userlogout instead of alias .. Fix logout link code to use Userlogout instead of alias php notice is triggered when using an alias in SpecialPage::getTitleFor(). Change-Id: I05e31a8b7cd8f046384ea9636466e02d897ac159 --- M includes/skins/SkinMinerva.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/28/99628/1 diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index 55e0901..776d97e 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -287,7 +287,7 @@ if ( !empty( $returntoquery ) ) { $query[ 'returntoquery' ] = wfArrayToCgi( $returntoquery ); } - $url = SpecialPage::getTitleFor( 'UserLogout' )-getFullURL( $query ); + $url = SpecialPage::getTitleFor( 'Userlogout' )-getFullURL( $query ); $url = $this-mobileContext-getMobileUrl( $url, $wgSecureLogin ); $text = wfMessage( 'mobile-frontend-main-menu-logout' )-escaped(); } else { -- To view, visit https://gerrit.wikimedia.org/r/99628 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05e31a8b7cd8f046384ea9636466e02d897ac159 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend 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] Bug 57971 - fix generate_user_files.py crash - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Bug 57971 - fix generate_user_files.py crash .. Bug 57971 - fix generate_user_files.py crash Fixes the incorrect family file reading introduced in https://gerrit.wikimedia.org/r/#/c/81500/ Change-Id: I2ccb3bce82518f53a6aab6aa10c5135be6553e42 --- M generate_user_files.py 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/generate_user_files.py b/generate_user_files.py index dfa2a0a..a2fada7 100644 --- a/generate_user_files.py +++ b/generate_user_files.py @@ -165,7 +165,10 @@ just enter the number not name, default='wikipedia') if fam not in single_wiki_families: -codesds = codecs.open(pywikibot/families/%s_family.py % fam, +codesds = codecs.open(os.path.join(pywikibot_dir, + pywikibot, + families, + %s_family.py % fam), r, utf-8).read() rre = re.compile(self\.languages\_by\_size *\= *(.+?)\], re.DOTALL) -- To view, visit https://gerrit.wikimedia.org/r/99471 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2ccb3bce82518f53a6aab6aa10c5135be6553e42 Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Ladsgroup ladsgr...@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 test users with different language settings - change (mediawiki...Translate)
Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/99629 Change subject: Add test users with different language settings .. Add test users with different language settings This populates the database with test accounts with comprehensive and useful language options: * setting the user's sandbox language preference * making translations in different languages Change-Id: Iaf0c776aa9434913c0b81459bb820f38ff025fbd --- M specials/SpecialTranslateSandbox.php 1 file changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/29/99629/1 diff --git a/specials/SpecialTranslateSandbox.php b/specials/SpecialTranslateSandbox.php index adfdee0..ab20c26 100644 --- a/specials/SpecialTranslateSandbox.php +++ b/specials/SpecialTranslateSandbox.php @@ -50,11 +50,20 @@ if ( $request-getVal( 'integrationtesting' ) === 'populate' ) { $this-emptySandbox(); - foreach ( array( 'Pupu', 'Orava' ) as $prefix ) { - for ( $i = 0; $i 5; $i++ ) { - $user = TranslateSandbox::addUser( $prefix$i, $prefix$i...@pupun.kolo, 'porkkana' ); + $textUsernamePrefixes = array( 'Pupu', 'Orava' ); + $testLanguages = array( 'fi', 'uk', 'nl', 'ml', 'bn' ); + + foreach ( $textUsernamePrefixes as $prefix ) { + for ( $i = 0; $i count( $testLanguages ); $i++ ) { + $user = TranslateSandbox::addUser( $prefix$i, $prefix$i...@pupun.kolo, 'porkkana' ); + $user-setOption( + 'translate-sandbox', + '{languages:[' . $testLanguages[i] . '],comment:}' + ); + $user-saveSettings(); + for( $j = 0; $j $i; $j++ ) { - $title = Title::makeTitle( NS_MEDIAWIKI, wfRandomString( 24 ) . '/fi' ); + $title = Title::makeTitle( NS_MEDIAWIKI, wfRandomString( 24 ) . '/' . $testLanguages[$i] ); $translation = 'plop'; $stashedTranslation = new StashedTranslation( $user, $title, $translation ); $this-stash-addTranslation( $stashedTranslation ); -- To view, visit https://gerrit.wikimedia.org/r/99629 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf0c776aa9434913c0b81459bb820f38ff025fbd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Change the second return of ckb from fa to en - change (pywikibot/compat)
Ladsgroup has uploaded a new change for review. https://gerrit.wikimedia.org/r/99630 Change subject: Change the second return of ckb from fa to en .. Change the second return of ckb from fa to en I've received an e-mail from a prominent contributor of ckb projects complaining about the return and he said ckb contributors are divided to Iranian Kurds and Iraqi Kurds which Iraqi Kurds don't understand Persian and Iranian Kurds don't understand Arabic, even Iraqi Kurds can't understand Arabic well so as he said English is best return Change-Id: I8964c1a089ced42e0041619910f82da168553baf --- M pywikibot/i18n.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/30/99630/1 diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 731bece..4a16eb8 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -175,7 +175,7 @@ if code == 'gag': return ['tr'] if code == 'ckb': -return ['ku', 'fa'] +return ['ku', 'en'] #Ukrainian if code in ['crh', 'rue']: return ['uk', 'ru'] -- To view, visit https://gerrit.wikimedia.org/r/99630 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8964c1a089ced42e0041619910f82da168553baf Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: Ladsgroup ladsgr...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Version 3.0: AJAX pager, better anti-spam measures, etc. - change (mediawiki...Comments)
Jack Phoenix has uploaded a new change for review. https://gerrit.wikimedia.org/r/99632 Change subject: Version 3.0: AJAX pager, better anti-spam measures, etc. .. Version 3.0: AJAX pager, better anti-spam measures, etc. If a page has more than 100 comments, pager is used instead of trying to load all comments at once, which could cause OOM issues when a page has lots and lots of comments. Using external links in comments now requires the new 'commentlinks' user right, which is given to the autoconfirmed group by default. Without this user right, the user cannot post content that contains *any* external links. Posting spam (content that matches $wgSpamRegex, $wgSummarySpamRegex or other such filters which are hooked to the Comments::isSpam hook) requires the commentadmin user right. Patch by MediaWiki.org user SimonLitt with some very minor cleanup by me. Change-Id: I4d1d67c745999d31d000b15893e7af93dbd6d41c --- M Comment.js M Comment.php M CommentClass.php M Comments.css M Comments.i18n.php M CommentsHooks.php M Comments_AjaxFunctions.php 7 files changed, 406 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Comments refs/changes/32/99632/1 diff --git a/Comment.js b/Comment.js index 4d7cd41..76ee92b 100644 --- a/Comment.js +++ b/Comment.js @@ -4,7 +4,7 @@ * object-oriented. * * @file - * @date 28 July 2013 + * @date 6 December 2013 */ var Comment = { submitted: 0, @@ -114,13 +114,15 @@ * @param pid Integer: page ID * @param ord Sorting order * @param end +* @param cpage Integer: comment page number (used for pagination) */ - viewComments: function( pid, ord, end ) { + viewComments: function( pid, ord, end, cpage ) { + document.commentform.cpage.value = cpage; document.getElementById( 'allcomments' ).innerHTML = mw.msg( 'comments-loading' ) + 'br /br /'; var x = sajax_init_object(); var url = mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/index.php?title=Special:CommentListGetpid=' + pid + 'ord=' + - ord; + ord + 'cpage=' + cpage; x.open( 'get', url, true ); @@ -161,8 +163,13 @@ 'wfCommentSubmit', [ pidVal, parentId, commentText, token ], function( response ) { - document.commentform.comment_text.value = ''; - Comment.viewComments( document.commentform.pid.value, 0, 1 ); + if ( response.responseText === 'ok' ) { + document.commentform.comment_text.value = ''; + Comment.viewComments( document.commentform.pid.value, 0, 1, document.commentform.cpage.value ); + } else if ( response.responseText != undefined response.responseText != null response.responseText != '' ) { + alert( response.responseText ); + Comment.submitted = 0; + } } ); Comment.cancelReply(); @@ -222,7 +229,7 @@ // Get last new ID Comment.CurLatestCommentID = response.responseText; if ( Comment.CurLatestCommentID != Comment.LatestCommentID ) { - Comment.viewComments( document.commentform.pid.value, 0, 1 ); + Comment.viewComments( document.commentform.pid.value, 0, 1, document.commentform.cpage.value ); Comment.LatestCommentID = Comment.CurLatestCommentID; } } @@ -273,7 +280,9 @@ jQuery( 'body' ).on( 'change', 'select[name=TheOrder]', function() { Comment.viewComments( mw.config.get( 'wgArticleId' ), // or we could use jQuery( 'input[name=pid]' ).val(), too - jQuery( this ).val() + jQuery( this ).val(), + 0, + document.commentform.cpage.value ); } ); @@ -330,4 +339,24 @@ jQuery( 'body' ).on( 'click', 'div.c-form-button input[type=button]', function() { Comment.submit(); } ); + + // Change page + jQuery( 'body' ).on( 'click', 'li.c-pager-item a.c-pager-link', function() { + var ord = 0, + commentsBody = jQuery( this ).parents( 'div.comments-body:first' ); + + if (
[MediaWiki-commits] [Gerrit] Script for finding number of characters edited for a given n... - change (mediawiki...Translate)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/99633 Change subject: Script for finding number of characters edited for a given number of days .. Script for finding number of characters edited for a given number of days Change-Id: I8c46d8776ef1a212ab235ad13b1f525b89c45443 --- A scripts/charactereditstats.php 1 file changed, 127 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/33/99633/1 diff --git a/scripts/charactereditstats.php b/scripts/charactereditstats.php new file mode 100644 index 000..2b4d47f --- /dev/null +++ b/scripts/charactereditstats.php @@ -0,0 +1,127 @@ +?php +/** + * Show number of characters translated over a given period of time. + * + * @author Santhosh Thottingal + * @copyright Copyright © 2013 Santhosh Thottingal + * @license GPL-2.0+ + * @file + * @ingroup Script Stats + */ + +// Standard boilerplate to define $IP +if ( getenv( 'MW_INSTALL_PATH' ) !== false ) { + $IP = getenv( 'MW_INSTALL_PATH' ); +} else { + $dir = __DIR__; + $IP = $dir/../../..; +} +require_once $IP/maintenance/Maintenance.php; + +class CharacterEditStats extends Maintenance { + public function __construct() { + parent::__construct(); + $this-mDescription = 'Script to show number of characters translated .'; + $this-addOption( + '(optional) Show given number of language codes (default: 10)', + 'top', + false, /*required*/ + true /*has arg*/ + ); + $this-addOption( + '(optional) Calculate for given number of days (default: 30)', + 'days', + false, /*required*/ + true /*has arg*/ + ); + $this-addOption( + '(optional) Include bot edits', + 'bots' + ); + $this-addOption( + '(optional) Comma separated list of namespace IDs', + 'ns', + false, /*required*/ + true /*has arg*/ + ); + } + + public function execute() { + $hours = (int)$this-getOption( 'days' ); + $hours = $hours ? $hours * 24 : 30 * 24; + + $top = (int)$this-getOption( 'top' ); + $top = $top ? $top : 10; + + $bots = $this-hasOption( 'bots' ); + + $namespaces = array(); + if ( $this-hasOption( 'ns' ) ) { + $input = explode( ',', $this-getOption( 'ns' ) ); + + foreach ( $input as $namespace ) { + if ( is_numeric( $namespace ) ) { + array_push( $namespaces, $namespace ); + } + } + } + + /** +* Select set of edits to report on +*/ + $rows = TranslateUtils::translationChanges( $hours, $bots, $namespaces ); + /** +* Get counts for edits per language code after filtering out edits by FuzzyBot +*/ + $codes = array(); + global $wgTranslateFuzzyBotName; + foreach ( $rows as $revId = $_ ) { + // Filter out edits by $wgTranslateFuzzyBotName + if ( $_-rc_user_text === $wgTranslateFuzzyBotName ) { + continue; + } + + list( , $code ) = TranslateUtils::figureMessage( $_-rc_title ); + + if ( !isset( $codes[$code] ) ) { + $codes[$code] = 0; + } + + $revision = Revision::newFromId( $revId ); + + if ( $revision !== null ) { + $prevRevision = $revision-getPrevious(); + if ( $prevRevision === null ) { + $diff = $revision-getSize(); + } else { + $diff = $prevRevision-getSize() - $revision-getSize(); + $diff = $diff = 0 ? $diff : $diff * -1; + } + $codes[$code] += $diff; + } + } + + /** +* Sort counts and report descending up to $top rows. +*/ + arsort( $codes ); + $i = 0; + $total = 0; + $this-output( code\tname\tedit\n ); + foreach ( $codes as $code = $num ) { +
[MediaWiki-commits] [Gerrit] Add the level change summary tag even if there is an edit su... - change (mediawiki...ProofreadPage)
Tpt has uploaded a new change for review. https://gerrit.wikimedia.org/r/99634 Change subject: Add the level change summary tag even if there is an edit summary .. Add the level change summary tag even if there is an edit summary Change-Id: I877d118a151fe599218b605d68f090c7caba9390 --- M includes/page/ProofreadPageContentHandler.php 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage refs/changes/34/99634/1 diff --git a/includes/page/ProofreadPageContentHandler.php b/includes/page/ProofreadPageContentHandler.php index 5d0f825..780db24 100644 --- a/includes/page/ProofreadPageContentHandler.php +++ b/includes/page/ProofreadPageContentHandler.php @@ -174,11 +174,10 @@ $summary = parent::getAutosummary( $oldContent, $newContent, $flags ); if ( - $summary === '' $newContent instanceof ProofreadPageContent ( $oldContent === null || $oldContent instanceof ProofreadPageContent !$newContent-getLevel()-equals( $oldContent-getLevel() ) ) ) { - $summary = '/*' . wfMessage( 'proofreadpage_quality' . $newContent-getLevel()-getLevel() . '_category' )-plain() . '*/'; + $summary = '/*' . wfMessage( 'proofreadpage_quality' . $newContent-getLevel()-getLevel() . '_category' )-plain() . '*/ ' . $summary; } return $summary; -- To view, visit https://gerrit.wikimedia.org/r/99634 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I877d118a151fe599218b605d68f090c7caba9390 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ProofreadPage Gerrit-Branch: master Gerrit-Owner: Tpt thoma...@hotmail.fr ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Change the second return of ckb from fa to en - change (pywikibot/core)
Ladsgroup has uploaded a new change for review. https://gerrit.wikimedia.org/r/99635 Change subject: Change the second return of ckb from fa to en .. Change the second return of ckb from fa to en I've received an e-mail from a prominent contributor of ckb projects complaining about the return and he said ckb contributors are divided to Iranian Kurds and Iraqi Kurds which Iraqi Kurds don't understand Persian and Iranian Kurds don't understand Arabic, even Iraqi Kurds can't understand Arabic well so as he said English is best return (sync with compat from change 99630) Change-Id: I59899b14b836b52321b6be8be6b99428adaedb74 --- M pywikibot/i18n.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/35/99635/1 diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 92d3eb1..8e818eb 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -177,7 +177,7 @@ if code == 'gag': return ['tr'] if code == 'ckb': -return ['ku', 'fa'] +return ['ku'] #Ukrainian if code in ['crh', 'rue']: return ['uk', 'ru'] -- To view, visit https://gerrit.wikimedia.org/r/99635 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I59899b14b836b52321b6be8be6b99428adaedb74 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Ladsgroup ladsgr...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Version 3.0: AJAX pager, better anti-spam measures, etc. - change (mediawiki...Comments)
Jack Phoenix has submitted this change and it was merged. Change subject: Version 3.0: AJAX pager, better anti-spam measures, etc. .. Version 3.0: AJAX pager, better anti-spam measures, etc. If a page has more than 100 comments, pager is used instead of trying to load all comments at once, which could cause OOM issues when a page has lots and lots of comments. Using external links in comments now requires the new 'commentlinks' user right, which is given to the autoconfirmed group by default. Without this user right, the user cannot post content that contains *any* external links. Posting spam (content that matches $wgSpamRegex, $wgSummarySpamRegex or other such filters which are hooked to the Comments::isSpam hook) requires the commentadmin user right. Patch by MediaWiki.org user SimonLitt with some very minor cleanup by me. Change-Id: I4d1d67c745999d31d000b15893e7af93dbd6d41c --- M Comment.js M Comment.php M CommentClass.php M Comments.css M Comments.i18n.php M CommentsHooks.php M Comments_AjaxFunctions.php 7 files changed, 406 insertions(+), 18 deletions(-) Approvals: Jack Phoenix: Verified; Looks good to me, approved diff --git a/Comment.js b/Comment.js index 4d7cd41..76ee92b 100644 --- a/Comment.js +++ b/Comment.js @@ -4,7 +4,7 @@ * object-oriented. * * @file - * @date 28 July 2013 + * @date 6 December 2013 */ var Comment = { submitted: 0, @@ -114,13 +114,15 @@ * @param pid Integer: page ID * @param ord Sorting order * @param end +* @param cpage Integer: comment page number (used for pagination) */ - viewComments: function( pid, ord, end ) { + viewComments: function( pid, ord, end, cpage ) { + document.commentform.cpage.value = cpage; document.getElementById( 'allcomments' ).innerHTML = mw.msg( 'comments-loading' ) + 'br /br /'; var x = sajax_init_object(); var url = mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/index.php?title=Special:CommentListGetpid=' + pid + 'ord=' + - ord; + ord + 'cpage=' + cpage; x.open( 'get', url, true ); @@ -161,8 +163,13 @@ 'wfCommentSubmit', [ pidVal, parentId, commentText, token ], function( response ) { - document.commentform.comment_text.value = ''; - Comment.viewComments( document.commentform.pid.value, 0, 1 ); + if ( response.responseText === 'ok' ) { + document.commentform.comment_text.value = ''; + Comment.viewComments( document.commentform.pid.value, 0, 1, document.commentform.cpage.value ); + } else if ( response.responseText != undefined response.responseText != null response.responseText != '' ) { + alert( response.responseText ); + Comment.submitted = 0; + } } ); Comment.cancelReply(); @@ -222,7 +229,7 @@ // Get last new ID Comment.CurLatestCommentID = response.responseText; if ( Comment.CurLatestCommentID != Comment.LatestCommentID ) { - Comment.viewComments( document.commentform.pid.value, 0, 1 ); + Comment.viewComments( document.commentform.pid.value, 0, 1, document.commentform.cpage.value ); Comment.LatestCommentID = Comment.CurLatestCommentID; } } @@ -273,7 +280,9 @@ jQuery( 'body' ).on( 'change', 'select[name=TheOrder]', function() { Comment.viewComments( mw.config.get( 'wgArticleId' ), // or we could use jQuery( 'input[name=pid]' ).val(), too - jQuery( this ).val() + jQuery( this ).val(), + 0, + document.commentform.cpage.value ); } ); @@ -330,4 +339,24 @@ jQuery( 'body' ).on( 'click', 'div.c-form-button input[type=button]', function() { Comment.submit(); } ); + + // Change page + jQuery( 'body' ).on( 'click', 'li.c-pager-item a.c-pager-link', function() { + var ord = 0, + commentsBody = jQuery( this ).parents( 'div.comments-body:first' ); + + if ( commentsBody.length 0 ) { + var ordCrtl =
[MediaWiki-commits] [Gerrit] Add test users with different language settings - change (mediawiki...Translate)
jenkins-bot has submitted this change and it was merged. Change subject: Add test users with different language settings .. Add test users with different language settings This populates the database with test accounts with comprehensive and useful language options: * setting the user's sandbox language preference * making translations in different languages Change-Id: Iaf0c776aa9434913c0b81459bb820f38ff025fbd --- M specials/SpecialTranslateSandbox.php 1 file changed, 17 insertions(+), 4 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/specials/SpecialTranslateSandbox.php b/specials/SpecialTranslateSandbox.php index adfdee0..e9cc3d1 100644 --- a/specials/SpecialTranslateSandbox.php +++ b/specials/SpecialTranslateSandbox.php @@ -50,11 +50,24 @@ if ( $request-getVal( 'integrationtesting' ) === 'populate' ) { $this-emptySandbox(); - foreach ( array( 'Pupu', 'Orava' ) as $prefix ) { - for ( $i = 0; $i 5; $i++ ) { - $user = TranslateSandbox::addUser( $prefix$i, $prefix$i...@pupun.kolo, 'porkkana' ); + $textUsernamePrefixes = array( 'Pupu', 'Orava' ); + $testLanguages = array( 'fi', 'uk', 'nl', 'ml', 'bn' ); + $userCount = count( $testLanguages ); + + foreach ( $textUsernamePrefixes as $prefix ) { + for ( $i = 0; $i $userCount; $i++ ) { + $user = TranslateSandbox::addUser( $prefix$i, $prefix$i...@pupun.kolo, 'porkkana' ); + $user-setOption( + 'translate-sandbox', + FormatJson::encode( array( + 'languages' = array( $testLanguages[$i] ), + 'comment' = '' + ) ) + ); + $user-saveSettings(); + for( $j = 0; $j $i; $j++ ) { - $title = Title::makeTitle( NS_MEDIAWIKI, wfRandomString( 24 ) . '/fi' ); + $title = Title::makeTitle( NS_MEDIAWIKI, wfRandomString( 24 ) . '/' . $testLanguages[$i] ); $translation = 'plop'; $stashedTranslation = new StashedTranslation( $user, $title, $translation ); $this-stash-addTranslation( $stashedTranslation ); -- To view, visit https://gerrit.wikimedia.org/r/99629 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaf0c776aa9434913c0b81459bb820f38ff025fbd Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com 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] Add option of data.setSitelink(page) to make the compat more... - change (pywikibot/compat)
jenkins-bot has submitted this change and it was merged. Change subject: Add option of data.setSitelink(page) to make the compat more like core and make it easier to use .. Add option of data.setSitelink(page) to make the compat more like core and make it easier to use Change-Id: I7aa615af154998c57fe5d7e4f992263e5db8c603 --- M wikipedia.py 1 file changed, 11 insertions(+), 1 deletion(-) Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified diff --git a/wikipedia.py b/wikipedia.py index e5c9b2b..f5cf71e 100644 --- a/wikipedia.py +++ b/wikipedia.py @@ -4419,6 +4419,13 @@ items = self.get() return int(self.title()[1:]) +def setSitelink(self, page, summary=): +Set a Sitelink for a Datapage. +page - the site to link to +summary - edit summary +sitename = page.site().dbName().replace(_p,) +return self.setitem(summary=summary, items={'type': 'sitelink', 'site': sitename, 'title': page.title()}) + def setitem(self, summary=None, watchArticle=False, minorEdit=True, newPage=False, token=None, newToken=False, sysop=False, captcha=None, botflag=True, maxTries=-1, items={}): @@ -4457,7 +4464,10 @@ params['value'] = items['value'] params['language'] = items['language'] elif items['type'] == u'sitelink': -params['linksite'] = items['site'] + u'wiki' +if wiki in items['site']: +params['linksite'] = items['site'] +else: +params['linksite'] = items['site'] + u'wiki' params['linktitle'] = items['title'] elif items['type'] == u'label': raise NotImplementedError( -- To view, visit https://gerrit.wikimedia.org/r/97706 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7aa615af154998c57fe5d7e4f992263e5db8c603 Gerrit-PatchSet: 4 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: DrTrigon dr.tri...@surfeu.ch Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Xqt i...@gno.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add local names in Japanese - change (mediawiki...cldr)
jenkins-bot has submitted this change and it was merged. Change subject: Add local names in Japanese .. Add local names in Japanese This patch includes language names that are not covered by CLDR. Sources: * https://ja.wikipedia.org/wiki/MediaWiki:Gadget-SetInterlangTooltip.js * titles of articles about languages and Wikipedias at Japanese Wikipedia Change-Id: Ic68a0329516df07a33244943549905cd435fa283 --- A LocalNames/LocalNamesJa.php 1 file changed, 409 insertions(+), 0 deletions(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/LocalNames/LocalNamesJa.php b/LocalNames/LocalNamesJa.php new file mode 100644 index 000..2d3327e --- /dev/null +++ b/LocalNames/LocalNamesJa.php @@ -0,0 +1,409 @@ +?php +$languageNames = array( + /* Not in CLDR 21.0.1. Name Arabic, Tunisian Spoken used by Ethnologue: +* http://www.ethnologue.com/show_language.asp?code=aeb +* Added 2012-11-13. +*/ + 'aeb' = 'アラビア語チュニジア方言', + + /* Not in CLDR 21.0.1. Name Gheg Albanian used by Ethnologue: +* http://www.ethnologue.com/show_language.asp?code=aln +* Added 2008-01-04. +*/ + // 'aln' = 'Gheg Albanian', + + /* Not in CLDR 21.0.1. Arabic language +* http://www.ethnologue.com/show_language.asp?code=arq +* Added 2009-08-27. +*/ + 'arq' = 'アラビア語アルジェリア方言', + + /* Not in CLDR 21.0.1. Arabic language +* http://www.ethnologue.com/show_language.asp?code=ary +* Added 2008-04-12. +*/ + 'ary' = 'アラビア語モロッコ方言', + + /* Not in CLDR 21.0.1. Arabic language +* http://www.ethnologue.com/show_language.asp?code=arz +* Added 2009-08-23. +*/ + 'arz' = 'アラビア語エジプト方言', + + /* Not in CLDR 21.0.1. Southern Turkic +* http://www.ethnologue.com/show_language.asp?code=azb +* Added 2012-11-28. +*/ + 'azb' = '南部アゼルバイジャン語', + + /* Not in CLDR 21.0.1. Name Bavarian used by Ethnologue: +* http://www.ethnologue.com/show_language.asp?code=bar +* Added 2007-11-10. +*/ + 'bar' = 'バイエルン・オーストリア語', + + /* Not in CLDR 21.0.1. Balochi language +* http://www.ethnologue.org/show_language.asp?code=bcc +* Added 2008-07-02. +*/ + 'bcc' = '南部バローチー語', + + /* Not in CLDR 21.0.1. Betawi language. +* http://www.ethnologue.com/show_language.asp?code=bew +* Added 2011-11-10. +*/ + 'bew' = 'ベタウィ語', + + /* Not in CLDR 21.0.1. Malay language. +* http://www.ethnologue.org/show_language.asp?code=bjn +* Added 2011-09-10. +*/ + // 'bjn' = 'Banjar', + + /* Not in CLDR 21.0.1. Name Bishnupriya used by Ethnologue: +* http://www.ethnologue.org/show_language.asp?code=bpy +* Added 2007-11-10. +*/ + 'bpy' = 'ビシュヌプリヤ・マニプリ語', + + /* Not in CLDR 21.0.1. Luri language +* http://www.ethnologue.org/show_language.asp?code=bqi +* Added 2007-11-10. +*/ + // 'bqi' = 'Bakhtiari', + + /* Not in CLDR 21.0.1. Bihari language +* http://www.ethnologue.org/show_language.asp?code=brh +* Added 2011-04-16. +*/ + 'brh' = 'ブラーフーイー語', + + /* Not in CLDR 21.0.1. Bisayan language +* http://www.ethnologue.org/show_language.asp?code=cps +* Added 2010-01-11. +*/ + // 'cps' = 'Capiznon', + + /* Not in CLDR 21.0.1. Swedish language +* http://www.ethnologue.org/show_language.asp?code=dlc +* Added 2008-02-16. +*/ + // 'dlc' = 'Dalecarlian', + + /* Not in CLDR 21.0.1. Central Dusun language +* http://www.ethnologue.org/show_language.asp?code=dtp +* Added 2011-04-16. +*/ + // 'dtp' = 'Central Dusun', + + /* Not in CLDR 21.0.1. Romance language. +* http://www.ethnologue.org/show_language.asp?code=eml +* Added 2008-01-17. +*/ + 'eml' = 'エミリア・ロマーニャ語', + + /* Not in CLDR 21.0.1. Romance language. +* http://www.ethnologue.org/show_language.asp?code=ext +* Added 2007-12-02. +*/ + 'ext' = 'エストレマドゥーラ語', + + /* Not in CLDR 21.0.1. Variety of French. +* http://www.ethnologue.org/show_language.asp?code=frc +* Added 2007-12-02. +*/ + // 'frc' = 'Cajun French', + + /* Not in CLDR 21.0.1. Romance language. +* http://www.ethnologue.org/show_language.asp?code=frp +* Added 2007-12-02. +*/ + 'frp' = 'アルピタン語', + + /* Not in CLDR 21.0.1. Chinese language. +* http://www.ethnologue.org/show_language.asp?code=hak +* Added 2007-12-02. +*/ + 'hak' = '客家語', + + /* Not in CLDR 21.0.1. Turkic language. +* Added 2008-01-14. +*/ + // 'gag' = 'Gagauz', + + /* Not in CLDR
[MediaWiki-commits] [Gerrit] Remove 3 unused allpages messages - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Remove 3 unused allpages messages .. Remove 3 unused allpages messages Follows-up r10199 (1a9a48502fff): * allnotinnamespace * allpagesprev * allpagesnext Change-Id: I1f2d0d2e7fe0719b9c6e092eae0b49d1afc4fe4f --- M languages/messages/MessagesEn.php M maintenance/language/messages.inc 2 files changed, 0 insertions(+), 6 deletions(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index f8912eb..5b05d0b 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2813,9 +2813,6 @@ 'allpagesto' = 'Display pages ending at:', 'allarticles' = 'All pages', 'allinnamespace' = 'All pages ($1 namespace)', -'allnotinnamespace' = 'All pages (not in $1 namespace)', -'allpagesprev'= 'Previous', -'allpagesnext'= 'Next', 'allpagessubmit' = 'Go', 'allpagesprefix' = 'Display pages with prefix:', 'allpagesbadtitle'= 'The given page title was invalid or had an inter-language or inter-wiki prefix. diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 36f80bd..da0ef94 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1869,9 +1869,6 @@ 'allpagesto', 'allarticles', 'allinnamespace', - 'allnotinnamespace', - 'allpagesprev', - 'allpagesnext', 'allpagessubmit', 'allpagesprefix', 'allpagesbadtitle', -- To view, visit https://gerrit.wikimedia.org/r/99622 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f2d0d2e7fe0719b9c6e092eae0b49d1afc4fe4f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: PleaseStand pleasest...@live.com Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Parent5446 tylerro...@gmail.com 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] Move jquery.valueview.experts.commonsmediatype to mediawiki ... - change (mediawiki...DataValues)
jenkins-bot has submitted this change and it was merged. Change subject: Move jquery.valueview.experts.commonsmediatype to mediawiki resources, define dependency .. Move jquery.valueview.experts.commonsmediatype to mediawiki resources, define dependency On test.wikidata, it's not finding mediawiki.util.wikiUrlencode with resource loader. Works in debug mode. this expert 1) depends on mediawiki 2) try to explicitly define the dependency, even though mediawiki.util is always loaded... maybe just not in the correct order now. Change-Id: I93f1cb373aae1cbd4079916780223c0d5f446c05 --- M ValueView/ValueView.resources.mw.php M ValueView/ValueView.resources.php 2 files changed, 14 insertions(+), 13 deletions(-) Approvals: Henning Snater: Looks good to me, approved jenkins-bot: Verified diff --git a/ValueView/ValueView.resources.mw.php b/ValueView/ValueView.resources.mw.php index 472f641..0cf1aa1 100644 --- a/ValueView/ValueView.resources.mw.php +++ b/ValueView/ValueView.resources.mw.php @@ -37,6 +37,20 @@ ), ), + 'jquery.valueview.experts.commonsmediatype' = $moduleTemplate + array( + 'scripts' = array( + 'jquery.valueview/valueview.experts/experts.SuggestedStringValue.js', + 'jquery.valueview/valueview.experts/experts.CommonsMediaType.js', + ), + 'dependencies' = array( + 'jquery.valueview.experts.staticdom', + 'jquery.valueview.BifidExpert', + 'jquery.valueview.experts.stringvalue', + 'jquery.ui.suggester', + 'mediawiki.util' + ), + ), + // Dependencies required by jQuery.valueview library: 'jquery.PurposedCallbacks' = $moduleTemplate + array( 'scripts' = array( diff --git a/ValueView/ValueView.resources.php b/ValueView/ValueView.resources.php index 86a0a47..552e608 100644 --- a/ValueView/ValueView.resources.php +++ b/ValueView/ValueView.resources.php @@ -269,19 +269,6 @@ ), ), - 'jquery.valueview.experts.commonsmediatype' = $moduleTemplate + array( - 'scripts' = array( - 'jquery.valueview/valueview.experts/experts.SuggestedStringValue.js', - 'jquery.valueview/valueview.experts/experts.CommonsMediaType.js', - ), - 'dependencies' = array( - 'jquery.valueview.experts.staticdom', - 'jquery.valueview.BifidExpert', - 'jquery.valueview.experts.stringvalue', - 'jquery.ui.suggester', - ), - ), - 'jquery.valueview.experts.urltype' = $moduleTemplate + array( 'scripts' = array( 'jquery.valueview/valueview.experts/experts.UrlType.js', -- To view, visit https://gerrit.wikimedia.org/r/99582 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I93f1cb373aae1cbd4079916780223c0d5f446c05 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Addshore addshorew...@gmail.com Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de Gerrit-Reviewer: Henning Snater henning.sna...@wikimedia.de Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Lydia Pintscher lydia.pintsc...@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] Remove unused message 'resetpass' - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Remove unused message 'resetpass' .. Remove unused message 'resetpass' This was (unintentionally?) replaced by 'changepassword' in r86280 (1a80d4637002), which renamed the special page from Special:ResetPass to Special:ChangePassword. 'changepassword' was previously used in Special:Preferences until r49790 (155ddf6de4a2) for a heading directly above the link to Special:ResetPass. I moved messages 'changepassword' and 'changepassword-summary' to the correct blocks in MessagesEn.php and messages.inc and also updated message documentation that referred to Special:ResetPass. Change-Id: Ie5cbda5538f53c8e8d84c5e9d4d818fd745ff46c --- M languages/messages/MessagesEn.php M languages/messages/MessagesQqq.php M maintenance/language/messages.inc 3 files changed, 9 insertions(+), 11 deletions(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index f8912eb..20ded80 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1265,7 +1265,8 @@ 'user-mail-no-body' = 'Tried to send email with an empty or unreasonably short body.', # Change password dialog -'resetpass' = 'Change password', +'changepassword'= 'Change password', +'changepassword-summary'= '', # do not translate or duplicate this message to other languages 'resetpass_announce'= 'You logged in with a temporary emailed code. To finish logging in, you must set a new password here:', 'resetpass_text'= '!-- Add text here --', # only translate this message to other languages if you have to change it @@ -1879,8 +1880,6 @@ 'mypreferences' = 'Preferences', 'prefs-edits' = 'Number of edits:', 'prefsnologintext2' = 'Please $1 to set user preferences.', -'changepassword'= 'Change password', -'changepassword-summary'= '', # do not translate or duplicate this message to other languages 'prefs-skin'= 'Skin', 'skin-preview' = 'Preview', 'datedefault' = 'No preference', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index dd6f7b4..11eff9e 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -1593,10 +1593,10 @@ 'changepassword-success' = 'Used in [[Special:ChangePassword]].', 'resetpass_forbidden' = Used as error message in changing password. Maybe the external auth plugin won't allow local password changes., 'resetpass-no-info' = 'Error message for [[Special:ChangePassword]].', -'resetpass-submit-loggedin' = 'Button on [[Special:ResetPass]] to submit new password. +'resetpass-submit-loggedin' = 'Button on [[Special:ChangePassword]] to submit new password. {{Identical|Change password}}', -'resetpass-submit-cancel' = 'Used on [[Special:ResetPass]]. +'resetpass-submit-cancel' = 'Used on [[Special:ChangePassword]]. {{Identical|Cancel}}', 'resetpass-wrong-oldpass' = 'Error message shown on [[Special:ChangePassword]] when the old password is not valid.', 'resetpass-temp-password' = 'The label of the input box for the temporary password (received by email) on the form displayed after logging in with a temporary password.', @@ -2951,8 +2951,8 @@ 'prefs-edits' = 'In user preferences.', 'prefsnologintext2' = 'Parameters: * $1 - a link to [[Special:UserLogin]] with {{msg-mw|loginreqlink}} as link description', -'changepassword' = Section heading on [[Special:Preferences]], tab 'User profile'. -{{Identical|Change password}}, +'changepassword' = 'Title of [[Special:ChangePassword]]. +{{Identical|Change password}}', 'prefs-skin' = 'Used in user preferences. {{Identical|Skin}}', 'skin-preview' = '{{doc-actionlink}} @@ -2982,7 +2982,7 @@ 'prefs-watchlist-edits-max' = 'Shown as hint in [[Special:Preferences]], tab Watchlist', 'prefs-watchlist-token' = 'Used in [[Special:Preferences]], tab Watchlist.', 'prefs-misc' = 'Tab used on the [[Special:Preferences|user preferences]] special page.', -'prefs-resetpass' = 'Button on user data tab in user preferences. When you click the button you go to the special page [[Special:ResetPass]]. +'prefs-resetpass' = 'Button on user data tab in user preferences. When you click the button you go to the special page [[Special:ChangePassword]]. {{Identical|Change password}}', 'prefs-changeemail' = 'Link on [[Special:Preferences]] to [[Special:ChangeEmail]]. diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 36f80bd..eb0b4dd 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -571,7 +571,8 @@ 'user-mail-no-body', ), 'resetpass' = array( -
[MediaWiki-commits] [Gerrit] (bug 47135) Make row IDs use BIGINT. - change (mediawiki...Wikibase)
Daniel Kinzler has uploaded a new change for review. https://gerrit.wikimedia.org/r/99637 Change subject: (bug 47135) Make row IDs use BIGINT. .. (bug 47135) Make row IDs use BIGINT. Change-Id: Iffe0e72688ea5502f4465835408f0819425f6ee6 --- M repo/RELEASE-NOTES M repo/includes/store/sql/AddRowIDs.sql M repo/includes/store/sql/Wikibase.sql A repo/sql/MakeRowIDsBig.sql 4 files changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/37/99637/1 diff --git a/repo/RELEASE-NOTES b/repo/RELEASE-NOTES index ff1bc02..e75749d 100644 --- a/repo/RELEASE-NOTES +++ b/repo/RELEASE-NOTES @@ -11,6 +11,7 @@ takes different arguments then it did before. * WikibaseEntityInsertionUpdate hook was added * WikibaseEntityDeletionUpdate hook now gets an EntityContent rather than an EntityDeletionUpdate. +* The definition of the database fields wb_terms.term_row_id and wb_items_per_site.ips_row_id have been changed to BIGINT for MySQL, to avoid integer overflow on large sites. '''NOTE:''' the column definition is not automatically updated when running update.php. If you expect a large number (hundreds of million) of edits on your wiki, please apply repo/sql/MakeRowIDsBig.sql to your database manually. This is only needed for MySQL (and for PostGres, which however isn't fully supported at the moment). === Version 0.4 === (not released) diff --git a/repo/includes/store/sql/AddRowIDs.sql b/repo/includes/store/sql/AddRowIDs.sql index 24177f8..8f22805 100644 --- a/repo/includes/store/sql/AddRowIDs.sql +++ b/repo/includes/store/sql/AddRowIDs.sql @@ -2,8 +2,8 @@ ALTER TABLE /*_*/wb_items_per_site ADD ips_row_id -INTEGER PRIMARY KEY auto_increment FIRST; +BIGINT PRIMARY KEY auto_increment FIRST; ALTER TABLE /*_*/wb_terms ADD COLUMN term_row_id -INTEGER PRIMARY KEY auto_increment FIRST; +BIGINT PRIMARY KEY auto_increment FIRST; diff --git a/repo/includes/store/sql/Wikibase.sql b/repo/includes/store/sql/Wikibase.sql index 3a7ec19..82453c9 100644 --- a/repo/includes/store/sql/Wikibase.sql +++ b/repo/includes/store/sql/Wikibase.sql @@ -18,7 +18,7 @@ -- Derived storage. -- Links site+title pairs to item ids. CREATE TABLE IF NOT EXISTS /*_*/wb_items_per_site ( - ips_row_id INT unsignedNOT NULL PRIMARY KEY AUTO_INCREMENT, -- row ID + ips_row_id BIGINT unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, -- row ID ips_item_idINT unsignedNOT NULL, -- Id of the item ips_site_idVARBINARY(32) NOT NULL, -- Site identifier (global) ips_site_page VARCHAR(255)NOT NULL -- Title of the page @@ -32,7 +32,7 @@ -- Lookup table for entity terms (ie labels, aliases, descriptions). CREATE TABLE IF NOT EXISTS /*_*/wb_terms ( - term_row_idINT unsignedNOT NULL PRIMARY KEY AUTO_INCREMENT, -- row ID + term_row_idBIGINT unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, -- row ID term_entity_id INT unsignedNOT NULL, -- Id of the entity term_entity_type VARBINARY(32) NOT NULL, -- Type of the entity term_language VARBINARY(32) NOT NULL, -- Language code diff --git a/repo/sql/MakeRowIDsBig.sql b/repo/sql/MakeRowIDsBig.sql new file mode 100644 index 000..b19f0d1 --- /dev/null +++ b/repo/sql/MakeRowIDsBig.sql @@ -0,0 +1,7 @@ +-- Update row IDs to BIGINT, so we don't run out of bits. + +ALTER TABLE /*:*/wb_terms +MODIFY term_row_id BIGINT unsigned NOT NULL auto_increment; + +ALTER TABLE /*:*/wb_items_per_site +MODIFY ips_row_id BIGINT unsigned NOT NULL auto_increment; -- To view, visit https://gerrit.wikimedia.org/r/99637 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iffe0e72688ea5502f4465835408f0819425f6ee6 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] Move jquery.valueview.experts.commonsmediatype to mediawiki ... - change (mediawiki...DataValues)
jenkins-bot has submitted this change and it was merged. Change subject: Move jquery.valueview.experts.commonsmediatype to mediawiki resources, define dependency .. Move jquery.valueview.experts.commonsmediatype to mediawiki resources, define dependency On test.wikidata, it's not finding mediawiki.util.wikiUrlencode with resource loader. Works in debug mode. this expert 1) depends on mediawiki 2) try to explicitly define the dependency, even though mediawiki.util is always loaded... maybe just not in the correct order now. Change-Id: I93f1cb373aae1cbd4079916780223c0d5f446c05 (cherry picked from commit 9a4e22751650b2b27c1a0cd7695a96ad081788ab) --- M ValueView/ValueView.resources.mw.php M ValueView/ValueView.resources.php 2 files changed, 14 insertions(+), 13 deletions(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/ValueView/ValueView.resources.mw.php b/ValueView/ValueView.resources.mw.php index 472f641..0cf1aa1 100644 --- a/ValueView/ValueView.resources.mw.php +++ b/ValueView/ValueView.resources.mw.php @@ -37,6 +37,20 @@ ), ), + 'jquery.valueview.experts.commonsmediatype' = $moduleTemplate + array( + 'scripts' = array( + 'jquery.valueview/valueview.experts/experts.SuggestedStringValue.js', + 'jquery.valueview/valueview.experts/experts.CommonsMediaType.js', + ), + 'dependencies' = array( + 'jquery.valueview.experts.staticdom', + 'jquery.valueview.BifidExpert', + 'jquery.valueview.experts.stringvalue', + 'jquery.ui.suggester', + 'mediawiki.util' + ), + ), + // Dependencies required by jQuery.valueview library: 'jquery.PurposedCallbacks' = $moduleTemplate + array( 'scripts' = array( diff --git a/ValueView/ValueView.resources.php b/ValueView/ValueView.resources.php index 86a0a47..552e608 100644 --- a/ValueView/ValueView.resources.php +++ b/ValueView/ValueView.resources.php @@ -269,19 +269,6 @@ ), ), - 'jquery.valueview.experts.commonsmediatype' = $moduleTemplate + array( - 'scripts' = array( - 'jquery.valueview/valueview.experts/experts.SuggestedStringValue.js', - 'jquery.valueview/valueview.experts/experts.CommonsMediaType.js', - ), - 'dependencies' = array( - 'jquery.valueview.experts.staticdom', - 'jquery.valueview.BifidExpert', - 'jquery.valueview.experts.stringvalue', - 'jquery.ui.suggester', - ), - ), - 'jquery.valueview.experts.urltype' = $moduleTemplate + array( 'scripts' = array( 'jquery.valueview/valueview.experts/experts.UrlType.js', -- To view, visit https://gerrit.wikimedia.org/r/99636 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I93f1cb373aae1cbd4079916780223c0d5f446c05 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: mw1.23-wmf6 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove 3 unused movepage messages - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Remove 3 unused movepage messages .. Remove 3 unused movepage messages Follows-up r4134 (751a0a35f26b): * movedto Follows-up r24618 (877d2bac2f0b): * movenologin Follows-up r35213 (c75649cf5a10): * talkexists Change-Id: I1db90a202f3cb0d93cecd10f6e60874d5478e50a --- M languages/messages/MessagesEn.php M maintenance/language/messages.inc 2 files changed, 0 insertions(+), 7 deletions(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index f8912eb..fb157cb 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -3452,7 +3452,6 @@ In those cases, you will have to move or merge the page manually if desired., 'movearticle' = 'Move page:', 'moveuserpage-warning' = '''Warning:''' You are about to move a user page. Please note that only the page will be moved and the user will ''not'' be renamed., -'movenologin' = 'Not logged in', 'movenologintext' = 'You must be a registered user and [[Special:UserLogin|logged in]] to move a page.', 'movenotallowed' = 'You do not have permission to move pages.', 'movenotallowedfile' = 'You do not have permission to move files.', @@ -3468,9 +3467,6 @@ 'articleexists'= 'A page of that name already exists, or the name you have chosen is not valid. Please choose another name.', 'cantmove-titleprotected' = 'You cannot move a page to this location because the new title has been protected from creation', -'talkexists' = '''The page itself was moved successfully, but the talk page could not be moved because one already exists at the new title. -Please merge them manually.''', -'movedto' = 'moved to', 'movetalk' = 'Move associated talk page', 'move-subpages'= 'Move subpages (up to $1)', 'move-talk-subpages' = 'Move subpages of talk page (up to $1)', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 36f80bd..7479cb6 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2389,7 +2389,6 @@ 'movepagetalktext', 'movearticle', 'moveuserpage-warning', - 'movenologin', 'movenologintext', 'movenotallowed', 'movenotallowedfile', @@ -2404,8 +2403,6 @@ 'movepage-moved-noredirect', 'articleexists', 'cantmove-titleprotected', - 'talkexists', - 'movedto', 'movetalk', 'move-subpages', 'move-talk-subpages', -- To view, visit https://gerrit.wikimedia.org/r/99620 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1db90a202f3cb0d93cecd10f6e60874d5478e50a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: PleaseStand pleasest...@live.com Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Parent5446 tylerro...@gmail.com 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] Update DataValues, fix js error on test.wikidata - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/99638 Change subject: Update DataValues, fix js error on test.wikidata .. Update DataValues, fix js error on test.wikidata see I93f1cb3 for details Change-Id: Ib0084a05616f5d46d4b0ee60ddbcb6c5d9cf0e80 --- M extensions/DataValues 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/38/99638/1 diff --git a/extensions/DataValues b/extensions/DataValues index cf50ddc..1919d65 16 --- a/extensions/DataValues +++ b/extensions/DataValues -Subproject commit cf50ddc5bd944ec61fc354b3fddc423313627026 +Subproject commit 1919d6564687b3475a4b0c63a89046a978c6e293 -- To view, visit https://gerrit.wikimedia.org/r/99638 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib0084a05616f5d46d4b0ee60ddbcb6c5d9cf0e80 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf6 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] Browsertests: wait for entity to load after page-reload - change (mediawiki...Wikibase)
Tobias Gritschacher has uploaded a new change for review. https://gerrit.wikimedia.org/r/99639 Change subject: Browsertests: wait for entity to load after page-reload .. Browsertests: wait for entity to load after page-reload Change-Id: I3af1c0819c2c7049338655a914e8609d5fa4ae78 --- M selenium_cuc/features/step_definitions/entity_steps.rb 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/39/99639/1 diff --git a/selenium_cuc/features/step_definitions/entity_steps.rb b/selenium_cuc/features/step_definitions/entity_steps.rb index 0827acd..2cdba7f 100644 --- a/selenium_cuc/features/step_definitions/entity_steps.rb +++ b/selenium_cuc/features/step_definitions/entity_steps.rb @@ -52,4 +52,5 @@ When /^I reload the page$/ do @browser.refresh + on(ItemPage).wait_for_entity_to_load end -- To view, visit https://gerrit.wikimedia.org/r/99639 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3af1c0819c2c7049338655a914e8609d5fa4ae78 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] Don't assume test user has ID 1 in SpecialPageTest - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/99640 Change subject: Don't assume test user has ID 1 in SpecialPageTest .. Don't assume test user has ID 1 in SpecialPageTest SpecialPageTest seems to assume the first database user has ID number 1. In case of the current PostgreSQL test setup it does not have to be the case. This query: Query pgtest01 (101) (slave): SELECT /* User::loadFromDatabase 127.0.0.1 */ user_id /* more fields */ FROM unittest_mwuser WHERE user_id = '1' LIMIT 1 fails, because UTSysop has been added by the test setup before with some other ID: Query pgtest01 (65) (slave): INSERT /* User::addToDatabase 127.0.0.1 */ INTO unittest _mwuser (user_id,user_name /* more fields */ VALUES ('322','UTSysop' /* more values */ Change-Id: I7b0a6a9001765111669051d57e675e588b71ba17 --- M tests/phpunit/includes/SpecialPageTest.php 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/40/99640/1 diff --git a/tests/phpunit/includes/SpecialPageTest.php b/tests/phpunit/includes/SpecialPageTest.php index 65057a5..0ee335a 100644 --- a/tests/phpunit/includes/SpecialPageTest.php +++ b/tests/phpunit/includes/SpecialPageTest.php @@ -102,8 +102,7 @@ public function testRequireLoginNotAnon() { $specialPage = new SpecialPage( 'Watchlist', 'viewmywatchlist' ); - $user = User::newFromId( 0 ); - $user-setId( 1 ); + $user = User::newFromName( UTSysop ); $specialPage-getContext()-setUser( $user ); $specialPage-requireLogin(); -- To view, visit https://gerrit.wikimedia.org/r/99640 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7b0a6a9001765111669051d57e675e588b71ba17 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add a LanguageAng.php file for Old English projects - change (mediawiki/core)
Odder has uploaded a new change for review. https://gerrit.wikimedia.org/r/99641 Change subject: Add a LanguageAng.php file for Old English projects .. Add a LanguageAng.php file for Old English projects This commit adds a LanguageAng.php file so that the {{GRAMMAR:}} parser function can be used on Old English projects to produce correct forms of words; in this case, to enable the usage of {{SITENAME}} in various grammatical forms for Old English Wikipedia and Wiktionary projects. The file has been created by PiRSquared17, who has kindly attached it as a patch to bug 56634; I'm only submitting it to Gerrit. Bug: 56634 Change-Id: If93797ff6832e4ba66a806f2479055a3fcec63ce --- A languages/classes/LanguageAng.php 1 file changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/41/99641/1 diff --git a/languages/classes/LanguageAng.php b/languages/classes/LanguageAng.php new file mode 100644 index 000..18dc6c8 --- /dev/null +++ b/languages/classes/LanguageAng.php @@ -0,0 +1,27 @@ +?php + +/** Old English (Ænglisc) + * + * @ingroup Language + */ +class LanguageAng extends Language { + # Convert from the nominative form of a noun to some other case + # Invoked with {{GRAMMAR:case|word}} + /** +* Cases: nemniendlīc (nom), wrēgendlīc (acc), forgifendlīc (dat), geāgniendlīc (gen), tōllīc (ins) +* +* @param $word string +* @param $case string +* +* @return string +*/ + function convertGrammar( $word, $case ) { + global $wgGrammarForms; + if ( isset( $wgGrammarForms['ang'][$case][$word] ) ) { + return $wgGrammarForms['ang'][$case][$word]; + } + + return $word; # this will return the original value for all words without set grammar forms + } + +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/99641 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If93797ff6832e4ba66a806f2479055a3fcec63ce Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Odder tom...@twkozlowski.net ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add an interface module to the WikidataQuery API, along with... - change (pywikibot/core)
Inductiveload has uploaded a new change for review. https://gerrit.wikimedia.org/r/99642 Change subject: Add an interface module to the WikidataQuery API, along with ways to generate the queries programmatically. Tests included. .. Add an interface module to the WikidataQuery API, along with ways to generate the queries programmatically. Tests included. Change-Id: Id1dd2c48c65b9bfb877ec10ad1b8ea69aa00a39c --- A pywikibot/data/query.py A tests/wikidataquery_tests.py 2 files changed, 670 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/42/99642/1 diff --git a/pywikibot/data/query.py b/pywikibot/data/query.py new file mode 100644 index 000..8cb4bbc --- /dev/null +++ b/pywikibot/data/query.py @@ -0,0 +1,467 @@ +# -*- coding: utf-8 -*- + +Objects representing WikidataQuery query syntax and API + +# +# (C) Pywikipedia bot team, 2013 +# +# Distributed under the terms of the MIT license. + +import json +import urllib2 +import pickle +import os +import sha +import time +import tempfile + + +def listify(x): + +If given a non-list , encapsulate in a single-element list + +return x if isinstance(x, list) else [x] + + +class QuerySet(): + +A QuerySet represents a set of queries or other query sets, joined +by operators (AND and OR). + +A QuerySet stores this information as a list of Query(Sets) and +a joiner operator to join them all together + + +def __init__(self, q): + +Initialise a query set from a Query or another QuerySet + +self.qs = [q] + +def addJoiner(self, args, joiner): + +Add to this QuerySet using the given joiner. + +@return a new query set representing the joining of this one and +the arguments + + +'''If the given joiner is not the same as we used before in +this QuerySet, nest the current one in parens before joining +- this makes the implicit grouping of the +API explicit.''' +if len(self.qs) 1 and joiner != self.joiner: +left = QuerySet(self) +else: +left = self + +left.joiner = joiner + +for a in listify(args): +left.qs.append(a) + +return left + +def AND(self, args): + +Add the given args (Queries or QuerySets) to the Query set as a +logical conjuction (AND) + +return self.addJoiner(args, AND) + +def OR(self, args): + +Add the given args (Queries or QuerySets) to the Query set as a +logical disjunction (AND) + +return self.addJoiner(args, OR) + +def __str__(self): + +Output as an API-ready string + + +def bracketIfQuerySet(q): +if isinstance(q, QuerySet) and q.joiner != self.joiner: +return (%s) % q +else: +return str(q) + +s = bracketIfQuerySet(self.qs[0]) + +for q in self.qs[1:]: +s += %s %s % (self.joiner, bracketIfQuerySet(q)) + +return s + + +class Query(): + +A query is a single query for the WikidataQuery API, for example +claim[100:60] or link[enwiki] + +Construction of a Query can throw a TypeError if you feed it bad +parameters. Exactly what these need to be depends on the Query + + +def AND(self, ands): + +Produce a query set ANDing this query and all the given query/sets + +return QuerySet(self).addJoiner(ands, AND); + +def OR(self, ors): + +Produce a query set ORing this query and all the given query/sets + +return QuerySet(self).addJoiner(ors, OR); + +def formatItem(self, item): + +Default item formatting is string, which will work for queries, +querysets, ints and strings + +return str(item) + +def formatList(self, l): + +Format and comma-join a list + +return ,.join([self.formatItem(x) for x in l]) + +@staticmethod +def isOrContainsOnlyTypes(items, types): + +Either this item is one of the given types, or it is a list of +only those types + +if isinstance(items, list): +for x in items: +found = False +for typ in listify(types): +if isinstance(x, typ): +found = True +break + +if not found: +return False +else: +for typ in listify(types): +found = False +if isinstance(items, typ): +found = True +break + + +if not found: +return False + +return True + +def validateOrRaise(self): +if not self.validate(): +
[MediaWiki-commits] [Gerrit] Change the second return of ckb from fa to en - change (pywikibot/compat)
jenkins-bot has submitted this change and it was merged. Change subject: Change the second return of ckb from fa to en .. Change the second return of ckb from fa to en I've received an e-mail from a prominent contributor of ckb projects complaining about the return and he said ckb contributors are divided to Iranian Kurds and Iraqi Kurds which Iraqi Kurds don't understand Persian and Iranian Kurds don't understand Arabic, even Iraqi Kurds can't understand Arabic well so as he said English is best return Change-Id: I8964c1a089ced42e0041619910f82da168553baf --- M pywikibot/i18n.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Calak: Looks good to me, but someone else must approve Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 731bece..93b2518 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -175,7 +175,7 @@ if code == 'gag': return ['tr'] if code == 'ckb': -return ['ku', 'fa'] +return ['ku'] #Ukrainian if code in ['crh', 'rue']: return ['uk', 'ru'] -- To view, visit https://gerrit.wikimedia.org/r/99630 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8964c1a089ced42e0041619910f82da168553baf Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Calak calakw...@yahoo.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Xqt i...@gno.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] [SYNC] Remove fallback code 'fa' for ckb - change (pywikibot/core)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/99643 Change subject: [SYNC] Remove fallback code 'fa' for ckb .. [SYNC] Remove fallback code 'fa' for ckb Synchronized with compat Change-Id: I2db1a7d4cea81c849107fd2b87271b76ffd7f0bc --- M pywikibot/i18n.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/43/99643/1 diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 92d3eb1..8e818eb 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -177,7 +177,7 @@ if code == 'gag': return ['tr'] if code == 'ckb': -return ['ku', 'fa'] +return ['ku'] #Ukrainian if code in ['crh', 'rue']: return ['uk', 'ru'] -- To view, visit https://gerrit.wikimedia.org/r/99643 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2db1a7d4cea81c849107fd2b87271b76ffd7f0bc Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt i...@gno.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [SYNC] Remove fallback code 'fa' for ckb - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [SYNC] Remove fallback code 'fa' for ckb .. [SYNC] Remove fallback code 'fa' for ckb Synchronized with compat Change-Id: I2db1a7d4cea81c849107fd2b87271b76ffd7f0bc --- M pywikibot/i18n.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 92d3eb1..8e818eb 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -177,7 +177,7 @@ if code == 'gag': return ['tr'] if code == 'ckb': -return ['ku', 'fa'] +return ['ku'] #Ukrainian if code in ['crh', 'rue']: return ['uk', 'ru'] -- To view, visit https://gerrit.wikimedia.org/r/99643 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2db1a7d4cea81c849107fd2b87271b76ffd7f0bc Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt i...@gno.de Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Xqt i...@gno.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use setting for property info table cache key - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/99644 Change subject: Use setting for property info table cache key .. Use setting for property info table cache key Change-Id: Ie2948759ee811f1a02f93d8bfbd6f341c4f309db --- M client/includes/store/sql/DirectSqlStore.php 1 file changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/44/99644/1 diff --git a/client/includes/store/sql/DirectSqlStore.php b/client/includes/store/sql/DirectSqlStore.php index 71719d1..d1e7aeb 100644 --- a/client/includes/store/sql/DirectSqlStore.php +++ b/client/includes/store/sql/DirectSqlStore.php @@ -327,10 +327,7 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( true, $this-repoWiki ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = $this-repoWiki . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; + $key = $this-cachePrefix . '/Wikibase/CachingPropertyInfoStore'; return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); } else { // dummy info store -- To view, visit https://gerrit.wikimedia.org/r/99644 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2948759ee811f1a02f93d8bfbd6f341c4f309db Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf5 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] Use setting for property info table cache key - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/99645 Change subject: Use setting for property info table cache key .. Use setting for property info table cache key Change-Id: Ie2948759ee811f1a02f93d8bfbd6f341c4f309db --- M client/includes/store/sql/DirectSqlStore.php M repo/includes/store/sql/SqlStore.php 2 files changed, 2 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/45/99645/1 diff --git a/client/includes/store/sql/DirectSqlStore.php b/client/includes/store/sql/DirectSqlStore.php index 71719d1..7a581e5 100644 --- a/client/includes/store/sql/DirectSqlStore.php +++ b/client/includes/store/sql/DirectSqlStore.php @@ -327,10 +327,7 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( true, $this-repoWiki ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = $this-repoWiki . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; + $key = $this-cachePrefix . ':CachingPropertyInfoStore'; return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); } else { // dummy info store diff --git a/repo/includes/store/sql/SqlStore.php b/repo/includes/store/sql/SqlStore.php index b86035e..6c204e5 100644 --- a/repo/includes/store/sql/SqlStore.php +++ b/repo/includes/store/sql/SqlStore.php @@ -382,10 +382,7 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( false ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = wfWikiID() . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; + $key = $this-cachePrefix . ':CachingPropertyInfoStore'; return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); } else { // dummy info store -- To view, visit https://gerrit.wikimedia.org/r/99645 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2948759ee811f1a02f93d8bfbd6f341c4f309db 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] Use setting for property info table cache key - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/99647 Change subject: Use setting for property info table cache key .. Use setting for property info table cache key This allows the cache key to change with each deployment and whatnot. Change-Id: I53908d3626d245236f9c82cf4c81993f02cdef5e --- M client/includes/store/sql/DirectSqlStore.php M repo/includes/store/sql/SqlStore.php 2 files changed, 6 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/47/99647/1 diff --git a/client/includes/store/sql/DirectSqlStore.php b/client/includes/store/sql/DirectSqlStore.php index 71719d1..2231584 100644 --- a/client/includes/store/sql/DirectSqlStore.php +++ b/client/includes/store/sql/DirectSqlStore.php @@ -327,11 +327,9 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( true, $this-repoWiki ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = $this-repoWiki . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; - return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); + $key = $this-cachePrefix . ':CachingPropertyInfoStore'; + return new CachingPropertyInfoStore( $table, ObjectCache::getInstance( $this-cacheType ), + $this-cacheDuration, $key ); } else { // dummy info store return new DummyPropertyInfoStore(); diff --git a/repo/includes/store/sql/SqlStore.php b/repo/includes/store/sql/SqlStore.php index b86035e..bdafa69 100644 --- a/repo/includes/store/sql/SqlStore.php +++ b/repo/includes/store/sql/SqlStore.php @@ -382,11 +382,9 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( false ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = wfWikiID() . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; - return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); + $key = $this-cachePrefix . ':CachingPropertyInfoStore'; + return new CachingPropertyInfoStore( $table, ObjectCache::getInstance( $this-cacheType ), + $this-cacheDuration, $key ); } else { // dummy info store return new DummyPropertyInfoStore(); -- To view, visit https://gerrit.wikimedia.org/r/99647 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53908d3626d245236f9c82cf4c81993f02cdef5e 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] wfWarn() should NOT cause unit tests to fail - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/99648 Change subject: wfWarn() should NOT cause unit tests to fail .. wfWarn() should NOT cause unit tests to fail wfWarn is used in Database::rollback so whenever something goes wrong with no transaction open (easy in PostgreSQL) we get a useless No transaction to rollback, something got out of sync message instead of the real problem. This brings $wgDevelopmentWarnings back to its default false. This reverts commit 4b291909e0e91ad4e8ed98030c1312a872ca3bd4. Conflicts: tests/phpunit/phpunit.php Bug: 58095 Change-Id: I4ba7dac6e45db157ff1ca8807c5fd3f35a3b59f5 --- M tests/phpunit/phpunit.php 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/48/99648/1 diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 401b8a8..319b424 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -31,13 +31,9 @@ global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType; global $wgLanguageConverterCacheType, $wgUseDatabaseMessages; global $wgLocaltimezone, $wgLocalisationCacheConf; - global $wgDevelopmentWarnings; // Inject test autoloader require_once __DIR__ . '/../TestsAutoLoader.php'; - - // wfWarn should cause tests to fail - $wgDevelopmentWarnings = true; $wgMainCacheType = CACHE_NONE; $wgMessageCacheType = CACHE_NONE; -- To view, visit https://gerrit.wikimedia.org/r/99648 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ba7dac6e45db157ff1ca8807c5fd3f35a3b59f5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use hooks instead of $wgOut when $wgCategoryTreeForceHeaders... - change (mediawiki...CategoryTree)
Gerrit Patch Uploader has uploaded a new change for review. https://gerrit.wikimedia.org/r/99649 Change subject: Use hooks instead of $wgOut when $wgCategoryTreeForceHeaders is set .. Use hooks instead of $wgOut when $wgCategoryTreeForceHeaders is set Previously, $wgOut was used when $wgCategoryTreeForceHeaders was set and a hook was used when it was not. This change makes sure the hook is always used and in the hook is checked whether the headers should be sent or not. With this change, pages created with the rebuildFileCache.php maintenance script also have CategoryTree headers when $wgCategoryTreeForceHeaders is set (which is always the case when the CategoryTree sidebar is in use). Other uses of $wgOut in the CategoryTree extension seem to be less of an issue because when there is a CategoryTree on a page, those pages seem to be excluded from caching. This is a (partial?) fix for bug #57651. Change-Id: I0ee66d38755e255c5597db7a237a176039025fae --- M CategoryTree.php A CategoryTree.php.orig 2 files changed, 453 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CategoryTree refs/changes/49/99649/1 diff --git a/CategoryTree.php b/CategoryTree.php index 5d0bbdf..24c1025 100644 --- a/CategoryTree.php +++ b/CategoryTree.php @@ -209,11 +209,7 @@ $wgCategoryTreeCategoryPageOptions['mode'] = ( $mode = $wgRequest-getVal( 'mode' ) ) ? CategoryTree::decodeMode( $mode ) : $wgCategoryTreeCategoryPageMode; } - if ( $wgCategoryTreeForceHeaders ) { - CategoryTree::setHeaders( $wgOut ); - } else { - $wgHooks['OutputPageParserOutput'][] = 'efCategoryTreeParserOutput'; - } + $wgHooks['OutputPageParserOutput'][] = 'efCategoryTreeParserOutput'; $wgHooks['MakeGlobalVariablesScript'][] = 'efCategoryTreeGetConfigVars'; } @@ -383,7 +379,8 @@ * @return bool */ function efCategoryTreeParserOutput( $outputPage, $parserOutput ) { - if ( !empty( $parserOutput-mCategoryTreeTag ) ) { + global $wgCategoryTreeForceHeaders; + if ( $wgCategoryTreeForceHeaders || !empty( $parserOutput-mCategoryTreeTag ) ) { CategoryTree::setHeaders( $outputPage ); } return true; diff --git a/CategoryTree.php.orig b/CategoryTree.php.orig new file mode 100644 index 000..5d0bbdf --- /dev/null +++ b/CategoryTree.php.orig @@ -0,0 +1,450 @@ +?php +/** + * Setup and Hooks for the CategoryTree extension, an AJAX based gadget + * to display the category structure of a wiki + * + * @file + * @ingroup Extensions + * @author Daniel Kinzler, brightbyte.de + * @copyright © 2006-2008 Daniel Kinzler and others + * @license GNU General Public Licence 2.0 or later + */ + +if ( !defined( 'MEDIAWIKI' ) ) { + echo( This file is an extension to the MediaWiki software and cannot be used standalone.\n ); + die( 1 ); +} + +/** +* Constants for use with the mode, +* defining what should be shown in the tree +*/ +define( 'CT_MODE_CATEGORIES', 0 ); +define( 'CT_MODE_PAGES', 10 ); +define( 'CT_MODE_ALL', 20 ); +define( 'CT_MODE_PARENTS', 100 ); + +/** +* Constants for use with the hideprefix option, +* defining when the namespace prefix should be hidden +*/ +define( 'CT_HIDEPREFIX_NEVER', 0 ); +define( 'CT_HIDEPREFIX_ALWAYS', 10 ); +define( 'CT_HIDEPREFIX_CATEGORIES', 20 ); +define( 'CT_HIDEPREFIX_AUTO', 30 ); + +/** + * Options: + * + * $wgCategoryTreeMaxChildren - maximum number of children shown in a tree node. Default is 200 + * $wgCategoryTreeAllowTag - enable categorytree tag. Default is true. + * $wgCategoryTreeDynamicTag - loads the first level of the tree in a categorytag dynamically. + * This way, the cache does not need to be disabled. Default is false. + * $wgCategoryTreeDisableCache - disabled the parser cache for pages with a categorytree tag. Default is true. + * $wgCategoryTreeUseCache - enable HTTP cache for anon users. Default is false. + * $wgCategoryTreeMaxDepth - maximum value for depth argument; An array that maps mode values to + * the maximum depth acceptable for the depth option. + * Per default, the categories mode has a max depth of 2, + * all other modes have a max depth of 1. + * $wgCategoryTreeDefaultOptions - default options for the categorytree tag. + * $wgCategoryTreeCategoryPageOptions - options to apply on category pages. + * $wgCategoryTreeSpecialPageOptions - options to apply on Special:CategoryTree. + */ + +$wgCategoryTreeMaxChildren = 200; +$wgCategoryTreeAllowTag = true; +$wgCategoryTreeDisableCache = true; +$wgCategoryTreeDynamicTag = false; +$wgCategoryTreeHTTPCache = false; +# $wgCategoryTreeUnifiedView = true; +$wgCategoryTreeMaxDepth = array( CT_MODE_PAGES = 1, CT_MODE_ALL = 1, CT_MODE_CATEGORIES = 2 ); + +# Set
[MediaWiki-commits] [Gerrit] Remove mergeExpected and assertResultRecursive - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Remove mergeExpected and assertResultRecursive .. Remove mergeExpected and assertResultRecursive These ApiQueryBasicTest methods are no longer used and we have a better alternatives in the parent ApiQueryTestBase. Change-Id: I7a81ad3dd6e880be151c1901037bab4018493bcf --- M tests/phpunit/includes/api/query/ApiQueryBasicTest.php 1 file changed, 0 insertions(+), 48 deletions(-) Approvals: Anomie: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/includes/api/query/ApiQueryBasicTest.php b/tests/phpunit/includes/api/query/ApiQueryBasicTest.php index 9c5b3ca..e486c4f 100644 --- a/tests/phpunit/includes/api/query/ApiQueryBasicTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryBasicTest.php @@ -350,52 +350,4 @@ ) ) ); } - - /** -* Recursively merges the expected values in the $item into the $all -*/ - private function mergeExpected( $all, $item ) { - foreach ( $item as $k = $v ) { - if ( array_key_exists( $k, $all ) ) { - if ( is_array( $all[$k] ) ) { - $this-mergeExpected( $all[$k], $v ); - } else { - $this-assertEquals( $all[$k], $v ); - } - } else { - $all[$k] = $v; - } - } - } - - /** -* Recursively compare arrays, ignoring mismatches in numeric key and pageids. -* -* @param $expectedArray array expected values -* @param $resultArray array returned values -*/ - private function assertQueryResults( $expectedArray, $resultArray ) { - reset( $expectedArray ); - reset( $resultArray ); - while ( true ) { - $expectedValue = each( $expectedArray ); - $resultValue = each( $resultArray ); - // If either of the arrays is shorter, abort. If both are done, success. - $this-assertEquals( (bool)$expectedValue, (bool)$resultValue ); - if ( !$expectedValue ) { - break; // done - } - // continue only if keys are identical or both keys are numeric - $this-assertTrue( $expectedValue['key'] === $resultValue['key'] || ( is_numeric( $expectedValue['key'] ) is_numeric( $resultValue['key'] ) ) ); - // don't compare pageids - if ( $expectedValue['key'] !== 'pageid' ) { - // If values are arrays, compare recursively, otherwise compare with === - if ( is_array( $expectedValue['value'] ) is_array( $resultValue['value'] ) ) { - $this-assertQueryResults( $expectedValue['value'], $resultValue['value'] ); - } else { - $this-assertEquals( $expectedValue['value'], $resultValue['value'] ); - } - } - } - } } -- To view, visit https://gerrit.wikimedia.org/r/99340 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a81ad3dd6e880be151c1901037bab4018493bcf Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Anomie bjor...@wikimedia.org Gerrit-Reviewer: jenkins-bot Gerrit-Reviewer: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use setting for property info table cache key - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Use setting for property info table cache key .. Use setting for property info table cache key This allows the cache key to change with each deployment and whatnot. Change-Id: I53908d3626d245236f9c82cf4c81993f02cdef5e --- M client/includes/store/sql/DirectSqlStore.php M repo/includes/store/sql/SqlStore.php 2 files changed, 7 insertions(+), 10 deletions(-) Approvals: Daniel Kinzler: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/store/sql/DirectSqlStore.php b/client/includes/store/sql/DirectSqlStore.php index 71719d1..2231584 100644 --- a/client/includes/store/sql/DirectSqlStore.php +++ b/client/includes/store/sql/DirectSqlStore.php @@ -327,11 +327,9 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( true, $this-repoWiki ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = $this-repoWiki . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; - return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); + $key = $this-cachePrefix . ':CachingPropertyInfoStore'; + return new CachingPropertyInfoStore( $table, ObjectCache::getInstance( $this-cacheType ), + $this-cacheDuration, $key ); } else { // dummy info store return new DummyPropertyInfoStore(); diff --git a/repo/includes/store/sql/SqlStore.php b/repo/includes/store/sql/SqlStore.php index b86035e..08238f2 100644 --- a/repo/includes/store/sql/SqlStore.php +++ b/repo/includes/store/sql/SqlStore.php @@ -3,6 +3,7 @@ namespace Wikibase; use DBQueryError; +use ObjectCache; use Wikibase\DataModel\Entity\BasicEntityIdParser; use Wikibase\Repo\WikibaseRepo; @@ -382,11 +383,9 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( false ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = wfWikiID() . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; - return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); + $key = $this-cachePrefix . ':CachingPropertyInfoStore'; + return new CachingPropertyInfoStore( $table, ObjectCache::getInstance( $this-cacheType ), + $this-cacheDuration, $key ); } else { // dummy info store return new DummyPropertyInfoStore(); -- To view, visit https://gerrit.wikimedia.org/r/99647 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53908d3626d245236f9c82cf4c81993f02cdef5e Gerrit-PatchSet: 2 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: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix order of parameters for PropertyLabelNotResolvedException - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/99651 Change subject: Fix order of parameters for PropertyLabelNotResolvedException .. Fix order of parameters for PropertyLabelNotResolvedException Change-Id: Id60a046abeb12ff1ad2fefcf761d370e0cf662c0 --- M client/includes/parserhooks/PropertyParserFunctionRenderer.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/51/99651/1 diff --git a/client/includes/parserhooks/PropertyParserFunctionRenderer.php b/client/includes/parserhooks/PropertyParserFunctionRenderer.php index 7ca7647..6e5b371 100644 --- a/client/includes/parserhooks/PropertyParserFunctionRenderer.php +++ b/client/includes/parserhooks/PropertyParserFunctionRenderer.php @@ -104,7 +104,7 @@ $propertyIds = $this-propertyLabelResolver-getPropertyIdsForLabels( array( $string ) ); if ( $propertyIds === null || empty( $propertyIds ) ) { - throw new PropertyLabelNotResolvedException( $this-language-getCode(), $string ); + throw new PropertyLabelNotResolvedException( $string, $this-language-getCode() ); } $propertyId = $propertyIds[$string]; -- To view, visit https://gerrit.wikimedia.org/r/99651 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id60a046abeb12ff1ad2fefcf761d370e0cf662c0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf5 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] Use setting for property info table cache key - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Use setting for property info table cache key .. Use setting for property info table cache key This allows the cache key to change with each deployment and whatnot. Change-Id: I53908d3626d245236f9c82cf4c81993f02cdef5e (cherry picked from commit e5121321d52fda6bf8ec115592bcab6e2e649229) --- M client/includes/store/sql/DirectSqlStore.php M repo/includes/store/sql/SqlStore.php 2 files changed, 7 insertions(+), 10 deletions(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/store/sql/DirectSqlStore.php b/client/includes/store/sql/DirectSqlStore.php index 71719d1..2231584 100644 --- a/client/includes/store/sql/DirectSqlStore.php +++ b/client/includes/store/sql/DirectSqlStore.php @@ -327,11 +327,9 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( true, $this-repoWiki ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = $this-repoWiki . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; - return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); + $key = $this-cachePrefix . ':CachingPropertyInfoStore'; + return new CachingPropertyInfoStore( $table, ObjectCache::getInstance( $this-cacheType ), + $this-cacheDuration, $key ); } else { // dummy info store return new DummyPropertyInfoStore(); diff --git a/repo/includes/store/sql/SqlStore.php b/repo/includes/store/sql/SqlStore.php index b86035e..08238f2 100644 --- a/repo/includes/store/sql/SqlStore.php +++ b/repo/includes/store/sql/SqlStore.php @@ -3,6 +3,7 @@ namespace Wikibase; use DBQueryError; +use ObjectCache; use Wikibase\DataModel\Entity\BasicEntityIdParser; use Wikibase\Repo\WikibaseRepo; @@ -382,11 +383,9 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( false ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = wfWikiID() . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; - return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); + $key = $this-cachePrefix . ':CachingPropertyInfoStore'; + return new CachingPropertyInfoStore( $table, ObjectCache::getInstance( $this-cacheType ), + $this-cacheDuration, $key ); } else { // dummy info store return new DummyPropertyInfoStore(); -- To view, visit https://gerrit.wikimedia.org/r/99650 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53908d3626d245236f9c82cf4c81993f02cdef5e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf6 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert turn off logging for parsoid for now, was filling / - change (operations/puppet)
Faidon Liambotis has submitted this change and it was merged. Change subject: Revert turn off logging for parsoid for now, was filling / .. Revert turn off logging for parsoid for now, was filling / Bug 57707 is now fixed, so logging can be re-enabled. We plan to tackle upstart / rotation in the next 1-2 weeks. This reverts commit c1cf83121d376016632bc6b4fcf0b4a5e1dc8a92. Change-Id: Ic97ad8bafedbe767f895b9c406dd9f2a9942ee5d --- M files/misc/parsoid 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Faidon Liambotis: Looks good to me, approved jenkins-bot: Verified diff --git a/files/misc/parsoid b/files/misc/parsoid index d8ac5c1..0e0b2e3 100644 --- a/files/misc/parsoid +++ b/files/misc/parsoid @@ -10,7 +10,7 @@ ( cd /var/lib/parsoid/Parsoid/js/lib export NODE_PATH=/var/lib/parsoid/Parsoid/js/lib/node_modules - sudo -E -u parsoid nohup node /var/lib/parsoid/Parsoid/js/api/server.js /dev/null 21 + sudo -E -u parsoid nohup node /var/lib/parsoid/Parsoid/js/api/server.js /var/lib/parsoid/nohup.out 21 PARSOIDPID=$! echo $PARSOIDPID /var/run/parsoid.pid wait $PARSOIDPID -- To view, visit https://gerrit.wikimedia.org/r/99251 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic97ad8bafedbe767f895b9c406dd9f2a9942ee5d Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: GWicke gwi...@wikimedia.org Gerrit-Reviewer: ArielGlenn ar...@wikimedia.org Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Faidon Liambotis fai...@wikimedia.org Gerrit-Reviewer: GWicke gwi...@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] varnish: automatically pull Zero proxies from meta - change (operations/puppet)
Faidon Liambotis has submitted this change and it was merged. Change subject: varnish: automatically pull Zero proxies from meta .. varnish: automatically pull Zero proxies from meta Change-Id: I9f1932e3fc7fffaf14802e69cddc2b93fe8f08c0 --- M manifests/role/cache.pp 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Faidon Liambotis: Verified; Looks good to me, approved diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp index a086d85..1c9a39b 100644 --- a/manifests/role/cache.pp +++ b/manifests/role/cache.pp @@ -1031,6 +1031,10 @@ 'zero.json': url = 'http://meta.wikimedia.org/w/api.php?action=zeroconfigtype=ips'; } + varnish::netmapper_update { + 'proxies.json': url = 'http://meta.wikimedia.org/w/api.php?action=zeroconfigtype=proxies'; + } + varnish::instance { mobile-backend: name = , vcl = mobile-backend, -- To view, visit https://gerrit.wikimedia.org/r/97004 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9f1932e3fc7fffaf14802e69cddc2b93fe8f08c0 Gerrit-PatchSet: 5 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dr0ptp4kt ab...@wikimedia.org Gerrit-Reviewer: BBlack bbl...@wikimedia.org Gerrit-Reviewer: Dfoy d...@wikimedia.org Gerrit-Reviewer: Faidon Liambotis fai...@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] Move init of $noFollow outside of if - change (mediawiki/core)
leucosticte has uploaded a new change for review. https://gerrit.wikimedia.org/r/99654 Change subject: Move init of $noFollow outside of if .. Move init of $noFollow outside of if Bug: 58044 Change-Id: I5655a0dc64055f3ec5d0a287aa8e0c85c11d3a1f --- M includes/installer/LocalSettingsGenerator.php 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/54/99654/1 diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 2433fbd..515cedb 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -210,6 +210,7 @@ } $groupRights = ''; + $noFollow = ''; if ( $this-groupPermissions ) { $groupRights .= # The following permissions were set based on your choice in the installer\n; foreach ( $this-groupPermissions as $group = $rightArr ) { @@ -220,11 +221,10 @@ wfBoolToStr( $perm ) . ;\n; } } - $noFollow = ''; if ( $this-groupPermissions['*']['edit'] === false $this-groupPermissions['*']['createaccount'] === false $this-groupPermissions['*']['read'] !== false ) { - $noFollow = # Set \$wgNoFollowLinks to true if you open up your wiki to editing by\n + $noFollow = \n# Set \$wgNoFollowLinks to true if you open up your wiki to editing by\n . # the general public and wish to apply nofollow to external links as a\n . # deterrent to spammers. Nofollow is not a comprehensive anti-spam solution\n . # and open wikis will generally require other anti-spam measures; for more\n @@ -364,7 +364,6 @@ # Path to the GNU diff3 utility. Used for conflict resolution. \$wgDiff3 = \{$this-values['wgDiff3']}\; -{$groupRights} -{$noFollow}; +{$groupRights}{$noFollow}; } } -- To view, visit https://gerrit.wikimedia.org/r/99654 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5655a0dc64055f3ec5d0a287aa8e0c85c11d3a1f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: leucosticte nathanlarson3...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use setting for property info table cache key - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Use setting for property info table cache key .. Use setting for property info table cache key This allows the cache key to change with each deployment and whatnot. Change-Id: Ie2948759ee811f1a02f93d8bfbd6f341c4f309db --- M client/includes/store/sql/DirectSqlStore.php M repo/includes/store/sql/SqlStore.php 2 files changed, 7 insertions(+), 10 deletions(-) Approvals: Aude: Checked; Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/store/sql/DirectSqlStore.php b/client/includes/store/sql/DirectSqlStore.php index 71719d1..2231584 100644 --- a/client/includes/store/sql/DirectSqlStore.php +++ b/client/includes/store/sql/DirectSqlStore.php @@ -327,11 +327,9 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( true, $this-repoWiki ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = $this-repoWiki . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; - return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); + $key = $this-cachePrefix . ':CachingPropertyInfoStore'; + return new CachingPropertyInfoStore( $table, ObjectCache::getInstance( $this-cacheType ), + $this-cacheDuration, $key ); } else { // dummy info store return new DummyPropertyInfoStore(); diff --git a/repo/includes/store/sql/SqlStore.php b/repo/includes/store/sql/SqlStore.php index b86035e..08238f2 100644 --- a/repo/includes/store/sql/SqlStore.php +++ b/repo/includes/store/sql/SqlStore.php @@ -3,6 +3,7 @@ namespace Wikibase; use DBQueryError; +use ObjectCache; use Wikibase\DataModel\Entity\BasicEntityIdParser; use Wikibase\Repo\WikibaseRepo; @@ -382,11 +383,9 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( false ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = wfWikiID() . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; - return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); + $key = $this-cachePrefix . ':CachingPropertyInfoStore'; + return new CachingPropertyInfoStore( $table, ObjectCache::getInstance( $this-cacheType ), + $this-cacheDuration, $key ); } else { // dummy info store return new DummyPropertyInfoStore(); -- To view, visit https://gerrit.wikimedia.org/r/99644 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie2948759ee811f1a02f93d8bfbd6f341c4f309db Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf5 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@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] Allow editing of attributes of MW extensions - change (mediawiki...VisualEditor)
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/99655 Change subject: Allow editing of attributes of MW extensions .. Allow editing of attributes of MW extensions To begin just render the existing attributes as a form. Later we may want the ability to add/remove attributes. Change-Id: Ib443498bdae5d362b198c60f0c23d864dca1b6b6 --- M modules/ve-mw/ui/inspectors/ve.ui.MWAlienExtensionInspector.js M modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js M modules/ve-mw/ui/styles/ve.ui.MWInspector.css 3 files changed, 63 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/55/99655/1 diff --git a/modules/ve-mw/ui/inspectors/ve.ui.MWAlienExtensionInspector.js b/modules/ve-mw/ui/inspectors/ve.ui.MWAlienExtensionInspector.js index b044665..f0a3e2d 100644 --- a/modules/ve-mw/ui/inspectors/ve.ui.MWAlienExtensionInspector.js +++ b/modules/ve-mw/ui/inspectors/ve.ui.MWAlienExtensionInspector.js @@ -50,9 +50,51 @@ // Parent method ve.ui.MWExtensionInspector.prototype.initialize.call( this ); + var key, attributeInput, attributeLabel, $table, + attributes = this.surface.getView().getFocusedNode().model.getAttribute('mw').attrs || {}; + + this.attributeInputs = {}; + + if ( !ve.isEmptyObject( attributes ) ) { + $table = this.$( 'table' ).addClass( 've-ui-mwExtensionInspector-attributes' ); + for ( key in attributes ) { + attributeInput = new OO.ui.TextInputWidget( { + '$': this.$, + 'value': attributes[key] + } ); + attributeLabel = new OO.ui.InputLabelWidget( { + '$': this.$, + 'input': attributeInput, + 'label': key + } ); + this.attributeInputs[key] = attributeInput; + $table.append( + this.$( 'tr' ).append( + this.$( 'td' ).append( attributeLabel.$element ), + this.$( 'td' ).append( attributeInput.$element ) + ) + ); + } + this.$form.append( $table ); + } + this.input.$element.addClass( 've-ui-mwAlienExtensionInspector-input' ); }; +/** + * @inheritdoc + */ +ve.ui.MWAlienExtensionInspector.prototype.updateMwDataFromModel = function ( mwData ) { + // Parent method + ve.ui.MWExtensionInspector.prototype.updateMwDataFromModel.call( this, mwData ); + + var key; + + for ( key in this.attributeInputs ) { + mwData.attrs[key] = this.attributeInputs[key].getValue(); + } +}; + /* Registration */ ve.ui.inspectorFactory.register( ve.ui.MWAlienExtensionInspector ); diff --git a/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js b/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js index bb9126f..6d9dcc3 100644 --- a/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js +++ b/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js @@ -94,7 +94,7 @@ if ( this.node instanceof this.constructor.static.nodeView ) { mwData = ve.copy( this.node.getModel().getAttribute( 'mw' ) ); - mwData.body.extsrc = this.input.getValue(); + this.updateMwDataFromModel( mwData ); surfaceModel.change( ve.dm.Transaction.newFromAttributeChanges( surfaceModel.getDocument(), this.node.getOuterRange().start, { 'mw': mwData } @@ -104,10 +104,9 @@ mwData = { 'name': this.constructor.static.nodeModel.static.extensionName, 'attrs': {}, - 'body': { - 'extsrc': this.input.getValue() - } + 'body': {} }; + this.updateMwDataFromModel( mwData ); surfaceModel.getFragment().collapseRangeToEnd().insertContent( [ { 'type': this.constructor.static.nodeModel.static.name, @@ -122,3 +121,11 @@ // Parent method ve.ui.Inspector.prototype.teardown.call( this, data ); }; + +/** + * Update mwData object with latest values from the model + * @param {Object} mwData MediaWiki data object + */ +ve.ui.MWExtensionInspector.prototype.updateMwDataFromModel = function ( mwData ) { + mwData.body.extsrc = this.input.getValue(); +}; \ No newline at end of file diff --git a/modules/ve-mw/ui/styles/ve.ui.MWInspector.css b/modules/ve-mw/ui/styles/ve.ui.MWInspector.css index
[MediaWiki-commits] [Gerrit] parsoid: startup script now has cleared out FDs - change (operations/puppet)
Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/99656 Change subject: parsoid: startup script now has cleared out FDs .. parsoid: startup script now has cleared out FDs On the beta cluster, we want to restart parsoid via a ssh command using `/etc/init.d/parsoid restart`. That eventually calls a background task which cause the file descriptors to be kept open by the spawned child process. To prevent data loss, ssh does not close its connection and hang. The workaround is to clear the file descritors when executing the command. Thus when the command is backgrounded, no FD is left around and the ssh client close properly. I have NO idea what is going to be the impacts in production. Example run: jenkins-deploy@deployment-bastion:~$ ssh deployment-parsoid2.pmtpa.wmflabs \ sudo -u root /etc/init.d/parsoid restart * Restarting parsoid ...done. jenkins-deploy@deployment-bastion:~$ bug: 57233 Change-Id: I3d4a49b37e6759ae222ab2fdb698576228dcc96e --- M files/misc/parsoid 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/56/99656/1 diff --git a/files/misc/parsoid b/files/misc/parsoid index 0e0b2e3..e0a8741 100644 --- a/files/misc/parsoid +++ b/files/misc/parsoid @@ -15,4 +15,7 @@ echo $PARSOIDPID /var/run/parsoid.pid wait $PARSOIDPID rm /var/run/parsoid.pid -) +) /dev/null /dev/null 21 +# Prevent init script to hang when executing from ssh by redirecting file +# descriptors. The FDs are passed to child and thus are kept open preventing +# ssh command from terminating. -- To view, visit https://gerrit.wikimedia.org/r/99656 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3d4a49b37e6759ae222ab2fdb698576228dcc96e Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Hashar has...@free.fr ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix order of parameters for PropertyLabelNotResolvedException - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Fix order of parameters for PropertyLabelNotResolvedException .. Fix order of parameters for PropertyLabelNotResolvedException Change-Id: Id60a046abeb12ff1ad2fefcf761d370e0cf662c0 --- M client/includes/parserhooks/PropertyParserFunctionRenderer.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/parserhooks/PropertyParserFunctionRenderer.php b/client/includes/parserhooks/PropertyParserFunctionRenderer.php index 7ca7647..6e5b371 100644 --- a/client/includes/parserhooks/PropertyParserFunctionRenderer.php +++ b/client/includes/parserhooks/PropertyParserFunctionRenderer.php @@ -104,7 +104,7 @@ $propertyIds = $this-propertyLabelResolver-getPropertyIdsForLabels( array( $string ) ); if ( $propertyIds === null || empty( $propertyIds ) ) { - throw new PropertyLabelNotResolvedException( $this-language-getCode(), $string ); + throw new PropertyLabelNotResolvedException( $string, $this-language-getCode() ); } $propertyId = $propertyIds[$string]; -- To view, visit https://gerrit.wikimedia.org/r/99651 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id60a046abeb12ff1ad2fefcf761d370e0cf662c0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf5 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [browser test] Chrome seems to not honor when_present() corr... - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: [browser test] Chrome seems to not honor when_present() correctly .. [browser test] Chrome seems to not honor when_present() correctly 1) Added another sleep statement which seems to fix the issue locally. 2) Modified a link page element identifier. Change-Id: Ic0006f18752d3625bc244d924a7a8a9fac2d5221 --- M modules/ve-mw/test/browser/features/step_definitions/links_steps.rb M modules/ve-mw/test/browser/features/step_definitions/shared_steps.rb M modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb 3 files changed, 3 insertions(+), 1 deletion(-) Approvals: Cmcmahon: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/test/browser/features/step_definitions/links_steps.rb b/modules/ve-mw/test/browser/features/step_definitions/links_steps.rb index 8e774da..e8f2529 100644 --- a/modules/ve-mw/test/browser/features/step_definitions/links_steps.rb +++ b/modules/ve-mw/test/browser/features/step_definitions/links_steps.rb @@ -1,4 +1,5 @@ When(/^I click the Link button$/) do + sleep 1 #Chrome seems to not honor when_present correctly as of 5 Dec 2013 on(VisualEditorPage).ve_link_icon_element.when_present.click end diff --git a/modules/ve-mw/test/browser/features/step_definitions/shared_steps.rb b/modules/ve-mw/test/browser/features/step_definitions/shared_steps.rb index 8bd0839..b75fcda 100644 --- a/modules/ve-mw/test/browser/features/step_definitions/shared_steps.rb +++ b/modules/ve-mw/test/browser/features/step_definitions/shared_steps.rb @@ -40,6 +40,7 @@ page.edit_ve_element.when_present.click #This begin/rescue clause dismisses the VE warning message when it exists, and does not fail when it does not exist begin + sleep 1 #Chrome seems to not honor when_present correctly as of 5 Dec 2013 page.beta_warning_element.when_present.click rescue end diff --git a/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb b/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb index d0dbfc8..a76fdcf 100644 --- a/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb +++ b/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb @@ -51,7 +51,7 @@ span(:leftarrowclose, class: 'oo-ui-iconedElement-icon oo-ui-icon-previous', frame: frame) text_field(:link_textfield, index: 0, frame: frame) list_item(:template_list_item, text: 'S', frame: frame) -div(:ve_link_ui, class: 'oo-ui-window-head', frame: frame) +div(:ve_link_ui, class: 'oo-ui-window-title', frame: frame) end in_frame(:index = 1) do |frame| -- To view, visit https://gerrit.wikimedia.org/r/99441 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic0006f18752d3625bc244d924a7a8a9fac2d5221 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Cmcmahon cmcma...@wikimedia.org Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org Gerrit-Reviewer: Jhall jh...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move init of $noFollow outside of if - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Move init of $noFollow outside of if .. Move init of $noFollow outside of if Bug: 58044 Change-Id: I5655a0dc64055f3ec5d0a287aa8e0c85c11d3a1f --- M includes/installer/LocalSettingsGenerator.php 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 2433fbd..515cedb 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -210,6 +210,7 @@ } $groupRights = ''; + $noFollow = ''; if ( $this-groupPermissions ) { $groupRights .= # The following permissions were set based on your choice in the installer\n; foreach ( $this-groupPermissions as $group = $rightArr ) { @@ -220,11 +221,10 @@ wfBoolToStr( $perm ) . ;\n; } } - $noFollow = ''; if ( $this-groupPermissions['*']['edit'] === false $this-groupPermissions['*']['createaccount'] === false $this-groupPermissions['*']['read'] !== false ) { - $noFollow = # Set \$wgNoFollowLinks to true if you open up your wiki to editing by\n + $noFollow = \n# Set \$wgNoFollowLinks to true if you open up your wiki to editing by\n . # the general public and wish to apply nofollow to external links as a\n . # deterrent to spammers. Nofollow is not a comprehensive anti-spam solution\n . # and open wikis will generally require other anti-spam measures; for more\n @@ -364,7 +364,6 @@ # Path to the GNU diff3 utility. Used for conflict resolution. \$wgDiff3 = \{$this-values['wgDiff3']}\; -{$groupRights} -{$noFollow}; +{$groupRights}{$noFollow}; } } -- To view, visit https://gerrit.wikimedia.org/r/99654 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5655a0dc64055f3ec5d0a287aa8e0c85c11d3a1f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: leucosticte nathanlarson3...@gmail.com Gerrit-Reviewer: Chad ch...@wikimedia.org Gerrit-Reviewer: Waldir wal...@email.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 debug points in term property label resolver - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/99657 Change subject: Add debug points in term property label resolver .. Add debug points in term property label resolver Change-Id: I5f551244188d61493b4b683c5f4efb7597ad6ee1 --- M lib/includes/store/TermPropertyLabelResolver.php 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/57/99657/1 diff --git a/lib/includes/store/TermPropertyLabelResolver.php b/lib/includes/store/TermPropertyLabelResolver.php index 6b3cd5c..8e23596 100644 --- a/lib/includes/store/TermPropertyLabelResolver.php +++ b/lib/includes/store/TermPropertyLabelResolver.php @@ -90,11 +90,15 @@ * @return EntityId[] a map of strings from $lables to the corresponding entity ID. */ public function getPropertyIdsForLabels( array $labels, $recache = '' ) { + wfDebugLog( __CLASS__, __METHOD__ ); + wfDebugLog( __CLASS__, var_export( $labels, true ) ); $props = $this-getLabelMap( $recache ); $keys = array_flip( $labels ); $idsForLabels = array_intersect_key( $props, $keys ); + wfDebugLog( __CLASS__, var_export( $idsForLabels, true ) ); + return $idsForLabels; } -- To view, visit https://gerrit.wikimedia.org/r/99657 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f551244188d61493b4b683c5f4efb7597ad6ee1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf5 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] Add debug points in term property label resolver - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Add debug points in term property label resolver .. Add debug points in term property label resolver Change-Id: I5f551244188d61493b4b683c5f4efb7597ad6ee1 --- M lib/includes/store/TermPropertyLabelResolver.php 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/includes/store/TermPropertyLabelResolver.php b/lib/includes/store/TermPropertyLabelResolver.php index 6b3cd5c..8e23596 100644 --- a/lib/includes/store/TermPropertyLabelResolver.php +++ b/lib/includes/store/TermPropertyLabelResolver.php @@ -90,11 +90,15 @@ * @return EntityId[] a map of strings from $lables to the corresponding entity ID. */ public function getPropertyIdsForLabels( array $labels, $recache = '' ) { + wfDebugLog( __CLASS__, __METHOD__ ); + wfDebugLog( __CLASS__, var_export( $labels, true ) ); $props = $this-getLabelMap( $recache ); $keys = array_flip( $labels ); $idsForLabels = array_intersect_key( $props, $keys ); + wfDebugLog( __CLASS__, var_export( $idsForLabels, true ) ); + return $idsForLabels; } -- To view, visit https://gerrit.wikimedia.org/r/99657 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5f551244188d61493b4b683c5f4efb7597ad6ee1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf5 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update Wikibase, for issue with parser function - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/99658 Change subject: Update Wikibase, for issue with parser function .. Update Wikibase, for issue with parser function Bug: 58099 Change-Id: I06994427b780cd0b66dc0b0279045df7699aef1c --- M extensions/Wikibase 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/58/99658/1 diff --git a/extensions/Wikibase b/extensions/Wikibase index a103765..b792d34 16 --- a/extensions/Wikibase +++ b/extensions/Wikibase -Subproject commit a1037651592c406aa4181ce9fc1d580fc2dd6851 +Subproject commit b792d34fda0851793b34e19d2e31cdb302a2f4a1 -- To view, visit https://gerrit.wikimedia.org/r/99658 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06994427b780cd0b66dc0b0279045df7699aef1c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf5 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] Fix order of parameters for PropertyLabelNotResolvedException - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Fix order of parameters for PropertyLabelNotResolvedException .. Fix order of parameters for PropertyLabelNotResolvedException Change-Id: Id60a046abeb12ff1ad2fefcf761d370e0cf662c0 (cherry picked from commit 76420ad66a0ab54a8f7edb3a0140ebfb42bcceb8) --- M client/includes/parserhooks/PropertyParserFunctionRenderer.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/parserhooks/PropertyParserFunctionRenderer.php b/client/includes/parserhooks/PropertyParserFunctionRenderer.php index 7ca7647..6e5b371 100644 --- a/client/includes/parserhooks/PropertyParserFunctionRenderer.php +++ b/client/includes/parserhooks/PropertyParserFunctionRenderer.php @@ -104,7 +104,7 @@ $propertyIds = $this-propertyLabelResolver-getPropertyIdsForLabels( array( $string ) ); if ( $propertyIds === null || empty( $propertyIds ) ) { - throw new PropertyLabelNotResolvedException( $this-language-getCode(), $string ); + throw new PropertyLabelNotResolvedException( $string, $this-language-getCode() ); } $propertyId = $propertyIds[$string]; -- To view, visit https://gerrit.wikimedia.org/r/99652 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id60a046abeb12ff1ad2fefcf761d370e0cf662c0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf6 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] beta: properly connect to parsoid instance - change (operations/puppet)
Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/99659 Change subject: beta: properly connect to parsoid instance .. beta: properly connect to parsoid instance The wmf-beta-autoupdate.py script runs as the mwdeploy user. Thus the ssh commands to the parsoid instance would fail because that user does not have any ssh credential to connect there (jenkins-deploy has). This patch introduce a new tiny shell wrapper to let us execute the parsoid init script on deployment-parsoid2. It must be run as the mwdeploy user (like wmf-beta-autoupdate.py) and will sudo as jenkins-deploy to have the proper credentials. A new sudo policy is added to let mwdeploy execute the shell wrapper as jenkins-deploy. bug: 57233 Change-Id: I0fa1beba0f7e91b0999d6820b20a7569eb735087 --- M files/misc/beta/wmf-beta-autoupdate.py A files/misc/beta/wmf-beta-parsoid-remote.sh M manifests/misc/beta.pp 3 files changed, 39 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/59/99659/1 diff --git a/files/misc/beta/wmf-beta-autoupdate.py b/files/misc/beta/wmf-beta-autoupdate.py index 9acaf8c..d31ed09 100755 --- a/files/misc/beta/wmf-beta-autoupdate.py +++ b/files/misc/beta/wmf-beta-autoupdate.py @@ -20,9 +20,6 @@ PATH_MWCORE = '/home/wikipedia/common/php-master' PATH_MWEXT = '/home/wikipedia/common/php-master/extensions' -# Beta cluster instance used to run Parsoid daemon -PARSOID_INSTANCE = 'deployment-parsoid2.pmtpa.wmflabs' - def main(): @@ -147,14 +144,11 @@ def restart_parsoid(): Restart parsoid daemon via ssh logger = logging.getLogger(__name__) -logger.info(restarting parsoid on %s, PARSOID_INSTANCE) +logger.info(restarting parsoid) -parsoid_restart_cmd = [ -'ssh', PARSOID_INSTANCE, -'sudo -u root /etc/init.d/parsoid restart'] -logger.info(Executing %s, parsoid_restart_cmd) +parsoid_init_cmd = '/usr/local/bin/wmf-beta-parsoid-remote.sh' try: -cmd = subprocess.Popen(args=parsoid_restart_cmd) +cmd = subprocess.Popen(args=[parsoid_init_cmd, 'restart']) except OSError, exception: logger.error(exception) return False @@ -164,9 +158,7 @@ logger.info('Checking parsoid is running...') try: -cmd = subprocess.Popen([ -'ssh', PARSOID_INSTANCE, -'/etc/init.d/parsoid', 'status']) +cmd = subprocess.Popen(args=[parsoid_init_cmd, 'status']) status_exit_code = cmd.wait() except OSError, exception: logger.error(exception) diff --git a/files/misc/beta/wmf-beta-parsoid-remote.sh b/files/misc/beta/wmf-beta-parsoid-remote.sh new file mode 100755 index 000..921510c --- /dev/null +++ b/files/misc/beta/wmf-beta-parsoid-remote.sh @@ -0,0 +1,21 @@ +#!/bin/bash -x +### +# WARNING: this file is managed by Puppet +# puppet:///files/misc/beta/wmf-beta-parsoid-restart.sh +### + +if [ $USER != 'mwdeploy' ] +then +echo Script MUST be run as mwdeploy user +echo Additionally the user needs sudo right for ssh as jenkins-deploy +exit 1 +fi + +PARSOID_INSTANCE=deployment-parsoid2.pmtpa.wmflabs + +# The beta autoupdater runs as mwdeploy. We need jenkins-deploy ssh credentials +# to be able to connect to the parsoid instance. On there, we restart Parsoid +# as root. +sudo -H -u jenkins-deploy \ +ssh $PARSOID_INSTANCE \ +sudo -u root /etc/init.d/parsoid $1 diff --git a/manifests/misc/beta.pp b/manifests/misc/beta.pp index 5655583..ee38fe0 100644 --- a/manifests/misc/beta.pp +++ b/manifests/misc/beta.pp @@ -26,6 +26,15 @@ ensure = absent; } + $beta_parsoid_remote_script = '/usr/local/bin/wmf-beta-parsoid-remote.sh' + + file { $beta_parsoid_remote_script: + ensure = present, + owner = root, + group = root, + mode = 0555, + } + # Make sure wmf-beta-autoupdate can run the l10n updater as l10nupdate sudo_user { mwdeploy : privileges = [ 'ALL = (l10nupdate) NOPASSWD:/usr/local/bin/mw-update-l10n', @@ -36,6 +45,11 @@ # it tries to identify as mwdeploy. 'ALL = (mwdeploy) NOPASSWD: ALL', + # The Parsoid restart script needs jenkins-deploy ssh credentials + # to connect to the beta parsoid instance + ALL = (jenkins-deploy) NOPASSD: $beta_parsoid_remote_script restart, + ALL = (jenkins-deploy) NOPASSD: $beta_parsoid_remote_script status, + # mergeMessageFileList.php is run by mw-update-l10n as the apache user # since https://gerrit.wikimedia.org/r/#/c/44548/ # Let it runs mwscript and others as apache user.
[MediaWiki-commits] [Gerrit] (bug 45529) use composite indexes on wb_terms. - change (mediawiki...Wikibase)
Daniel Kinzler has uploaded a new change for review. https://gerrit.wikimedia.org/r/99660 Change subject: (bug 45529) use composite indexes on wb_terms. .. (bug 45529) use composite indexes on wb_terms. Change-Id: I3cd44a07666511ff836d7439540c29e824024ec4 --- M lib/includes/store/sql/TermSqlIndex.php M repo/includes/store/sql/SqlStore.php M repo/includes/store/sql/Wikibase.sql A repo/sql/UpdateTermIndexes.sql 4 files changed, 41 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/60/99660/1 diff --git a/lib/includes/store/sql/TermSqlIndex.php b/lib/includes/store/sql/TermSqlIndex.php index c9e214f..6f90ca8 100644 --- a/lib/includes/store/sql/TermSqlIndex.php +++ b/lib/includes/store/sql/TermSqlIndex.php @@ -157,7 +157,8 @@ $entityIdentifiers, $weightField ), - __METHOD__ + __METHOD__, + array( 'IGNORE' ) ); if ( !$success ) { @@ -211,7 +212,8 @@ $termIdentifiers, $entityIdentifiers ), - __METHOD__ + __METHOD__, + array( 'IGNORE' ) ); if ( !$success ) { diff --git a/repo/includes/store/sql/SqlStore.php b/repo/includes/store/sql/SqlStore.php index 08238f2..c4dc129 100644 --- a/repo/includes/store/sql/SqlStore.php +++ b/repo/includes/store/sql/SqlStore.php @@ -191,6 +191,18 @@ $updater-addPostDatabaseUpdateMaintenance( 'Wikibase\RebuildTermsSearchKey' ); } + // Update from 0.4 to 0.5 + if ( !$db-indexExists( 'wb_terms', 'term_search' ) ) { + + $termsKeyUpdate = 'UpdateTermIndexes' . $extension; + + $updater-addExtensionIndex( + 'wb_terms', + 'term_search', + __DIR__ . '/../../../sql/' . $termsKeyUpdate + ); + } + // Update from 0.1. or 0.2. if ( !$db-tableExists( 'wb_entity_per_page' ) ) { diff --git a/repo/includes/store/sql/Wikibase.sql b/repo/includes/store/sql/Wikibase.sql index 3a7ec19..cd228d4 100644 --- a/repo/includes/store/sql/Wikibase.sql +++ b/repo/includes/store/sql/Wikibase.sql @@ -42,12 +42,14 @@ term_weightFLOAT UNSIGNED NOT NULL DEFAULT 0.0 -- weight for ranking ) /*$wgDBTableOptions*/; -CREATE INDEX /*i*/wb_terms_entity_id ON /*_*/wb_terms (term_entity_id); -CREATE INDEX /*i*/wb_terms_entity_type ON /*_*/wb_terms (term_entity_type); -CREATE INDEX /*i*/wb_terms_language ON /*_*/wb_terms (term_language); -CREATE INDEX /*i*/wb_terms_type ON /*_*/wb_terms (term_type); -CREATE INDEX /*i*/wb_terms_text ON /*_*/wb_terms (term_text); -CREATE INDEX /*i*/wb_terms_search_key ON /*_*/wb_terms (term_search_key); +-- for TermSqlIndex::getMatchingIDs +CREATE INDEX /*i*/term_search ON /*_*/wb_terms (term_language, term_search_key(12), term_entity_type, term_type, term_text); + +-- for TermSqlIndex::getTermsOfEntity and for the join in TermSqlIndex::getMatchingTermCombination +CREATE INDEX /*i*/term_entity ON /*_*/wb_terms (term_entity_type, term_entity_id, term_type, term_text); + +-- TermSqlIndex::getMatchingTerms with or without given term_text, as well as for TermSqlIndex::getMatchingTermCombination +CREATE UNIQUE INDEX /*i*/term_identity ON /*_*/wb_terms (term_language, term_type, term_entity_type, term_text, term_entity_id); -- Links id+type to page ids. CREATE TABLE IF NOT EXISTS /*_*/wb_entity_per_page ( diff --git a/repo/sql/UpdateTermIndexes.sql b/repo/sql/UpdateTermIndexes.sql new file mode 100644 index 000..28ba507 --- /dev/null +++ b/repo/sql/UpdateTermIndexes.sql @@ -0,0 +1,17 @@ + +DROP INDEX /*i*/wb_terms_entity_id ON /*_*/wb_terms; +DROP INDEX /*i*/wb_terms_entity_type ON /*_*/wb_terms; +DROP INDEX /*i*/wb_terms_language ON /*_*/wb_terms; +DROP INDEX /*i*/wb_terms_type ON /*_*/wb_terms; +DROP INDEX /*i*/wb_terms_text ON /*_*/wb_terms; +DROP INDEX /*i*/wb_terms_search_key ON /*_*/wb_terms; + + +-- for TermSqlIndex::getMatchingIDs +CREATE INDEX /*i*/term_search ON /*_*/wb_terms (term_language, term_search_key(12), term_entity_type, term_type); + +-- for TermSqlIndex::getTermsOfEntity and for the join in TermSqlIndex::getMatchingTermCombination +CREATE INDEX /*i*/term_entity ON /*_*/wb_terms (term_entity_type, term_entity_id, term_type); +
[MediaWiki-commits] [Gerrit] Fix script error in IE - change (mediawiki...UploadWizard)
Rillke has uploaded a new change for review. https://gerrit.wikimedia.org/r/99661 Change subject: Fix script error in IE .. Fix script error in IE IE 8 throws an error when doing ``$( 'button' ).prop( 'type', 'button' )`` Regression by I44e92fdda6cebf5188ccfade3863219558423d8f Bug: 58100 Change-Id: I30bb876a5afee629e60f11cdee58adb6ed5be214 --- M resources/mw.UploadWizardDetails.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/61/99661/1 diff --git a/resources/mw.UploadWizardDetails.js b/resources/mw.UploadWizardDetails.js index 497b5e3..c826505 100644 --- a/resources/mw.UploadWizardDetails.js +++ b/resources/mw.UploadWizardDetails.js @@ -170,7 +170,7 @@ // .append( $( 'div class=mwe-location-alt-label/div' ).append( mw.message( 'mwe-upwiz-location-alt' ).text() ) ) // .append( _this.altInput ); - var showMap = $( 'button' ).prop( 'type', 'button' ).prop( 'size', 20 ) + var showMap = $( 'button type=button size=20/button' ) .addClass( 'mwe-upwiz-buttons' ) .msg( 'mwe-upwiz-location-button' ) .button() -- To view, visit https://gerrit.wikimedia.org/r/99661 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I30bb876a5afee629e60f11cdee58adb6ed5be214 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: Rillke rainerril...@hotmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations-puppet-pep8 no more uses submodules - change (integration/jenkins-job-builder-config)
Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/99663 Change subject: operations-puppet-pep8 no more uses submodules .. operations-puppet-pep8 no more uses submodules The submodules in operations/puppet.git might not respect pep8. So we are not going to fetch them anymore. Change-Id: Icc31a6b9cbf45057795de5ccd4dfb2b0ac70ed72 --- M operations-puppet.yaml 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/integration/jenkins-job-builder-config refs/changes/63/99663/1 diff --git a/operations-puppet.yaml b/operations-puppet.yaml index c867970..520c98a 100644 --- a/operations-puppet.yaml +++ b/operations-puppet.yaml @@ -57,7 +57,8 @@ - job-template: name: 'operations-puppet-pep8' node: hasSlaveScripts -defaults: use-remote-zuul +# Dont process other puppet submodules +defaults: use-remote-zuul-no-submodules triggers: - zuul -- To view, visit https://gerrit.wikimedia.org/r/99663 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icc31a6b9cbf45057795de5ccd4dfb2b0ac70ed72 Gerrit-PatchSet: 1 Gerrit-Project: integration/jenkins-job-builder-config Gerrit-Branch: master Gerrit-Owner: Hashar has...@free.fr ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations-puppet-pep8 no more uses submodules - change (integration/jenkins-job-builder-config)
jenkins-bot has submitted this change and it was merged. Change subject: operations-puppet-pep8 no more uses submodules .. operations-puppet-pep8 no more uses submodules The submodules in operations/puppet.git might not respect pep8. So we are not going to fetch them anymore. Change-Id: Icc31a6b9cbf45057795de5ccd4dfb2b0ac70ed72 --- M operations-puppet.yaml 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/operations-puppet.yaml b/operations-puppet.yaml index c867970..520c98a 100644 --- a/operations-puppet.yaml +++ b/operations-puppet.yaml @@ -57,7 +57,8 @@ - job-template: name: 'operations-puppet-pep8' node: hasSlaveScripts -defaults: use-remote-zuul +# Dont process other puppet submodules +defaults: use-remote-zuul-no-submodules triggers: - zuul -- To view, visit https://gerrit.wikimedia.org/r/99663 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icc31a6b9cbf45057795de5ccd4dfb2b0ac70ed72 Gerrit-PatchSet: 1 Gerrit-Project: integration/jenkins-job-builder-config Gerrit-Branch: master Gerrit-Owner: Hashar has...@free.fr Gerrit-Reviewer: Hashar has...@free.fr 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 a new config option for an API proxy endpoint - change (mediawiki...Parsoid)
Faidon Liambotis has uploaded a new change for review. https://gerrit.wikimedia.org/r/99666 Change subject: Add a new config option for an API proxy endpoint .. Add a new config option for an API proxy endpoint Create a new configuration directive, to be passed through as the proxy option to the requests module on calls that hit the API endpoints. This can be used to provide either a forward proxy (e.g. for some weird isolated environment scenario) or, in Wikimedia's case, to provide the service IP for the API application servers, as to be able to connect directly to them, rather than going through the multiple caching layers in front of them. Hence, remove the ?random=pid hacks that have been introduced with Ie9554f8ea7f19b3271857bdc10e7ea6fa808dec to help with internal load-balancing between caching layers, as they shouldn't be needed anymore. While at it, rename requests' url option to uri, as this is the documented and preferred way; the code internally maps url to uri, as it's a common mistake, but we shouldn't make it. Bug: 51273 Change-Id: I76c7a133d05f432d692fb82df196c4a1051e2e43 --- M js/api/localsettings.js.example M js/lib/mediawiki.ApiRequest.js 2 files changed, 17 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/66/99666/1 diff --git a/js/api/localsettings.js.example b/js/api/localsettings.js.example index c9bf938..2e0567f 100644 --- a/js/api/localsettings.js.example +++ b/js/api/localsettings.js.example @@ -10,6 +10,9 @@ // The URL here is supposed to be your MediaWiki API endpoint parsoidConfig.setInterwiki( 'localhost', 'http://localhost/w/api.php' ); + // a proxy to connect to the API endpoints + // parsoidConfig.apiProxyURI = 'http://proxy.example.org:8080/'; + // Enable debug mode (prints extra debugging messages) // parsoidConfig.debug = true; diff --git a/js/lib/mediawiki.ApiRequest.js b/js/lib/mediawiki.ApiRequest.js index 665356f..465c94b 100644 --- a/js/lib/mediawiki.ApiRequest.js +++ b/js/lib/mediawiki.ApiRequest.js @@ -360,8 +360,7 @@ title: title, text: text }; - // Randomize the POST url so that we hit different Squids - var url = env.conf.wiki.apiURI + '?random=' + process.pid; + var uri = env.conf.wiki.apiURI; this.requestOptions = { // Use POST since we are passing a bit of source, and GET has a very @@ -370,7 +369,7 @@ method: 'POST', form: apiargs, // The API arguments followRedirect: true, - url: url, + uri: uri, timeout: 16 * 1000, // 16 seconds headers: { 'User-Agent': userAgent, @@ -378,6 +377,11 @@ 'Connection': 'close' } }; + + if (env.conf.parsoid.apiProxyURI) { + // go via a proxy to API servers, e.g. an internal load-balancer + this.requestOptions.proxy = env.conf.parsoid.apiProxyURI; + } // Start the request this.request( this.requestOptions, this._requestCB.bind(this) ); @@ -459,10 +463,7 @@ text: text, disablepp: 'true' }; - // Randomize the POST url so that we hit different Squids - // TODO: cut out squids completely. See - // https://bugzilla.wikimedia.org/show_bug.cgi?id=51273 - var url = env.conf.wiki.apiURI + '?random=' + process.pid; + var uri = env.conf.wiki.apiURI; this.requestOptions = { // Use POST since we are passing a bit of source, and GET has a very @@ -471,7 +472,7 @@ method: 'POST', form: apiargs, // The API arguments followRedirect: true, - url: url, + uri: uri, timeout: 16 * 1000, // 16 seconds headers: { 'User-Agent': userAgent, @@ -480,6 +481,11 @@ } }; + if (env.conf.parsoid.apiProxyURI) { + // go via a proxy to API servers, e.g. an internal load-balancer + this.requestOptions.proxy = env.conf.parsoid.apiProxyURI; + } + // Start the request this.request( this.requestOptions, this._requestCB.bind(this) ); } -- To view, visit https://gerrit.wikimedia.org/r/99666 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I76c7a133d05f432d692fb82df196c4a1051e2e43 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: Faidon Liambotis fai...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org
[MediaWiki-commits] [Gerrit] Make delete test less flaky - change (mediawiki...CirrusSearch)
Manybubbles has uploaded a new change for review. https://gerrit.wikimedia.org/r/99667 Change subject: Make delete test less flaky .. Make delete test less flaky Instead of arbitrary wait times it now: * Verifies that the index operation worked in the first place * Waits *up to* 75 seconds for the delete but typically catches it after one or two. 75 is used because that is a nice long timeout for beta in case its job queue is backed up. Change-Id: I694d845b25ec06de6a29d71f468b319f235c5344 --- M tests/browser/features/updates.feature 1 file changed, 3 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch refs/changes/67/99667/1 diff --git a/tests/browser/features/updates.feature b/tests/browser/features/updates.feature index dc4ea1a..cd56b66 100644 --- a/tests/browser/features/updates.feature +++ b/tests/browser/features/updates.feature @@ -1,14 +1,12 @@ Feature: Search backend updates Background: Given I am logged in + Scenario: Deleted pages are removed from the index Given a page named DeleteMe exists +Then within 75 seconds searching for DeleteMe yields DeleteMe as the first result When I delete DeleteMe -And I am at a random page so I can reload it if I need to -And wait 5 seconds -And I type DeleteMe into the search box -Then suggestions should appear -And none is the first suggestion +Then within 75 seconds searching for DeleteMe yields none as the first result Scenario: Altered pages are updated in the index Given a page named ChangeMe exists with contents foo -- To view, visit https://gerrit.wikimedia.org/r/99667 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I694d845b25ec06de6a29d71f468b319f235c5344 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: Manybubbles never...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add wikibase css class for parser function errors - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: add wikibase css class for parser function errors .. add wikibase css class for parser function errors Change-Id: I564e575ee0399534647babc8d1102d1fb793586b --- M client/WikibaseClient.hooks.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Daniel Kinzler: Looks good to me, approved jenkins-bot: Verified diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php index 37d8f3b..37e9cee 100644 --- a/client/WikibaseClient.hooks.php +++ b/client/WikibaseClient.hooks.php @@ -517,7 +517,7 @@ if ( !empty( $errors ) ) { foreach ( $errors as $errorMessage ) { $out-addWikiText( - 'p class=error' . $errorMessage . '/p' + 'p class=error wikibase-error' . $errorMessage . '/p' ); } } -- To view, visit https://gerrit.wikimedia.org/r/99662 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I564e575ee0399534647babc8d1102d1fb793586b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf6 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@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] User renaming needs to be handleable by the RenameUser exten... - change (mediawiki...Flow)
Matthias Mullie has uploaded a new change for review. https://gerrit.wikimedia.org/r/99668 Change subject: User renaming needs to be handleable by the RenameUser extension .. User renaming needs to be handleable by the RenameUser extension Implemented hook for RenameUser extensions; will query database for data that needs to be updated then uses Flow data access methods to update the records. Added indexes on user columns. Added some methods to models to set the user name. Also had to make a couple of changes to RevisionStorage. * Changed method splitUpdate; it will now accept a column prefix return only columns matching that prefix (updateRelated can fetch it's own using splitUpdate with the appropriate prefix) * Changed updateRelated: it'll now accept (all, not just related) $changes, (whereupon it can call splitUpdate itself) old $row * PostRevisionStorage::updateRelated is no longer unimplemented: it will be run if the changed columns are in $allowedUpdateColumns (similar to update()) Change-Id: Ie4aeaa40b216995fbbf4e0f3670a19f0955f77cd --- M Flow.php M Hooks.php M container.php A db_patches/patch-user_idx.sql M flow.sql M includes/Data/RevisionStorage.php M includes/Model/AbstractRevision.php M includes/Model/PostRevision.php M includes/Model/Workflow.php A includes/RenameUser/RenameUser.php 10 files changed, 365 insertions(+), 25 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/68/99668/1 diff --git a/Flow.php b/Flow.php index fa6c37f..bc19cf2 100755 --- a/Flow.php +++ b/Flow.php @@ -125,6 +125,7 @@ $wgAutoloadClasses['Flow\Log\Logger'] = $dir . 'includes/Log/Logger.php'; $wgAutoloadClasses['Flow\Log\Formatter'] = $dir . 'includes/Log/Formatter.php'; $wgAutoloadClasses['Flow\Log\PostModerationLogger'] = $dir . 'includes/Log/PostModerationLogger.php'; +$wgAutoloadClasses['Flow\RenameUser\RenameUser'] = $dir . 'includes/RenameUser/RenameUser.php'; // database interaction for singular models $wgAutoloadClasses['Flow\Data\RevisionStorage'] = $dir . 'includes/Data/RevisionStorage.php'; @@ -161,6 +162,7 @@ $wgHooks['SpecialWatchlistGetNonRevisionTypes'][] = 'FlowHooks::onSpecialWatchlistGetNonRevisionTypes'; $wgHooks['UserGetReservedNames'][] = 'FlowHooks::onUserGetReservedNames'; $wgHooks['ResourceLoaderGetConfigVars'][] = 'FlowHooks::onResourceLoaderGetConfigVars'; +$wgHooks['RenameUserComplete'][] = 'FlowHooks::onRenameUserComplete'; // Extension initialization $wgExtensionFunctions[] = 'FlowHooks::initFlowExtension'; diff --git a/Hooks.php b/Hooks.php index 01b8338..eae26cd 100644 --- a/Hooks.php +++ b/Hooks.php @@ -46,6 +46,7 @@ $updater-modifyExtensionField( 'flow_revision', 'rev_change_type', $dir/db_patches/patch-rev_change_type_update.sql ); $updater-modifyExtensionField( 'recentchanges', 'rc_source', $dir/db_patches/patch-rc_source.sql ); $updater-modifyExtensionField( 'flow_revision', 'rev_change_type', $dir/db_patches/patch-censor_to_suppress.sql ); + $updater-addExtensionIndex( 'flow_workflow', 'flow_workflow_user', $dir/db_patches/patch-user_idx.sql ); require_once __DIR__.'/maintenance/FlowInsertDefaultDefinitions.php'; $updater-addPostDatabaseUpdateMaintenance( 'FlowInsertDefaultDefinitions' ); @@ -257,4 +258,21 @@ return true; } + + /** +* @param int $userId The user id +* @param $old string The old username +* @param $new string The new username +* @return bool +*/ + public static function onRenameUserComplete( $userId, $old, $new ) { + $renamer = Container::get( 'renameuser' ); + + return + $renamer-workflow( $userId, $old, $new ) + $renamer-revisionUser( $userId, $old, $new ) + $renamer-revisionModeratedByUser( $userId, $old, $new ) + $renamer-revisionLastEditUser( $userId, $old, $new ) + $renamer-treeRevision( $userId, $old, $new ); + } } diff --git a/container.php b/container.php index e2fb479..8494a14 100644 --- a/container.php +++ b/container.php @@ -403,4 +403,11 @@ ); } ); +$c['renameuser'] = $c-share( function( $c ) { + return new Flow\RenameUser\RenameUser( + $c['db.factory'], + $c['storage'] + ); +} ); + return $c; diff --git a/db_patches/patch-user_idx.sql b/db_patches/patch-user_idx.sql new file mode 100644 index 000..32c665f --- /dev/null +++ b/db_patches/patch-user_idx.sql @@ -0,0 +1,10 @@ +-- RenameUser will run a couple of queries on WHERE user_id = X AND user_text = Y +-- to find data that needs to be updated when changing a username on Special:RenameUser + +CREATE INDEX /*i*/flow_workflow_user ON /*_*/flow_workflow
[MediaWiki-commits] [Gerrit] add wikibase css class for parser function errors - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: add wikibase css class for parser function errors .. add wikibase css class for parser function errors Change-Id: I564e575ee0399534647babc8d1102d1fb793586b (cherry picked from commit 576daf7f54552e02ace1cc3114b1b316682c4abe) (cherry picked from commit 87056cd48f2623226ca5f3b1a5eb511d53ae52b7) --- M client/WikibaseClient.hooks.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Daniel Kinzler: Looks good to me, approved jenkins-bot: Verified diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php index c4cf255..0e6b43d 100644 --- a/client/WikibaseClient.hooks.php +++ b/client/WikibaseClient.hooks.php @@ -523,7 +523,7 @@ if ( !empty( $errors ) ) { foreach ( $errors as $errorMessage ) { $out-addWikiText( - 'p class=error' . $errorMessage . '/p' + 'p class=error wikibase-error' . $errorMessage . '/p' ); } } -- To view, visit https://gerrit.wikimedia.org/r/99665 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I564e575ee0399534647babc8d1102d1fb793586b 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: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add wikibase css class for parser function errors - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: add wikibase css class for parser function errors .. add wikibase css class for parser function errors Change-Id: I564e575ee0399534647babc8d1102d1fb793586b (cherry picked from commit 576daf7f54552e02ace1cc3114b1b316682c4abe) --- M client/WikibaseClient.hooks.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php index f47cb8e..37152dd 100644 --- a/client/WikibaseClient.hooks.php +++ b/client/WikibaseClient.hooks.php @@ -517,7 +517,7 @@ if ( !empty( $errors ) ) { foreach ( $errors as $errorMessage ) { $out-addWikiText( - 'p class=error' . $errorMessage . '/p' + 'p class=error wikibase-error' . $errorMessage . '/p' ); } } -- To view, visit https://gerrit.wikimedia.org/r/99664 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I564e575ee0399534647babc8d1102d1fb793586b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf5 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updated Ruby gems - change (mediawiki...VisualEditor)
Zfilipin has uploaded a new change for review. https://gerrit.wikimedia.org/r/99669 Change subject: Updated Ruby gems .. Updated Ruby gems Checking if selenium-webdriver 2.38.0 fixes cursor problem in Chrome. Change-Id: I4467ed4ec1b3d7007f4293e3791f41502ce05959 --- M modules/ve-mw/test/browser/Gemfile.lock 1 file changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/69/99669/1 diff --git a/modules/ve-mw/test/browser/Gemfile.lock b/modules/ve-mw/test/browser/Gemfile.lock index d838dfd..fc0a74e 100644 --- a/modules/ve-mw/test/browser/Gemfile.lock +++ b/modules/ve-mw/test/browser/Gemfile.lock @@ -4,24 +4,24 @@ builder (3.2.2) childprocess (0.3.9) ffi (~ 1.0, = 1.0.11) -cucumber (1.3.8) +cucumber (1.3.10) builder (= 2.1.2) diff-lcs (= 1.1.3) - gherkin (~ 2.12.1) + gherkin (~ 2.12) multi_json (= 1.7.5, 2.0) multi_test (= 0.0.2) data_magic (0.16.1) faker (= 1.1.2) yml_reader (= 0.2) -diff-lcs (1.2.4) +diff-lcs (1.2.5) faker (1.2.0) i18n (~ 0.5) ffi (1.9.3) gherkin (2.12.2) multi_json (~ 1.3) -i18n (0.6.5) +i18n (0.6.9) json (1.8.1) -mediawiki-selenium (0.1.12) +mediawiki-selenium (0.1.13) cucumber json net-http-persistent @@ -33,7 +33,7 @@ multi_json (1.8.2) multi_test (0.0.2) net-http-persistent (2.9) -page-object (0.9.3) +page-object (0.9.4) page_navigation (= 0.8) selenium-webdriver (= 2.37.0) watir-webdriver (= 0.6.4) @@ -41,13 +41,13 @@ data_magic (= 0.14) rest-client (1.6.7) mime-types (= 1.16) -rspec-expectations (2.14.3) +rspec-expectations (2.14.4) diff-lcs (= 1.1.3, 2.0) -rubyzip (1.0.0) -selenium-webdriver (2.37.0) +rubyzip (1.1.0) +selenium-webdriver (2.38.0) childprocess (= 0.2.5) multi_json (~ 1.0) - rubyzip (~ 1.0.0) + rubyzip (~ 1.0) websocket (~ 1.0.4) syntax (1.0.0) watir-webdriver (0.6.4) -- To view, visit https://gerrit.wikimedia.org/r/99669 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4467ed4ec1b3d7007f4293e3791f41502ce05959 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Zfilipin zfili...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updated Ruby gems - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Updated Ruby gems .. Updated Ruby gems Checking if selenium-webdriver 2.38.0 fixes cursor problem in Chrome. Change-Id: I4467ed4ec1b3d7007f4293e3791f41502ce05959 --- M modules/ve-mw/test/browser/Gemfile.lock 1 file changed, 10 insertions(+), 10 deletions(-) Approvals: Cmcmahon: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/test/browser/Gemfile.lock b/modules/ve-mw/test/browser/Gemfile.lock index d838dfd..fc0a74e 100644 --- a/modules/ve-mw/test/browser/Gemfile.lock +++ b/modules/ve-mw/test/browser/Gemfile.lock @@ -4,24 +4,24 @@ builder (3.2.2) childprocess (0.3.9) ffi (~ 1.0, = 1.0.11) -cucumber (1.3.8) +cucumber (1.3.10) builder (= 2.1.2) diff-lcs (= 1.1.3) - gherkin (~ 2.12.1) + gherkin (~ 2.12) multi_json (= 1.7.5, 2.0) multi_test (= 0.0.2) data_magic (0.16.1) faker (= 1.1.2) yml_reader (= 0.2) -diff-lcs (1.2.4) +diff-lcs (1.2.5) faker (1.2.0) i18n (~ 0.5) ffi (1.9.3) gherkin (2.12.2) multi_json (~ 1.3) -i18n (0.6.5) +i18n (0.6.9) json (1.8.1) -mediawiki-selenium (0.1.12) +mediawiki-selenium (0.1.13) cucumber json net-http-persistent @@ -33,7 +33,7 @@ multi_json (1.8.2) multi_test (0.0.2) net-http-persistent (2.9) -page-object (0.9.3) +page-object (0.9.4) page_navigation (= 0.8) selenium-webdriver (= 2.37.0) watir-webdriver (= 0.6.4) @@ -41,13 +41,13 @@ data_magic (= 0.14) rest-client (1.6.7) mime-types (= 1.16) -rspec-expectations (2.14.3) +rspec-expectations (2.14.4) diff-lcs (= 1.1.3, 2.0) -rubyzip (1.0.0) -selenium-webdriver (2.37.0) +rubyzip (1.1.0) +selenium-webdriver (2.38.0) childprocess (= 0.2.5) multi_json (~ 1.0) - rubyzip (~ 1.0.0) + rubyzip (~ 1.0) websocket (~ 1.0.4) syntax (1.0.0) watir-webdriver (0.6.4) -- To view, visit https://gerrit.wikimedia.org/r/99669 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4467ed4ec1b3d7007f4293e3791f41502ce05959 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Zfilipin zfili...@wikimedia.org Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org Gerrit-Reviewer: Jhall jh...@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 vagrant roles for MultimediaViewer and CommonsMetadata - change (mediawiki/vagrant)
jenkins-bot has submitted this change and it was merged. Change subject: Add vagrant roles for MultimediaViewer and CommonsMetadata .. Add vagrant roles for MultimediaViewer and CommonsMetadata Bug: 56407 Change-Id: I4cce21a38abe36cfece98313cccf947acde0708c --- M puppet/manifests/roles.pp 1 file changed, 22 insertions(+), 0 deletions(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified diff --git a/puppet/manifests/roles.pp b/puppet/manifests/roles.pp index c4d7c1e..af5ee18 100644 --- a/puppet/manifests/roles.pp +++ b/puppet/manifests/roles.pp @@ -703,3 +703,25 @@ ], } } + +# == Class: role::commonsmetadata +# This role provisions the CommonsMetadata extension, +# which adds image metadata extracted from the +# description page to the imageinfo API. +class role::commonsmetadata { +include role::mediawiki +include role::multimedia + +@mediawiki::extension { 'CommonsMetadata': } +} + +# == Class: role::multimediaviewer +# This role provisions the MultimediaViewer extension, +# which shows images and their metadata in a lightbox +# when the user clicks on the thumbnails. +class role::multimediaviewer { +include role::mediawiki +include role::multimedia + +@mediawiki::extension { 'MultimediaViewer': } +} -- To view, visit https://gerrit.wikimedia.org/r/99646 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4cce21a38abe36cfece98313cccf947acde0708c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Gergő Tisza gti...@wikimedia.org Gerrit-Reviewer: BryanDavis bda...@wikimedia.org Gerrit-Reviewer: Ori.livneh 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] varnish (3.0.3plus~rc1-wm25) precise; urgency=low - change (operations...varnish)
BBlack has submitted this change and it was merged. Change subject: varnish (3.0.3plus~rc1-wm25) precise; urgency=low .. varnish (3.0.3plus~rc1-wm25) precise; urgency=low * Fix HTTP/0.9 issue (return 400 on request) -- Brandon Black bbl...@wikimedia.org Fri, 06 Dec 2013 15:48:19 + Change-Id: Iab87679539a6391b8f0a86c329bcc9c043087af6 --- M debian/changelog A debian/patches/0025-varnishd-http09.patch M debian/patches/series 3 files changed, 20 insertions(+), 0 deletions(-) Approvals: BBlack: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/debian/changelog b/debian/changelog index 51c4ff7..9543182 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +varnish (3.0.3plus~rc1-wm25) precise; urgency=low + + * Fix HTTP/0.9 issue (return 400 on request) + + -- Brandon Black bbl...@wikimedia.org Fri, 06 Dec 2013 15:48:19 + + varnish (3.0.3plus~rc1-wm24) precise; urgency=low * update netmapper to 418eb681 diff --git a/debian/patches/0025-varnishd-http09.patch b/debian/patches/0025-varnishd-http09.patch new file mode 100644 index 000..254c4a6 --- /dev/null +++ b/debian/patches/0025-varnishd-http09.patch @@ -0,0 +1,13 @@ +diff --git a/bin/varnishd/cache_http.c b/bin/varnishd/cache_http.c +index 76b3f86..c96d29b 100644 +--- a/bin/varnishd/cache_http.c b/bin/varnishd/cache_http.c +@@ -675,6 +675,8 @@ http_DissectRequest(struct sess *sp) + return (retval); + } + http_ProtoVer(hp); ++ if(hp-protover 10) ++ retval = 400; + return (retval); + } + diff --git a/debian/patches/series b/debian/patches/series index aeb6a37..218ea08 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -12,5 +12,6 @@ 0010-varnishtest-rxbytes.patch 0020-filter-headers.patch 0020-varnishd-esi-gzip-fix.patch +0025-varnishd-http09.patch 0098-libvmod-netmapper-src.patch 0099-libvmod-netmapper-ac.patch -- To view, visit https://gerrit.wikimedia.org/r/99670 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iab87679539a6391b8f0a86c329bcc9c043087af6 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/varnish Gerrit-Branch: testing/3.0.3plus-rc1 Gerrit-Owner: BBlack bbl...@wikimedia.org Gerrit-Reviewer: BBlack bbl...@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] varnish (3.0.3plus~rc1-wm25) precise; urgency=low - change (operations...varnish)
BBlack has uploaded a new change for review. https://gerrit.wikimedia.org/r/99670 Change subject: varnish (3.0.3plus~rc1-wm25) precise; urgency=low .. varnish (3.0.3plus~rc1-wm25) precise; urgency=low * Fix HTTP/0.9 issue (return 400 on request) -- Brandon Black bbl...@wikimedia.org Fri, 06 Dec 2013 15:48:19 + Change-Id: Iab87679539a6391b8f0a86c329bcc9c043087af6 --- M debian/changelog A debian/patches/0025-varnishd-http09.patch M debian/patches/series 3 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/varnish refs/changes/70/99670/1 diff --git a/debian/changelog b/debian/changelog index 51c4ff7..9543182 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +varnish (3.0.3plus~rc1-wm25) precise; urgency=low + + * Fix HTTP/0.9 issue (return 400 on request) + + -- Brandon Black bbl...@wikimedia.org Fri, 06 Dec 2013 15:48:19 + + varnish (3.0.3plus~rc1-wm24) precise; urgency=low * update netmapper to 418eb681 diff --git a/debian/patches/0025-varnishd-http09.patch b/debian/patches/0025-varnishd-http09.patch new file mode 100644 index 000..254c4a6 --- /dev/null +++ b/debian/patches/0025-varnishd-http09.patch @@ -0,0 +1,13 @@ +diff --git a/bin/varnishd/cache_http.c b/bin/varnishd/cache_http.c +index 76b3f86..c96d29b 100644 +--- a/bin/varnishd/cache_http.c b/bin/varnishd/cache_http.c +@@ -675,6 +675,8 @@ http_DissectRequest(struct sess *sp) + return (retval); + } + http_ProtoVer(hp); ++ if(hp-protover 10) ++ retval = 400; + return (retval); + } + diff --git a/debian/patches/series b/debian/patches/series index aeb6a37..218ea08 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -12,5 +12,6 @@ 0010-varnishtest-rxbytes.patch 0020-filter-headers.patch 0020-varnishd-esi-gzip-fix.patch +0025-varnishd-http09.patch 0098-libvmod-netmapper-src.patch 0099-libvmod-netmapper-ac.patch -- To view, visit https://gerrit.wikimedia.org/r/99670 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iab87679539a6391b8f0a86c329bcc9c043087af6 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/varnish Gerrit-Branch: testing/3.0.3plus-rc1 Gerrit-Owner: BBlack bbl...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (bug #56685) localize quantities when formatting. - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: (bug #56685) localize quantities when formatting. .. (bug #56685) localize quantities when formatting. NOTE: for parsing of localized quantities, see I996e8d032a4. IMPORTANT: requires Ie0ea0d5b921b3f42 Change-Id: Ia6701a202cb05e535ef70ce9ef2fd3b7d2583ecc --- M lib/WikibaseLib.classes.php A lib/includes/formatters/MediaWikiNumberLocalizer.php M lib/includes/formatters/WikibaseValueFormatterBuilders.php M lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php 4 files changed, 53 insertions(+), 3 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 4bb20af..933ecd3 100644 --- a/lib/WikibaseLib.classes.php +++ b/lib/WikibaseLib.classes.php @@ -126,6 +126,7 @@ 'Wikibase\Lib\UnDeserializableValueFormatter' = 'includes/formatters/UnDeserializableValueFormatter.php', 'Wikibase\Lib\WikibaseSnakFormatterBuilders' = 'includes/formatters/WikibaseSnakFormatterBuilders.php', 'Wikibase\Lib\WikibaseValueFormatterBuilders' = 'includes/formatters/WikibaseValueFormatterBuilders.php', + 'Wikibase\Lib\MediaWikiNumberLocalizer' = 'includes/formatters/MediaWikiNumberLocalizer.php', // includes/IO 'Wikibase\IO\LineReader' = 'includes/IO/LineReader.php', diff --git a/lib/includes/formatters/MediaWikiNumberLocalizer.php b/lib/includes/formatters/MediaWikiNumberLocalizer.php new file mode 100644 index 000..dbf162d --- /dev/null +++ b/lib/includes/formatters/MediaWikiNumberLocalizer.php @@ -0,0 +1,38 @@ +?php + +namespace Wikibase\Lib; + +use InvalidArgumentException; +use Language; +use ValueFormatters\FormatterOptions; +use ValueFormatters\Localizer; + +/** + * Localizes a numeric string using MediaWiki's Language class. + * + * @since 0.5 + * + * @licence GNU GPL v2+ + * @author Daniel Kinzler + */ +class MediaWikiNumberLocalizer implements Localizer { + + /** +* @see Localizer::localize() +* +* @since 0.5 +* +* @param string $number a numeric string +* @param string $language a language code +* @param FormatterOptions $options +* +* @return string +* @throws InvalidArgumentException +*/ + public function localize( $number, $language, FormatterOptions $options ) { + $language = Language::factory( $language ); + + $localiezdNumber = $language-formatNum( $number ); + return $localiezdNumber; + } +} diff --git a/lib/includes/formatters/WikibaseValueFormatterBuilders.php b/lib/includes/formatters/WikibaseValueFormatterBuilders.php index b61b9dc..81c77dd 100644 --- a/lib/includes/formatters/WikibaseValueFormatterBuilders.php +++ b/lib/includes/formatters/WikibaseValueFormatterBuilders.php @@ -8,10 +8,8 @@ use ValueFormatters\QuantityFormatter; use ValueFormatters\ValueFormatter; use Wikibase\EntityLookup; -use Wikibase\Item; use Wikibase\LanguageFallbackChain; use Wikibase\LanguageFallbackChainFactory; -use Wikibase\LanguageWithConversion; /** * Defines the formatters for DataValues supported by Wikibase. @@ -479,7 +477,8 @@ */ protected static function newQuantityFormatter( FormatterOptions $options, $builders ) { //TODO: use a builder for this DecimalFormatter - $decimalFormatter = new DecimalFormatter( $options ); + $localizer = new MediaWikiNumberLocalizer(); + $decimalFormatter = new DecimalFormatter( $options, $localizer ); return new QuantityFormatter( $decimalFormatter, $options ); } diff --git a/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php b/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php index 404ab67..28240ca 100644 --- a/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php +++ b/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php @@ -2,6 +2,7 @@ namespace Wikibase\Lib\Test; use DataValues\StringValue; +use DataValues\QuantityValue; use DataValues\TimeValue; use Language; use ValueFormatters\FormatterOptions; @@ -74,6 +75,10 @@ ValueFormatter::OPT_LANG = 'en', ) ); + $optionsDe = new FormatterOptions( array( + ValueFormatter::OPT_LANG = 'de', + ) ); + return array( 'plain url' = array( SnakFormatter::FORMAT_PLAIN, @@ -104,6 +109,12 @@ $options, new StringValue( 'http://acme.com/' ), 'lt;http://acme.com/gt;' + ), +
[MediaWiki-commits] [Gerrit] Fix fetching ParserOutput - change (mediawiki...CirrusSearch)
jenkins-bot has submitted this change and it was merged. Change subject: Fix fetching ParserOutput .. Fix fetching ParserOutput WikiPage::getParserOutput() can return false when we don't hit the parser cache and we're unable to parse due to something like slave lag and our rev_id can't be found. We also don't really want to use the pool counter here either, so just request from the parser cache then fall back to Content::getParserOutput() if we have to parse. This is bug 53938 in a new form, which survived refactoring. You'd think I would learn by now. Bug: 58011 Change-Id: I3a148e92942f1b4f42cb53cebaf8abf34be6902b --- M includes/CirrusSearchUpdater.php 1 file changed, 26 insertions(+), 2 deletions(-) Approvals: Manybubbles: Checked; Looks good to me, approved jenkins-bot: Verified diff --git a/includes/CirrusSearchUpdater.php b/includes/CirrusSearchUpdater.php index d375a42..d36cefd 100644 --- a/includes/CirrusSearchUpdater.php +++ b/includes/CirrusSearchUpdater.php @@ -314,8 +314,11 @@ if ( !$skipParse ) { wfProfileIn( __METHOD__ . '-parse' ); - $parserOutput = $page-getParserOutput( new ParserOptions(), $page-getRevision()-getId() ); - $text = self::buildTextToIndex( $page-getContent(), $parserOutput ); + + // Get text to index, based on content and parser output + list( $content, $parserOutput ) = self::getContentAndParserOutput( $page ); + $text = self::buildTextToIndex( $content, $parserOutput ); + $doc-add( 'text', $text ); $doc-add( 'text_bytes', strlen( $text ) ); $doc-add( 'text_words', str_word_count( $text ) ); // It would be better if we could let ES calculate it @@ -444,6 +447,27 @@ } /** +* Fetch page's content and parser output, using the parser cache if we can +* +* @param WikiPage $page The wikipage to get output for +* @return array(Content,ParserOutput) +*/ + private static function getContentAndParserOutput( $page ) { + $content = $page-getContent(); + $parserOptions = $page-makeParserOptions( 'canonical' ); + $parserOutput = ParserCache::singleton()-get( $page, $parserOptions ); + if ( !$parserOutput ) { + // We specify the revision ID here. There might be a newer revision, + // but we don't care because (a) we've already got a job somewhere + // in the queue to index it, and (b) we want magic words like + // {{REVISIONUSER}} to be accurate + $revId = $page-getRevision()-getId(); + $parserOutput = $content-getParserOutput( $page-getTitle(), $revId ); + } + return array( $content, $parserOutput ); + } + + /** * Fetch text to index. If $content is wikitext then render and clean it. Otherwise delegate * to the $content itself and then to SearchUpdate::updateText to clean the result. * @param $content Content of page -- To view, visit https://gerrit.wikimedia.org/r/99274 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3a148e92942f1b4f42cb53cebaf8abf34be6902b Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: Chad ch...@wikimedia.org Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Chad ch...@wikimedia.org Gerrit-Reviewer: Manybubbles never...@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] Revert Point the puppet freshness check to nagios.wmflabs.org - change (operations/puppet)
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/99671 Change subject: Revert Point the puppet freshness check to nagios.wmflabs.org .. Revert Point the puppet freshness check to nagios.wmflabs.org (This didn't work, reasons unclear.) This reverts commit a4e263183b8c1fabf67e3765a10d472d6ed398bf. Change-Id: Id9f44b0e22402d44e84ad572c0b2510021c4a8e8 --- M modules/base/manifests/init.pp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/71/99671/1 diff --git a/modules/base/manifests/init.pp b/modules/base/manifests/init.pp index 706c2e8..d2a11af 100644 --- a/modules/base/manifests/init.pp +++ b/modules/base/manifests/init.pp @@ -123,7 +123,7 @@ } 'labs': { exec { 'puppet snmp trap': -command = snmptrap -v 1 -c public nagios.wmflabs.org .1.3.6.1.4.1.33298 ${::instancename}.${::site}.wmflabs 6 1004 `uptime | awk '{ split(\$3,a,\:\); print (a[1]*60+a[2])*60 }'`, +command = snmptrap -v 1 -c public nagios-main.pmtpa.wmflabs .1.3.6.1.4.1.33298 ${::instancename}.${::site}.wmflabs 6 1004 `uptime | awk '{ split(\$3,a,\:\); print (a[1]*60+a[2])*60 }'`, path = /bin:/usr/bin, require = Package['snmp'] } -- To view, visit https://gerrit.wikimedia.org/r/99671 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id9f44b0e22402d44e84ad572c0b2510021c4a8e8 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott abog...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix script error in IE - change (mediawiki...UploadWizard)
jenkins-bot has submitted this change and it was merged. Change subject: Fix script error in IE .. Fix script error in IE IE 8 throws an error when doing ``$( 'button' ).prop( 'type', 'button' )`` Regression by I44e92fdda6cebf5188ccfade3863219558423d8f Bug: 58100 Change-Id: I30bb876a5afee629e60f11cdee58adb6ed5be214 --- M resources/mw.UploadWizardDetails.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/mw.UploadWizardDetails.js b/resources/mw.UploadWizardDetails.js index 497b5e3..c826505 100644 --- a/resources/mw.UploadWizardDetails.js +++ b/resources/mw.UploadWizardDetails.js @@ -170,7 +170,7 @@ // .append( $( 'div class=mwe-location-alt-label/div' ).append( mw.message( 'mwe-upwiz-location-alt' ).text() ) ) // .append( _this.altInput ); - var showMap = $( 'button' ).prop( 'type', 'button' ).prop( 'size', 20 ) + var showMap = $( 'button type=button size=20/button' ) .addClass( 'mwe-upwiz-buttons' ) .msg( 'mwe-upwiz-location-button' ) .button() -- To view, visit https://gerrit.wikimedia.org/r/99661 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I30bb876a5afee629e60f11cdee58adb6ed5be214 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: Rillke rainerril...@hotmail.com Gerrit-Reviewer: Gergő Tisza gti...@wikimedia.org Gerrit-Reviewer: Inchikutty inchikutt...@gmail.com Gerrit-Reviewer: MarkTraceur mtrac...@member.fsf.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] Revert Point the puppet freshness check to nagios.wmflabs.org - change (operations/puppet)
Andrew Bogott has submitted this change and it was merged. Change subject: Revert Point the puppet freshness check to nagios.wmflabs.org .. Revert Point the puppet freshness check to nagios.wmflabs.org (This didn't work, reasons unclear.) This reverts commit a4e263183b8c1fabf67e3765a10d472d6ed398bf. Change-Id: Id9f44b0e22402d44e84ad572c0b2510021c4a8e8 --- M modules/base/manifests/init.pp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Andrew Bogott: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/base/manifests/init.pp b/modules/base/manifests/init.pp index 084d6b8..1c5c94d 100644 --- a/modules/base/manifests/init.pp +++ b/modules/base/manifests/init.pp @@ -123,7 +123,7 @@ } 'labs': { exec { 'puppet snmp trap': -command = snmptrap -v 1 -c public nagios.wmflabs.org .1.3.6.1.4.1.33298 ${::instancename}.${::site}.wmflabs 6 1004 `uptime | awk '{ split(\$3,a,\:\); print (a[1]*60+a[2])*60 }'`, +command = snmptrap -v 1 -c public nagios-main.pmtpa.wmflabs .1.3.6.1.4.1.33298 ${::instancename}.${::site}.wmflabs 6 1004 `uptime | awk '{ split(\$3,a,\:\); print (a[1]*60+a[2])*60 }'`, path = /bin:/usr/bin, require = Package['snmp'] } -- To view, visit https://gerrit.wikimedia.org/r/99671 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id9f44b0e22402d44e84ad572c0b2510021c4a8e8 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott abog...@wikimedia.org Gerrit-Reviewer: Andrew Bogott abog...@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] Added an additional snmp trap. - change (operations/puppet)
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/99672 Change subject: Added an additional snmp trap. .. Added an additional snmp trap. This is so monitoring-devel can gather puppet freshness stats for me to mess with. Change-Id: Ia3cce04ef987d5a117d23532d616fab3ab266c34 --- M modules/base/manifests/init.pp 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/72/99672/1 diff --git a/modules/base/manifests/init.pp b/modules/base/manifests/init.pp index 1c5c94d..c4b816f 100644 --- a/modules/base/manifests/init.pp +++ b/modules/base/manifests/init.pp @@ -127,6 +127,13 @@ path = /bin:/usr/bin, require = Package['snmp'] } +# This is a temporary check so that I can do some +# reporting about puppet freshness. (abogott, 2013-12-06) +exec { 'puppet snmp reporting': +command = snmptrap -v 1 -c public monitoring-devel.pmtpa.wmflabs .1.3.6.1.4.1.33298 ${::instancename}.${::site}.wmflabs 6 1004 `uptime | awk '{ split(\$3,a,\:\); print (a[1]*60+a[2])*60 }'`, +path = /bin:/usr/bin, +require = Package['snmp'] +} } default: { err('realm must be either labs or production.') -- To view, visit https://gerrit.wikimedia.org/r/99672 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3cce04ef987d5a117d23532d616fab3ab266c34 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott abog...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (bug #56685) Parsing of localized quantities. - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: (bug #56685) Parsing of localized quantities. .. (bug #56685) Parsing of localized quantities. This introduces MediaWikiNumberUnlocalizer which relies on MediaWiki's Language class for converting numbers to canonical form. IMPORTANT: requires I9acb56d4f7f4 to be merged. (done) Change-Id: I996e8d032a476d245bbfc2872d7eae4bbad79cb1 --- M lib/WikibaseLib.classes.php M lib/WikibaseLib.php A lib/includes/parsers/MediaWikiNumberUnlocalizer.php A lib/tests/phpunit/parsers/MediaWikiNumberUnlocalizerTest.php 4 files changed, 86 insertions(+), 0 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 4bb20af..92aabbd 100644 --- a/lib/WikibaseLib.classes.php +++ b/lib/WikibaseLib.classes.php @@ -138,6 +138,7 @@ // includes/parsers 'Wikibase\Lib\EntityIdParser' = 'includes/parsers/EntityIdParser.php', + 'Wikibase\Lib\MediaWikiNumberUnlocalizer' = 'includes/parsers/MediaWikiNumberUnlocalizer.php', // includes/specials 'Wikibase\Lib\Specials\SpecialWikibasePage' = 'includes/specials/SpecialWikibasePage.php', diff --git a/lib/WikibaseLib.php b/lib/WikibaseLib.php index 9e819b1..2315187 100644 --- a/lib/WikibaseLib.php +++ b/lib/WikibaseLib.php @@ -136,7 +136,15 @@ // i18n $wgExtensionMessagesFiles['WikibaseLib'] = __DIR__ . '/WikibaseLib.i18n.php'; + // This is somewhat hackish, make WikibaseValueParserBuilders, analogous to WikibaseValueFormatterBuilders $wgValueParsers['wikibase-entityid'] = 'Wikibase\Lib\EntityIdParser'; + $wgValueParsers['quantity'] = function( ValueParsers\ParserOptions $options ) { + $unlocalizer = new Wikibase\Lib\MediaWikiNumberUnlocalizer(); + return new \ValueParsers\QuantityParser( + new \ValueParsers\DecimalParser( $options, $unlocalizer ), + $options ); + }; + $wgDataValues['wikibase-entityid'] = 'Wikibase\DataModel\Entity\EntityIdValue'; $wgJobClasses['ChangeNotification'] = 'Wikibase\ChangeNotificationJob'; $wgJobClasses['UpdateRepoOnMove'] = 'Wikibase\UpdateRepoOnMoveJob'; diff --git a/lib/includes/parsers/MediaWikiNumberUnlocalizer.php b/lib/includes/parsers/MediaWikiNumberUnlocalizer.php new file mode 100644 index 000..b802bf3 --- /dev/null +++ b/lib/includes/parsers/MediaWikiNumberUnlocalizer.php @@ -0,0 +1,33 @@ +?php + +namespace Wikibase\Lib; +use Language; +use ValueParsers\ParserOptions; +use ValueParsers\Unlocalizer; + +/** + * MediaWikiNumberUnlocalizer + * + * @since 0.5 + * + * @license GPL 2+ + * @author Daniel Kinzler + */ +class MediaWikiNumberUnlocalizer implements Unlocalizer { + + /** +* @see Unlocalizer::unlocalize() +* +* @param string $number string to process +* @param string $language language code +* @param ParserOptions $options +* +* @return string unlocalized string +*/ + public function unlocalize( $number, $language, ParserOptions $options ) { + $language = Language::factory( $language ); + + $canonicalizedNumber = $language-parseFormattedNumber( $number ); + return $canonicalizedNumber; + } +} diff --git a/lib/tests/phpunit/parsers/MediaWikiNumberUnlocalizerTest.php b/lib/tests/phpunit/parsers/MediaWikiNumberUnlocalizerTest.php new file mode 100644 index 000..a20bcae --- /dev/null +++ b/lib/tests/phpunit/parsers/MediaWikiNumberUnlocalizerTest.php @@ -0,0 +1,44 @@ +?php + +namespace Wikibase\Lib\Test; + +use ValueParsers\ParserOptions; +use Wikibase\Lib\MediaWikiNumberUnlocalizer; + +/** + * @covers Wikibase\Lib\MediaWikiNumberUnlocalizer + * + * @since 0.5 + * + * @group ValueParsers + * @group WikibaseLib + * @group Wikibase + * + * @licence GNU GPL v2+ + * @author Daniel Kinzler + */ +class MediaWikiNumberUnlocalizerTest extends \PHPUnit_Framework_TestCase { + + public function provideUnlocalize() { + return array( + array( '123,456.789', 'en', '123456.789' ), + array( '123.456,789', 'de', '123456.789' ), + ); + } + + /** +* @dataProvider provideUnlocalize +* +* @param $localized +* @param $lang +* @param $expected +*/ + public function testUnlocalize( $localized, $lang, $expected ) { + $unlocalizer = new MediaWikiNumberUnlocalizer(); + $options = new ParserOptions(); + + $actual = $unlocalizer-unlocalize( $localized, $lang, $options ); + + $this-assertEquals( $expected, $actual ); + } +} -- To view, visit
[MediaWiki-commits] [Gerrit] Browsertests: wait for entity to load after page-reload - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Browsertests: wait for entity to load after page-reload .. Browsertests: wait for entity to load after page-reload Change-Id: I3af1c0819c2c7049338655a914e8609d5fa4ae78 --- M selenium_cuc/features/step_definitions/entity_steps.rb 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Tobias Gritschacher: Looks good to me, approved jenkins-bot: Verified diff --git a/selenium_cuc/features/step_definitions/entity_steps.rb b/selenium_cuc/features/step_definitions/entity_steps.rb index 0827acd..2cdba7f 100644 --- a/selenium_cuc/features/step_definitions/entity_steps.rb +++ b/selenium_cuc/features/step_definitions/entity_steps.rb @@ -52,4 +52,5 @@ When /^I reload the page$/ do @browser.refresh + on(ItemPage).wait_for_entity_to_load end -- To view, visit https://gerrit.wikimedia.org/r/99639 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3af1c0819c2c7049338655a914e8609d5fa4ae78 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@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] Add setting to disable displaying parser function errors - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/99673 Change subject: Add setting to disable displaying parser function errors .. Add setting to disable displaying parser function errors this is done with css, so can be displayed for debugging, or customized in other ways. default is to show errors. Change-Id: I3b4edd193e29a2db88185ef5cbf989dc575dbe49 --- M client/WikibaseClient.hooks.php M client/config/WikibaseClient.default.php M client/resources/Resources.php A client/resources/wikibase.client.propertyparsererror.css 4 files changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/73/99673/1 diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php index f47cb8e..ee90ca4 100644 --- a/client/WikibaseClient.hooks.php +++ b/client/WikibaseClient.hooks.php @@ -517,11 +517,16 @@ if ( !empty( $errors ) ) { foreach ( $errors as $errorMessage ) { $out-addWikiText( - 'p class=error' . $errorMessage . '/p' + 'p class=error wikibase-property-parser-error' . $errorMessage . '/p' ); } } + // todo maybe allow this to vary based on anon / logged in userss + if ( Settings::get( 'hideParserFunctionErrors' ) ) { + $out-addModules( 'wikibase.client.propertyparsererror.css' ); + } + return true; } diff --git a/client/config/WikibaseClient.default.php b/client/config/WikibaseClient.default.php index 023b3c3..2c02ec4 100644 --- a/client/config/WikibaseClient.default.php +++ b/client/config/WikibaseClient.default.php @@ -39,6 +39,7 @@ 'allowDataTransclusion' = true, 'enableSiteLinkWidget' = true, 'propagateChangesToRepo' = true, + 'hideParserFunctionErrors' = false, // allows hiding parser function errors with css /** * @todo this is a bit wikimedia-specific and need to find a better place for this stuff, diff --git a/client/resources/Resources.php b/client/resources/Resources.php index d3d3e52..f27005c 100644 --- a/client/resources/Resources.php +++ b/client/resources/Resources.php @@ -25,6 +25,9 @@ 'wikibase.client.changeslist.css' = $moduleTemplate + array( 'styles' = 'wikibase.client.changeslist.css' ), + 'wikibase.client.propertyparsererror.css' = $moduleTemplate + array( + 'styles' = 'wikibase.client.propertyparsererror.css' + ), 'wikibase.client.linkitem.init' = $moduleTemplate + array( 'scripts' = array( 'wikibase.client.linkitem.init.js' diff --git a/client/resources/wikibase.client.propertyparsererror.css b/client/resources/wikibase.client.propertyparsererror.css new file mode 100644 index 000..59b2baf --- /dev/null +++ b/client/resources/wikibase.client.propertyparsererror.css @@ -0,0 +1,6 @@ +/* CSS with the sole purpose to hide property parser + function errors, which can be controlled with + $wgWBClientSettings['hidePropertyParserError'] */ +.wikibase-property-parser-error { + display: none; +} -- To view, visit https://gerrit.wikimedia.org/r/99673 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3b4edd193e29a2db88185ef5cbf989dc575dbe49 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf5 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] Add setting to disable displaying parser function errors - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Add setting to disable displaying parser function errors .. Add setting to disable displaying parser function errors this is done with css, so can be displayed for debugging, or customized in other ways. default is to show errors. Change-Id: I3b4edd193e29a2db88185ef5cbf989dc575dbe49 --- M client/WikibaseClient.hooks.php M client/config/WikibaseClient.default.php M client/resources/Resources.php A client/resources/wikibase.client.propertyparsererror.css 4 files changed, 16 insertions(+), 1 deletion(-) Approvals: Tobias Gritschacher: Looks good to me, approved Aude: Checked; Looks good to me, approved jenkins-bot: Verified diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php index 37152dd..d116b0e 100644 --- a/client/WikibaseClient.hooks.php +++ b/client/WikibaseClient.hooks.php @@ -517,11 +517,16 @@ if ( !empty( $errors ) ) { foreach ( $errors as $errorMessage ) { $out-addWikiText( - 'p class=error wikibase-error' . $errorMessage . '/p' + 'p class=error wikibase-property-parser-error' . $errorMessage . '/p' ); } } + // todo maybe allow this to vary based on anon / logged in users + if ( Settings::get( 'hideParserFunctionErrors' ) ) { + $out-addModules( 'wikibase.client.propertyparsererror' ); + } + return true; } diff --git a/client/config/WikibaseClient.default.php b/client/config/WikibaseClient.default.php index 023b3c3..2c02ec4 100644 --- a/client/config/WikibaseClient.default.php +++ b/client/config/WikibaseClient.default.php @@ -39,6 +39,7 @@ 'allowDataTransclusion' = true, 'enableSiteLinkWidget' = true, 'propagateChangesToRepo' = true, + 'hideParserFunctionErrors' = false, // allows hiding parser function errors with css /** * @todo this is a bit wikimedia-specific and need to find a better place for this stuff, diff --git a/client/resources/Resources.php b/client/resources/Resources.php index d3d3e52..2eb09eb 100644 --- a/client/resources/Resources.php +++ b/client/resources/Resources.php @@ -25,6 +25,9 @@ 'wikibase.client.changeslist.css' = $moduleTemplate + array( 'styles' = 'wikibase.client.changeslist.css' ), + 'wikibase.client.propertyparsererror' = $moduleTemplate + array( + 'styles' = 'wikibase.client.propertyparsererror.css' + ), 'wikibase.client.linkitem.init' = $moduleTemplate + array( 'scripts' = array( 'wikibase.client.linkitem.init.js' diff --git a/client/resources/wikibase.client.propertyparsererror.css b/client/resources/wikibase.client.propertyparsererror.css new file mode 100644 index 000..59b2baf --- /dev/null +++ b/client/resources/wikibase.client.propertyparsererror.css @@ -0,0 +1,6 @@ +/* CSS with the sole purpose to hide property parser + function errors, which can be controlled with + $wgWBClientSettings['hidePropertyParserError'] */ +.wikibase-property-parser-error { + display: none; +} -- To view, visit https://gerrit.wikimedia.org/r/99673 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3b4edd193e29a2db88185ef5cbf989dc575dbe49 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf5 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: Henning Snater henning.sna...@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] Make a single colon a invalid title in php and js - change (mediawiki/core)
Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/99674 Change subject: Make a single colon a invalid title in php and js .. Make a single colon a invalid title in php and js When secureAndSplit will get a single colon as title, the leading colon is stripped and produces a title with a empty string, make this impossible by moving the empty string check after the substring of the colon. Bug: 54044 Change-Id: I574168c9ed281c535901c36dea7c179a4e794d20 --- M includes/Title.php M resources/mediawiki/mediawiki.Title.js M tests/phpunit/includes/TitleTest.php M tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js 4 files changed, 12 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/74/99674/1 diff --git a/includes/Title.php b/includes/Title.php index 820842f..a949ac3 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3163,10 +3163,6 @@ $dbkey = preg_replace( '/[ _\xA0\x{1680}\x{180E}\x{2000}-\x{200A}\x{2028}\x{2029}\x{202F}\x{205F}\x{3000}]+/u', '_', $dbkey ); $dbkey = trim( $dbkey, '_' ); - if ( $dbkey == '' ) { - return false; - } - if ( strpos( $dbkey, UTF8_REPLACEMENT ) !== false ) { # Contained illegal UTF-8 sequences or forbidden Unicode chars. return false; @@ -3176,12 +3172,16 @@ # Initial colon indicates main namespace rather than specified default # but should not create invalid {ns,title} pairs such as {0,Project:Foo} - if ( ':' == $dbkey[0] ) { + if ( $dbkey !== '' ':' == $dbkey[0] ) { $this-mNamespace = NS_MAIN; $dbkey = substr( $dbkey, 1 ); # remove the colon but continue processing $dbkey = trim( $dbkey, '_' ); # remove any subsequent whitespace } + if ( $dbkey == '' ) { + return false; + } + # Namespace or interwiki prefix $firstPass = true; $prefixRegexp = /^(.+?)_*:_*(.*)$/S; diff --git a/resources/mediawiki/mediawiki.Title.js b/resources/mediawiki/mediawiki.Title.js index de2d013..51770fd 100644 --- a/resources/mediawiki/mediawiki.Title.js +++ b/resources/mediawiki/mediawiki.Title.js @@ -126,12 +126,8 @@ // Trim underscores .replace( rUnderscoreTrim, '' ); - if ( title === '' ) { - return false; - } - // Process initial colon - if ( title.charAt( 0 ) === ':' ) { + if ( title !== '' title.charAt( 0 ) === ':' ) { // Initial colon means main namespace instead of specified default namespace = NS_MAIN; title = title @@ -141,6 +137,10 @@ .replace( rUnderscoreTrim, '' ); } + if ( title === '' ) { + return false; + } + // Process namespace prefix (if any) m = title.match( rSplit ); if ( m ) { diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php index 6bfe545..58f0146 100644 --- a/tests/phpunit/includes/TitleTest.php +++ b/tests/phpunit/includes/TitleTest.php @@ -66,6 +66,7 @@ // Invalid foreach ( array( '', + ':', '__ __', ' __ ', // Bad characters forbidden regardless of wgLegalTitleChars diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js index cb0bf69..4083564 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js @@ -80,6 +80,7 @@ ], invalid: [ '', + ':', '__ __', ' __ ', // Bad characters forbidden regardless of wgLegalTitleChars -- To view, visit https://gerrit.wikimedia.org/r/99674 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I574168c9ed281c535901c36dea7c179a4e794d20 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] Add setting to disable displaying parser function errors - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Add setting to disable displaying parser function errors .. Add setting to disable displaying parser function errors this is done with css, so can be displayed for debugging, or customized in other ways. default is to show errors. Change-Id: I3b4edd193e29a2db88185ef5cbf989dc575dbe49 (cherry picked from commit f568d279e65238f86900379a4a8fa83a7a95c349) --- M client/WikibaseClient.hooks.php M client/config/WikibaseClient.default.php M client/resources/Resources.php A client/resources/wikibase.client.propertyparsererror.css 4 files changed, 16 insertions(+), 1 deletion(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php index 37e9cee..90d41f1 100644 --- a/client/WikibaseClient.hooks.php +++ b/client/WikibaseClient.hooks.php @@ -517,11 +517,16 @@ if ( !empty( $errors ) ) { foreach ( $errors as $errorMessage ) { $out-addWikiText( - 'p class=error wikibase-error' . $errorMessage . '/p' + 'p class=error wikibase-property-parser-error' . $errorMessage . '/p' ); } } + // todo maybe allow this to vary based on anon / logged in users + if ( Settings::get( 'hideParserFunctionErrors' ) ) { + $out-addModules( 'wikibase.client.propertyparsererror' ); + } + return true; } diff --git a/client/config/WikibaseClient.default.php b/client/config/WikibaseClient.default.php index 023b3c3..2c02ec4 100644 --- a/client/config/WikibaseClient.default.php +++ b/client/config/WikibaseClient.default.php @@ -39,6 +39,7 @@ 'allowDataTransclusion' = true, 'enableSiteLinkWidget' = true, 'propagateChangesToRepo' = true, + 'hideParserFunctionErrors' = false, // allows hiding parser function errors with css /** * @todo this is a bit wikimedia-specific and need to find a better place for this stuff, diff --git a/client/resources/Resources.php b/client/resources/Resources.php index c2a2f46..e5308bb 100644 --- a/client/resources/Resources.php +++ b/client/resources/Resources.php @@ -26,6 +26,9 @@ 'wikibase.client.changeslist.css' = $moduleTemplate + array( 'styles' = 'wikibase.client.changeslist.css' ), + 'wikibase.client.propertyparsererror' = $moduleTemplate + array( + 'styles' = 'wikibase.client.propertyparsererror.css' + ), 'wikibase.client.linkitem.init' = $moduleTemplate + array( 'scripts' = array( 'wikibase.client.linkitem.init.js' diff --git a/client/resources/wikibase.client.propertyparsererror.css b/client/resources/wikibase.client.propertyparsererror.css new file mode 100644 index 000..59b2baf --- /dev/null +++ b/client/resources/wikibase.client.propertyparsererror.css @@ -0,0 +1,6 @@ +/* CSS with the sole purpose to hide property parser + function errors, which can be controlled with + $wgWBClientSettings['hidePropertyParserError'] */ +.wikibase-property-parser-error { + display: none; +} -- To view, visit https://gerrit.wikimedia.org/r/99675 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3b4edd193e29a2db88185ef5cbf989dc575dbe49 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.23-wmf6 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add missng uploadstash.us_props for PostgreSQL - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/99676 Change subject: Add missng uploadstash.us_props for PostgreSQL .. Add missng uploadstash.us_props for PostgreSQL This field was introduced in e5d41cca909a8ec1b19c6c080388c885854be3f7 but only for MySQL. Change-Id: I057b1dd845a5ab7ae05f5597454981a6e2c12698 --- M includes/installer/PostgresUpdater.php M maintenance/postgres/tables.sql 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/76/99676/1 diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index e8a1c80..dd07bc2 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -169,6 +169,7 @@ INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('archive_ar_id_seq') ), array( 'addPgField', 'externallinks', 'el_id', INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('externallinks_el_id_seq') ), + array( 'addPgField', 'uploadstash', 'us_props', BYTEA ), # type changes array( 'changeField', 'archive', 'ar_deleted', 'smallint', '' ), diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index d0d1e92..37c8cf6 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -376,6 +376,7 @@ us_key TEXT, us_orig_pathTEXT, us_path TEXT, + us_propsBYTEA, us_source_type TEXT, us_timestampTIMESTAMPTZ, us_status TEXT, -- To view, visit https://gerrit.wikimedia.org/r/99676 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I057b1dd845a5ab7ae05f5597454981a6e2c12698 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add a new config option for an API proxy endpoint - change (mediawiki...Parsoid)
jenkins-bot has submitted this change and it was merged. Change subject: Add a new config option for an API proxy endpoint .. Add a new config option for an API proxy endpoint Create a new configuration directive, to be passed through as the proxy option to the requests module on calls that hit the API endpoints. This can be used to provide either a forward proxy (e.g. for some weird isolated environment scenario) or, in Wikimedia's case, to provide the service IP for the API application servers, as to be able to connect directly to them, rather than going through the multiple caching layers in front of them. Hence, remove the ?random=pid hacks that have been introduced with Ie9554f8ea7f19b3271857bdc10e7ea6fa808dec to help with internal load-balancing between caching layers, as they shouldn't be needed anymore. While at it, rename requests' url option to uri, as this is the documented and preferred way; the code internally maps url to uri, as it's a common mistake, but we shouldn't make it. Bug: 51273 Change-Id: I76c7a133d05f432d692fb82df196c4a1051e2e43 --- M js/api/localsettings.js.example M js/lib/mediawiki.ApiRequest.js 2 files changed, 24 insertions(+), 19 deletions(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/js/api/localsettings.js.example b/js/api/localsettings.js.example index c9bf938..2e0567f 100644 --- a/js/api/localsettings.js.example +++ b/js/api/localsettings.js.example @@ -10,6 +10,9 @@ // The URL here is supposed to be your MediaWiki API endpoint parsoidConfig.setInterwiki( 'localhost', 'http://localhost/w/api.php' ); + // a proxy to connect to the API endpoints + // parsoidConfig.apiProxyURI = 'http://proxy.example.org:8080/'; + // Enable debug mode (prints extra debugging messages) // parsoidConfig.debug = true; diff --git a/js/lib/mediawiki.ApiRequest.js b/js/lib/mediawiki.ApiRequest.js index 665356f..c49da4f 100644 --- a/js/lib/mediawiki.ApiRequest.js +++ b/js/lib/mediawiki.ApiRequest.js @@ -150,7 +150,7 @@ this._handleBody( null, body ); } else { if (response.statusCode === 412) { - console.warn('Cache MISS:', this.url); + console.warn('Cache MISS:', this.uri); } else { console.warn( 'non-200 response: ' + response.statusCode ); console.log( body ); @@ -231,15 +231,16 @@ apiargs.revids = oldid; delete apiargs.titles; } - var url = env.conf.wiki.apiURI + '?' + + var uri = env.conf.wiki.apiURI + '?' + qs.stringify( apiargs ); //'?format=jsonaction=queryprop=revisionsrvprop=contenttitles=' + title; this.requestOptions = { method: 'GET', followRedirect: true, - url: url, + uri: uri, timeout: 40 * 1000, // 40 seconds + proxy: env.conf.parsoid.apiProxyURI, headers: { 'User-Agent': userAgent, 'Cookie': env.cookie, @@ -360,8 +361,7 @@ title: title, text: text }; - // Randomize the POST url so that we hit different Squids - var url = env.conf.wiki.apiURI + '?random=' + process.pid; + var uri = env.conf.wiki.apiURI; this.requestOptions = { // Use POST since we are passing a bit of source, and GET has a very @@ -370,8 +370,9 @@ method: 'POST', form: apiargs, // The API arguments followRedirect: true, - url: url, + uri: uri, timeout: 16 * 1000, // 16 seconds + proxy: env.conf.parsoid.apiProxyURI, headers: { 'User-Agent': userAgent, 'Cookie': env.cookie, @@ -459,10 +460,7 @@ text: text, disablepp: 'true' }; - // Randomize the POST url so that we hit different Squids - // TODO: cut out squids completely. See - // https://bugzilla.wikimedia.org/show_bug.cgi?id=51273 - var url = env.conf.wiki.apiURI + '?random=' + process.pid; + var uri = env.conf.wiki.apiURI; this.requestOptions = { // Use POST since we are passing a bit of source, and GET has a very @@ -471,8 +469,9 @@ method: 'POST', form: apiargs, // The API arguments followRedirect: true, - url: url, + uri: uri, timeout: 16 * 1000, // 16 seconds + proxy: env.conf.parsoid.apiProxyURI, headers: { 'User-Agent': userAgent, 'Cookie': env.cookie, @@ -544,12 +543,12 @@
[MediaWiki-commits] [Gerrit] generalize BitmapHandler::logErrorForExternalProcess - change (mediawiki/core)
Brian Wolff has submitted this change and it was merged. Change subject: generalize BitmapHandler::logErrorForExternalProcess .. generalize BitmapHandler::logErrorForExternalProcess BitmapHandler::logErrorForExternalProcess is a wrapper around wfDebugLog( 'thumbnail' ). It got copy pasted from some other class at one point. This patch move the method up to general class MediaHandler and makes other child class uses it. The method will thus be available to extensions such as TimedMediaHandler. The reason I am doing that is that trim($err) generates a copy of $err which causes a memory allocation fatal error whenever $err is larger than the remaining memory allocatable. The patch will let us fix the bug by only altering one part of the code. bug: 57985 Change-Id: I5657f07d6e2cca05d53f2a5c30ec23622c171343 --- M includes/media/Bitmap.php M includes/media/DjVu.php M includes/media/MediaHandler.php M includes/media/SVG.php 4 files changed, 19 insertions(+), 20 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index 6f7130d..804393a 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -496,19 +496,6 @@ } /** -* Log an error that occurred in an external process -* -* @param $retval int -* @param $err int -* @param $cmd string -*/ - protected function logErrorForExternalProcess( $retval, $err, $cmd ) { - wfDebugLog( 'thumbnail', - sprintf( 'thumbnail failed on %s: error %d %s from %s', - wfHostname(), $retval, trim( $err ), $cmd ) ); - } - - /** * Get a MediaTransformError with error 'thumbnail_error' * * @param array $params Parameter array as passed to the transform* functions diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php index fe3313a..ae46b2e 100644 --- a/includes/media/DjVu.php +++ b/includes/media/DjVu.php @@ -195,10 +195,7 @@ $removed = $this-removeBadFile( $dstPath, $retval ); if ( $retval != 0 || $removed ) { - wfDebugLog( 'thumbnail', - sprintf( 'thumbnail failed on %s: error %d %s from %s', - wfHostname(), $retval, trim( $err ), $cmd ) ); - + $this-logErrorForExternalProcess( $retval, $err, $cmd ); return new MediaTransformError( 'thumbnail_error', $width, $height, $err ); } else { $params = array( diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index f55e508..562de13 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -703,4 +703,21 @@ public function getRotation( $file ) { return 0; } + + /** +* Log an error that occurred in an external process +* +* Moved from BitmapHandler to MediaHandler with MediaWiki 1.23 +* +* @since 1.23 +* @param $retval int +* @param $err int +* @param $cmd string +*/ + protected function logErrorForExternalProcess( $retval, $err, $cmd ) { + wfDebugLog( 'thumbnail', + sprintf( 'thumbnail failed on %s: error %d %s from %s', + wfHostname(), $retval, trim( $err ), $cmd ) ); + } + } diff --git a/includes/media/SVG.php b/includes/media/SVG.php index d06acd8..fef67f8 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -208,9 +208,7 @@ } $removed = $this-removeBadFile( $dstPath, $retval ); if ( $retval != 0 || $removed ) { - wfDebugLog( 'thumbnail', sprintf( 'thumbnail failed on %s: error %d %s from %s', - wfHostname(), $retval, trim( $err ), $cmd ) ); - + $this-logErrorForExternalProcess( $retval, $err, $cmd ); return new MediaTransformError( 'thumbnail_error', $width, $height, $err ); } -- To view, visit https://gerrit.wikimedia.org/r/99142 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5657f07d6e2cca05d53f2a5c30ec23622c171343 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Hashar has...@free.fr Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: Brian Wolff bawolff...@gmail.com Gerrit-Reviewer: Gergő Tisza gti...@wikimedia.org Gerrit-Reviewer: Hashar has...@free.fr Gerrit-Reviewer: J jger...@wikimedia.org Gerrit-Reviewer: Tpt thoma...@hotmail.fr Gerrit-Reviewer:
[MediaWiki-commits] [Gerrit] Update Wikibase, for issue with parser function - change (mediawiki/core)
Reedy has submitted this change and it was merged. Change subject: Update Wikibase, for issue with parser function .. Update Wikibase, for issue with parser function Bug: 58099 Change-Id: I06994427b780cd0b66dc0b0279045df7699aef1c --- M extensions/Wikibase 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/extensions/Wikibase b/extensions/Wikibase index a103765..f568d27 16 --- a/extensions/Wikibase +++ b/extensions/Wikibase -Subproject commit a1037651592c406aa4181ce9fc1d580fc2dd6851 +Subproject commit f568d279e65238f86900379a4a8fa83a7a95c349 -- To view, visit https://gerrit.wikimedia.org/r/99658 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06994427b780cd0b66dc0b0279045df7699aef1c Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf5 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update DataValues and Wikibase - change (mediawiki/core)
Reedy has submitted this change and it was merged. Change subject: Update DataValues and Wikibase .. Update DataValues and Wikibase see I93f1cb3 for details, fixing js error on test.wikidata in DataValues see I53908d3 about parser function issue (also Id60a046a and I5f55124, minor changes) Change-Id: Ib0084a05616f5d46d4b0ee60ddbcb6c5d9cf0e80 --- M extensions/DataValues M extensions/Wikibase 2 files changed, 0 insertions(+), 0 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/extensions/DataValues b/extensions/DataValues index cf50ddc..1919d65 16 --- a/extensions/DataValues +++ b/extensions/DataValues -Subproject commit cf50ddc5bd944ec61fc354b3fddc423313627026 +Subproject commit 1919d6564687b3475a4b0c63a89046a978c6e293 diff --git a/extensions/Wikibase b/extensions/Wikibase index a103765..779e89a 16 --- a/extensions/Wikibase +++ b/extensions/Wikibase -Subproject commit a1037651592c406aa4181ce9fc1d580fc2dd6851 +Subproject commit 779e89a24ddbe0229d35047e19743630a9567abb -- To view, visit https://gerrit.wikimedia.org/r/99638 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib0084a05616f5d46d4b0ee60ddbcb6c5d9cf0e80 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf6 Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] media: limit size of stderr being logged - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: media: limit size of stderr being logged .. media: limit size of stderr being logged Whenever a rendering commands emit a ton of errors (spotted a case generating 125MB), the call to trim() makes PHP copy the stderr which might exhaust the remaining available memory. The new constant MediaHandler::MAX_ERR_LOG_SIZE = 65535 is used to substr() the error log before it get trimmed and logged. bug: 57985 Change-Id: Ibd4cf0331529d323a68273163ac230b07a6c6108 --- M includes/media/MediaHandler.php 1 file changed, 10 insertions(+), 2 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index 562de13..b002dfb 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -31,6 +31,10 @@ const METADATA_GOOD = true; const METADATA_BAD = false; const METADATA_COMPATIBLE = 2; // for old but backwards compatible. + /** +* Max length of error logged by logErrorForExternalProcess() +*/ + const MAX_ERR_LOG_SIZE = 65535; /** @var MediaHandler[] Instance cache with array of MediaHandler */ protected static $handlers = array(); @@ -711,13 +715,17 @@ * * @since 1.23 * @param $retval int -* @param $err int +* @param $err string Error reported by command. Anything longer than +* MediaHandler::MAX_ERR_LOG_SIZE is stripped off. * @param $cmd string */ protected function logErrorForExternalProcess( $retval, $err, $cmd ) { + # Keep error output limited (bug 57985) + $errMessage = trim( substr( $err, 0, self::MAX_ERR_LOG_SIZE ) ); + wfDebugLog( 'thumbnail', sprintf( 'thumbnail failed on %s: error %d %s from %s', - wfHostname(), $retval, trim( $err ), $cmd ) ); + wfHostname(), $retval, $errMessage, $cmd ) ); } } -- To view, visit https://gerrit.wikimedia.org/r/99157 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibd4cf0331529d323a68273163ac230b07a6c6108 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Hashar has...@free.fr Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Brian Wolff bawolff...@gmail.com Gerrit-Reviewer: Gergő Tisza gti...@wikimedia.org Gerrit-Reviewer: Hashar has...@free.fr Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixing bug where JsonLogster would only report metrics for l... - change (operations...logster)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/99678 Change subject: Fixing bug where JsonLogster would only report metrics for last line in file .. Fixing bug where JsonLogster would only report metrics for last line in file Change-Id: I5f3c2d07e55395f80716c1fdf0b1375f2624a8be --- M logster/parsers/JsonLogster.py 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/logster refs/changes/78/99678/1 diff --git a/logster/parsers/JsonLogster.py b/logster/parsers/JsonLogster.py index a228f64..582aae1 100644 --- a/logster/parsers/JsonLogster.py +++ b/logster/parsers/JsonLogster.py @@ -90,7 +90,11 @@ object's state variables. Takes a single argument, the line to be parsed.''' json_data = json.loads(line) -self.metrics = self.flatten_object(json.loads(line), self.key_separator, self.key_filter) +# Using update() in order to work with multiple lines. +# Since lines are parsed in order as they appear in the file, +# if there are multiple entries for the same key, this will +# end up using the latest value for that key. +self.metrics.update(self.flatten_object(json.loads(line), self.key_separator, self.key_filter)) def get_state(self, duration): '''Run any necessary calculations on the data collected from the logs -- To view, visit https://gerrit.wikimedia.org/r/99678 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f3c2d07e55395f80716c1fdf0b1375f2624a8be Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/logster Gerrit-Branch: master 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] Fixing bug where JsonLogster would only report metrics for l... - change (operations...logster)
Ottomata has submitted this change and it was merged. Change subject: Fixing bug where JsonLogster would only report metrics for last line in file .. Fixing bug where JsonLogster would only report metrics for last line in file Change-Id: I5f3c2d07e55395f80716c1fdf0b1375f2624a8be --- M logster/parsers/JsonLogster.py 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/logster/parsers/JsonLogster.py b/logster/parsers/JsonLogster.py index a228f64..582aae1 100644 --- a/logster/parsers/JsonLogster.py +++ b/logster/parsers/JsonLogster.py @@ -90,7 +90,11 @@ object's state variables. Takes a single argument, the line to be parsed.''' json_data = json.loads(line) -self.metrics = self.flatten_object(json.loads(line), self.key_separator, self.key_filter) +# Using update() in order to work with multiple lines. +# Since lines are parsed in order as they appear in the file, +# if there are multiple entries for the same key, this will +# end up using the latest value for that key. +self.metrics.update(self.flatten_object(json.loads(line), self.key_separator, self.key_filter)) def get_state(self, duration): '''Run any necessary calculations on the data collected from the logs -- To view, visit https://gerrit.wikimedia.org/r/99678 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5f3c2d07e55395f80716c1fdf0b1375f2624a8be Gerrit-PatchSet: 2 Gerrit-Project: operations/debs/logster Gerrit-Branch: master Gerrit-Owner: Ottomata o...@wikimedia.org Gerrit-Reviewer: Ottomata o...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow splitting of single namespaces into their own indexes - change (mediawiki...CirrusSearch)
jenkins-bot has submitted this change and it was merged. Change subject: Allow splitting of single namespaces into their own indexes .. Allow splitting of single namespaces into their own indexes Change-Id: I79e134d18e2c43557558e7001945d30ab233cc75 --- M CirrusSearch.php M includes/CirrusSearchConnection.php M includes/CirrusSearchSearcher.php M includes/CirrusSearchUpdater.php M maintenance/updateOneSearchIndexConfig.php M maintenance/updateSearchIndexConfig.php 6 files changed, 77 insertions(+), 48 deletions(-) Approvals: Chad: Looks good to me, approved Manybubbles: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/CirrusSearch.php b/CirrusSearch.php index c140538..dd76f4a 100644 --- a/CirrusSearch.php +++ b/CirrusSearch.php @@ -51,6 +51,16 @@ // set to 1 for some redundancy, if not 2 for more redundancy. $wgCirrusSearchContentReplicaCount = array( 'content' = 0, 'general' = 0 ); +// By default, Cirrus will organize pages into one of two indexes (general or +// content) based on whether a page is in a content namespace. This should +// suffice for most wikis. This setting allows individual namespaces to be +// mapped to specific index suffixes. The keys are the namespace number, and +// the value is a string name of what index suffix to use. Changing this setting +// requires a full reindex (not in-place) of the wiki. If this setting contains +// any values then the index names must also exist in $wgCirrusSearchShardCount +// and $wgCirrusSearchContentReplicaCount. +$wgCirrusSearchNamespaceMappings = array(); + // Shard timeout for non-maintenance index operations including those done in the web // process and those done via job queue. This is the amount of time Elasticsearch // will wait around for an offline primary shard. Currently this is just used in diff --git a/includes/CirrusSearchConnection.php b/includes/CirrusSearchConnection.php index cf5e160..75b6a1b 100644 --- a/includes/CirrusSearchConnection.php +++ b/includes/CirrusSearchConnection.php @@ -65,4 +65,31 @@ $name = $name ?: wfWikiId(); return self::getIndex( $name, $type )-getType( self::PAGE_TYPE_NAME ); } + + /** +* Get all index types we support, content, general, plus custom ones +* +* @return array(string) +*/ + public static function getAllIndexTypes() { + global $wgCirrusSearchNamespaceMappings; + return array_merge( array_values( $wgCirrusSearchNamespaceMappings ), + array( self::CONTENT_INDEX_TYPE, self::GENERAL_INDEX_TYPE ) ); + } + + /** +* Get the index suffix for a given namespace +* @param int $namespace A namespace id +* @return string +*/ + public static function getIndexSuffixForNamespace( $namespace ) { + global $wgCirrusSearchNamespaceMappings; + if ( isset( $wgCirrusSearchNamespaceMappings[$namespace] ) ) { + return $wgCirrusSearchNamespaceMappings[$namespace]; + } elseif ( MWNamespace::isContent( $namespace ) ) { + return self::CONTENT_INDEX_TYPE; + } else { + return self::GENERAL_INDEX_TYPE; + } + } } diff --git a/includes/CirrusSearchSearcher.php b/includes/CirrusSearchSearcher.php index c3e6829..3ce8378 100644 --- a/includes/CirrusSearchSearcher.php +++ b/includes/CirrusSearchSearcher.php @@ -597,28 +597,21 @@ } /** -* Pick the index type to search bases on the list of namespaces to search. -* @return mixed index type in which to search +* Pick the index type to search based on the list of namespaces to search. +* @return string|false either an index type or false to use all index types */ private function pickIndexTypeFromNamespaces() { if ( !$this-namespaces ) { - return false; // False selects both index types + return false; // False selects all index types } - $needsContent = false; - $needsGeneral = false; + + $indexTypes = array(); foreach ( $this-namespaces as $namespace ) { - if ( MWNamespace::isContent( $namespace ) ) { - $needsContent = true; - } else { - $needsGeneral = true; - } - if ( $needsContent $needsGeneral ) { - return false; // False selects both index types - } + $indexTypes[] = + CirrusSearchConnection::getIndexSuffixForNamespace( $namespace ); } - return
[MediaWiki-commits] [Gerrit] Make delete test less flaky - change (mediawiki...CirrusSearch)
jenkins-bot has submitted this change and it was merged. Change subject: Make delete test less flaky .. Make delete test less flaky Instead of arbitrary wait times it now: * Verifies that the index operation worked in the first place * Waits *up to* 75 seconds for the delete but typically catches it after one or two. 75 is used because that is a nice long timeout for beta in case its job queue is backed up. Change-Id: I694d845b25ec06de6a29d71f468b319f235c5344 --- M tests/browser/features/updates.feature 1 file changed, 3 insertions(+), 5 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/browser/features/updates.feature b/tests/browser/features/updates.feature index dc4ea1a..cd56b66 100644 --- a/tests/browser/features/updates.feature +++ b/tests/browser/features/updates.feature @@ -1,14 +1,12 @@ Feature: Search backend updates Background: Given I am logged in + Scenario: Deleted pages are removed from the index Given a page named DeleteMe exists +Then within 75 seconds searching for DeleteMe yields DeleteMe as the first result When I delete DeleteMe -And I am at a random page so I can reload it if I need to -And wait 5 seconds -And I type DeleteMe into the search box -Then suggestions should appear -And none is the first suggestion +Then within 75 seconds searching for DeleteMe yields none as the first result Scenario: Altered pages are updated in the index Given a page named ChangeMe exists with contents foo -- To view, visit https://gerrit.wikimedia.org/r/99667 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I694d845b25ec06de6a29d71f468b319f235c5344 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: Manybubbles never...@wikimedia.org Gerrit-Reviewer: Chad ch...@wikimedia.org Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org Gerrit-Reviewer: Zfilipin zfili...@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] Added fix for Admin Links hook when using SMW 1.9+ - change (mediawiki...SemanticWatchlist)
jenkins-bot has submitted this change and it was merged. Change subject: Added fix for Admin Links hook when using SMW 1.9+ .. Added fix for Admin Links hook when using SMW 1.9+ Change-Id: If6b24df103b376f1368598686f1606574c0b20a7 --- M SemanticWatchlist.php 1 file changed, 9 insertions(+), 1 deletion(-) Approvals: Yaron Koren: Checked; Looks good to me, approved jenkins-bot: Verified diff --git a/SemanticWatchlist.php b/SemanticWatchlist.php index 6fcfd63..c25e368 100644 --- a/SemanticWatchlist.php +++ b/SemanticWatchlist.php @@ -89,9 +89,17 @@ $wgHooks['SMWStore::updateDataBefore'][] = 'SWLHooks::onDataUpdate'; $wgHooks['GetPreferences'][] = 'SWLHooks::onGetPreferences'; $wgHooks['UserSaveOptions'][] = 'SWLHooks::onUserSaveOptions'; -$wgHooks['AdminLinks'][] = 'SWLHooks::addToAdminLinks'; $wgHooks['PersonalUrls'][] = 'SWLHooks::onPersonalUrls'; +// Admin Links hook needs to be called in a delayed way so that it +// will always be called after SMW's Admin Links addition; as of +// SMW 1.9, SMW delays calling all its hook functions. +$wgExtensionFunctions[] = 'SWLAddAdminLinksHook'; +function SWLAddAdminLinksHook() { + global $wgHooks; + $wgHooks['AdminLinks'][] = 'SWLHooks::addToAdminLinks'; +} + $moduleTemplate = array( 'localBasePath' = dirname( __FILE__ ), 'remoteBasePath' = $egSWLScriptPath -- To view, visit https://gerrit.wikimedia.org/r/99679 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If6b24df103b376f1368598686f1606574c0b20a7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticWatchlist Gerrit-Branch: master Gerrit-Owner: Yaron Koren yaro...@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] Updating changelog with changes from master for version 0.0.4-1 - change (operations...logster)
Ottomata has submitted this change and it was merged. Change subject: Updating changelog with changes from master for version 0.0.4-1 .. Updating changelog with changes from master for version 0.0.4-1 Change-Id: I701928f7e33a6aa09abc8584bdd7be0d421448ce --- M debian/changelog 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/debian/changelog b/debian/changelog index 78b1694..707b100 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,12 @@ +logster (0.0.4-1) precise; urgency=low + + * Updating from master, bugfix for JsonLogster parser + + -- Andrew Otto (WMF) o...@wikimedia.org Fri, 06 Dec 2013 17:43:43 + + logster (0.0.3-1~precise1) precise; urgency=low - * Updating from master, merged in log_dir option from upstream and JsonParser bugfix + * Updating from master, merged in log_dir option from upstream and JsonLogster parser bugfix -- Andrew Otto (WMF) o...@wikimedia.org Thu, 05 Dec 2013 22:31:13 + -- To view, visit https://gerrit.wikimedia.org/r/99680 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I701928f7e33a6aa09abc8584bdd7be0d421448ce Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/logster Gerrit-Branch: debian Gerrit-Owner: Ottomata o...@wikimedia.org Gerrit-Reviewer: Ottomata o...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits