[MediaWiki-commits] [Gerrit] Use HHVM+EZC internal tidy - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Use HHVM+EZC internal tidy .. Use HHVM+EZC internal tidy EZC doesn't currently support direct access to object properties via the obj-std.properties hashtable, but tidy uses this extensively. But it turns out that for production use cases, tidy_repair_string() should be sufficient. $wgDebugTidy and $wgValidateAllHtml are not used, and no deployed extension calls MWTidy::checkErrors(). The only difference I know of is that errors from tidy (status==2) lead to the tidy output being used, rather than discarded. But TY_(ReportFatal) has very few callers in tidylib -- probably none that are reachable from stripped parser output. So, throw an exception if MWTidy::checkErrors() is requested on an HHVM instance with the tidy extension. For MWTidy::tidy(), use tidy_repair_string(). Refactor some relevant code. Bug: T758 Change-Id: I8d5b1c2c9f9ddce46d8ad099a671a2e297d256e0 --- M includes/parser/MWTidy.php 1 file changed, 50 insertions(+), 14 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved Giuseppe Lavagetto: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/includes/parser/MWTidy.php b/includes/parser/MWTidy.php index b310862..ff62e9b 100644 --- a/includes/parser/MWTidy.php +++ b/includes/parser/MWTidy.php @@ -127,17 +127,11 @@ * @return string Corrected HTML output */ public static function tidy( $text ) { - global $wgTidyInternal; - $wrapper = new MWTidyWrapper; $wrappedtext = $wrapper-getWrapped( $text ); $retVal = null; - if ( $wgTidyInternal ) { - $correctedtext = self::execInternalTidy( $wrappedtext, false, $retVal ); - } else { - $correctedtext = self::execExternalTidy( $wrappedtext, false, $retVal ); - } + $correctedtext = self::clean( $wrappedtext, false, $retVal ); if ( $retVal 0 ) { wfDebug( Possible tidy configuration error!\n ); @@ -160,16 +154,33 @@ * @return bool Whether the HTML is valid */ public static function checkErrors( $text, $errorStr = null ) { + $retval = 0; + $errorStr = self::clean( $text, true, $retval ); + return ( $retval 0 $errorStr == '' ) || $retval == 0; + } + + /** +* Perform a clean/repair operation +* @param string $text HTML to check +* @param bool $stderr Whether to read result from STDERR rather than STDOUT +* @param int $retval Exit code (-1 on internal error) +* @return string|null +*/ + private static function clean( $text, $stderr = false, $retval = null ) { global $wgTidyInternal; - $retval = 0; if ( $wgTidyInternal ) { - $errorStr = self::execInternalTidy( $text, true, $retval ); + if ( wfIsHHVM() ) { + if ( $stderr ) { + throw new MWException( __METHOD__.: error text return from HHVM tidy is not supported ); + } + return self::hhvmClean( $text, $retval ); + } else { + return self::phpClean( $text, $stderr, $retval ); + } } else { - $errorStr = self::execExternalTidy( $text, true, $retval ); + return self::externalClean( $text, $stderr, $retval ); } - - return ( $retval 0 $errorStr == '' ) || $retval == 0; } /** @@ -181,7 +192,7 @@ * @param int $retval Exit code (-1 on internal error) * @return string|null */ - private static function execExternalTidy( $text, $stderr = false, $retval = null ) { + private static function externalClean( $text, $stderr = false, $retval = null ) { global $wgTidyConf, $wgTidyBin, $wgTidyOpts; wfProfileIn( __METHOD__ ); @@ -248,7 +259,7 @@ * @param int $retval Exit code (-1 on internal error) * @return string|null */ - private static function execInternalTidy( $text, $stderr = false, $retval = null ) { + private static function phpClean( $text, $stderr = false, $retval = null ) { global $wgTidyConf, $wgDebugTidy; wfProfileIn( __METHOD__ ); @@ -288,4 +299,29 @@ wfProfileOut( __METHOD__ ); return $cleansource; } + + /** +* Use the tidy extension for HHVM from +* https://github.com/wikimedia/mediawiki-php-tidy +* +* This currently does not support the
[MediaWiki-commits] [Gerrit] Add the license agreement text to new translation dialog - change (mediawiki...ContentTranslation)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/176327 Change subject: Add the license agreement text to new translation dialog .. Add the license agreement text to new translation dialog Bug: T76178 Change-Id: I17f9fa8023cf7738d5b24905c0df272cf967a731 --- M Resources.php M i18n/en.json M i18n/qqq.json M modules/source/ext.cx.source.selector.js M modules/source/styles/ext.cx.source.selector.less 5 files changed, 18 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/27/176327/1 diff --git a/Resources.php b/Resources.php index 368cc5e..7fb955c 100644 --- a/Resources.php +++ b/Resources.php @@ -157,6 +157,7 @@ 'cx-sourceselector-dialog-error-page-exists', 'cx-sourceselector-dialog-error-title-in-use', 'cx-sourceselector-dialog-error-no-source-article', + 'cx-license-agreement', ), ) + $resourcePaths; diff --git a/i18n/en.json b/i18n/en.json index 144b466..f686853 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -10,6 +10,7 @@ }, cx: Translate page, cx-javascript: This tool does not work without JavaScript., + cx-license-agreement: By clicking the \{{int:cx-sourceselector-dialog-button-start-translation}}\ button, you agree to the [//wikimediafoundation.org/wiki/Terms_of_Use Terms of Use] and you irrevocably agree to release your contributions with the translation tool under the [//en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License CC BY-SA 3.0 License] and the [//en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License GFDL] with the understanding that a hyperlink or URL sufficient for CC BY-SA 3.0 attribution., cx-error-server-connection: Error: Could not connect to the server., cx-desc: A tool that allows editors to translate pages from one language to another with the help of machine translation and other translation tools, cx-header-progressbar-text: $1% translated, diff --git a/i18n/qqq.json b/i18n/qqq.json index 2fcfe39..14a50ed 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -14,6 +14,7 @@ }, cx: {{doc-special|ContentTranslation}}, cx-javascript: Error message shown when JavaScript is not enabled in the browser., + cx-license-agreement: License agreement for the contributions using Content Translation tool. This is legal text and be careful. You may point the license URLs to a URL in your language if it exists., cx-error-server-connection: Error message shown when connection to the content translation server has failed., cx-desc: {{desc|name=ContentTranslation|url=http://www.mediawiki.org/wiki/Extension:ContentTranslation}};, cx-header-progressbar-text: Text to be shown with the progress bar in [[Special:ContentTranslation]]. $1 is the percent of translation progress.\n{{Identical|Translated}}, diff --git a/modules/source/ext.cx.source.selector.js b/modules/source/ext.cx.source.selector.js index 0d380c1..b9375cc 100644 --- a/modules/source/ext.cx.source.selector.js +++ b/modules/source/ext.cx.source.selector.js @@ -593,6 +593,7 @@ $heading, $targetLanguageLabel, $sourceInputs, $targetInputs, $messageText, + $license, index; this.$dialog = $( 'div' ) @@ -677,10 +678,15 @@ $actions.append( this.$cancelButton, this.$translateFromButton ); + $license = $( 'div' ) + .addClass( 'cx-sourceselector-dialog__license' ) + .html( mw.message( 'cx-license-agreement' ).parse() ); + this.$dialog.append( $heading, $sourceInputs, $targetInputs, this.$messageBar, + $license, $actions ); diff --git a/modules/source/styles/ext.cx.source.selector.less b/modules/source/styles/ext.cx.source.selector.less index a7e6bb1..33d7844 100644 --- a/modules/source/styles/ext.cx.source.selector.less +++ b/modules/source/styles/ext.cx.source.selector.less @@ -80,8 +80,7 @@ .mw-ui-one-whole; padding: 10px 15px 15px 15px; text-align: right; - margin-top: 10px; - + background-color: #F0F0F0; button { margin-left: 10px; } @@ -96,3 +95,11 @@ background-color: #FFF; opacity: 0.5; } + +.cx-sourceselector-dialog__license { + .mw-ui-item; + .mw-ui-one-whole; + padding: 10px; + background-color: #F0F0F0; + font-size: small; +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/176327 To unsubscribe,
[MediaWiki-commits] [Gerrit] API: Rewrite ApiQueryTags to fix continuation - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: API: Rewrite ApiQueryTags to fix continuation .. API: Rewrite ApiQueryTags to fix continuation And while we're at it, may as well include an indicator of whether the tag is defined. Bug: T76051 Bug: T76052 Change-Id: If2569ba1414b5f38d49c5f3ce9b6ca9c1a58f1c2 --- M RELEASE-NOTES-1.25 M includes/api/ApiQueryTags.php M includes/api/i18n/en.json 3 files changed, 62 insertions(+), 75 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index 7181e11..caf29f0 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -116,6 +116,8 @@ * ApiOpenSearch now supports XML output. * ApiOpenSearch will now output descriptions and URLs as array indexes 2 and 3 in JSON format. +* (bug T76051) list=tags will now continue correctly. +* (bug T76052) list=tags can now indicate whether a tag is defined. === Action API internal changes in 1.25 === * ApiHelp has been rewritten to support i18n and paginated HTML output. diff --git a/includes/api/ApiQueryTags.php b/includes/api/ApiQueryTags.php index f3b2652..7f2dc85 100644 --- a/includes/api/ApiQueryTags.php +++ b/includes/api/ApiQueryTags.php @@ -31,15 +31,6 @@ */ class ApiQueryTags extends ApiQueryBase { - /** -* @var ApiResult -*/ - private $result; - - private $limit; - private $fld_displayname = false, $fld_description = false, - $fld_hitcount = false; - public function __construct( ApiQuery $query, $moduleName ) { parent::__construct( $query, $moduleName, 'tg' ); } @@ -49,84 +40,77 @@ $prop = array_flip( $params['prop'] ); - $this-fld_displayname = isset( $prop['displayname'] ); - $this-fld_description = isset( $prop['description'] ); - $this-fld_hitcount = isset( $prop['hitcount'] ); + $fld_displayname = isset( $prop['displayname'] ); + $fld_description = isset( $prop['description'] ); + $fld_hitcount = isset( $prop['hitcount'] ); + $fld_defined = isset( $prop['defined'] ); - $this-limit = $params['limit']; - $this-result = $this-getResult(); + $limit = $params['limit']; + $result = $this-getResult(); + $definedTags = array_fill_keys( ChangeTags::listDefinedTags(), 0 ); + + # Fetch defined tags that aren't past the continuation + if ( $params['continue'] !== null ) { + $cont = $params['continue']; + $tags = array_filter( array_keys( $definedTags ), function ( $v ) use ( $cont ) { + return $v = $cont; + } ); + $tags = array_fill_keys( $tags, 0 ); + } else { + $tags = $definedTags; + } + + # Merge in all used tags $this-addTables( 'change_tag' ); $this-addFields( 'ct_tag' ); - - $this-addFieldsIf( array( 'hitcount' = 'COUNT(*)' ), $this-fld_hitcount ); - - $this-addOption( 'LIMIT', $this-limit + 1 ); + $this-addFields( array( 'hitcount' = $fld_hitcount ? 'COUNT(*)' : '0' ) ); + $this-addOption( 'LIMIT', $limit + 1 ); $this-addOption( 'GROUP BY', 'ct_tag' ); $this-addWhereRange( 'ct_tag', 'newer', $params['continue'], null ); - $res = $this-select( __METHOD__ ); - - $ok = true; - foreach ( $res as $row ) { - if ( !$ok ) { + $tags[$row-ct_tag] = (int)$row-hitcount; + } + + # Now make sure the array is sorted for proper continuation + ksort( $tags ); + + $count = 0; + foreach ( $tags as $tagName = $hitcount ) { + if ( ++$count $limit ) { + $this-setContinueEnumParameter( 'continue', $tagName ); break; } - $ok = $this-doTag( $row-ct_tag, $this-fld_hitcount ? $row-hitcount : 0 ); - } - // include tags with no hits yet - foreach ( ChangeTags::listDefinedTags() as $tag ) { - if ( !$ok ) { + $tag = array(); + $tag['name'] = $tagName; + + if ( $fld_displayname ) { + $tag['displayname'] = ChangeTags::tagDescription( $tagName ); + } + + if ( $fld_description ) { + $msg = $this-msg( tag-$tagName-description ); +
[MediaWiki-commits] [Gerrit] Bump version - change (mediawiki...WikibaseJavaScriptApi)
Adrian Lang has uploaded a new change for review. https://gerrit.wikimedia.org/r/176328 Change subject: Bump version .. Bump version Change-Id: I380f326863848d7237a5a3e607550b0e22f9010f --- M README.md M init.php 2 files changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseJavaScriptApi refs/changes/28/176328/1 diff --git a/README.md b/README.md index f95f322..eb9ac81 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ ## Release notes +### 1.0.1 (2014-11-28) + +* Bump the data-values/javascript dependency to 0.6.0 so that it matches Wikibase.git's. + No changes needed. + ### 1.0 (2014-11-26) Initial release. diff --git a/init.php b/init.php index 78d06e3..25a9fa4 100644 --- a/init.php +++ b/init.php @@ -1,6 +1,6 @@ ?php -define( 'WIKIBASE_JAVASCRIPT_API_VERSION', '1.0' ); +define( 'WIKIBASE_JAVASCRIPT_API_VERSION', '1.0.1' ); if ( defined( 'MEDIAWIKI' ) ) { call_user_func( function() { -- To view, visit https://gerrit.wikimedia.org/r/176328 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I380f326863848d7237a5a3e607550b0e22f9010f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseJavaScriptApi Gerrit-Branch: master Gerrit-Owner: Adrian Lang adrian.l...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bump version - change (mediawiki...WikibaseJavaScriptApi)
Henning Snater has submitted this change and it was merged. Change subject: Bump version .. Bump version Change-Id: I380f326863848d7237a5a3e607550b0e22f9010f --- M README.md M init.php 2 files changed, 6 insertions(+), 1 deletion(-) Approvals: Henning Snater: Verified; Looks good to me, approved diff --git a/README.md b/README.md index f95f322..eb9ac81 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ ## Release notes +### 1.0.1 (2014-11-28) + +* Bump the data-values/javascript dependency to 0.6.0 so that it matches Wikibase.git's. + No changes needed. + ### 1.0 (2014-11-26) Initial release. diff --git a/init.php b/init.php index 78d06e3..25a9fa4 100644 --- a/init.php +++ b/init.php @@ -1,6 +1,6 @@ ?php -define( 'WIKIBASE_JAVASCRIPT_API_VERSION', '1.0' ); +define( 'WIKIBASE_JAVASCRIPT_API_VERSION', '1.0.1' ); if ( defined( 'MEDIAWIKI' ) ) { call_user_func( function() { -- To view, visit https://gerrit.wikimedia.org/r/176328 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I380f326863848d7237a5a3e607550b0e22f9010f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseJavaScriptApi Gerrit-Branch: master Gerrit-Owner: Adrian Lang adrian.l...@wikimedia.de Gerrit-Reviewer: Henning Snater henning.sna...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Load article and edit preview html directly w/o javascript b... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/176329 Change subject: Load article and edit preview html directly w/o javascript bridge. .. Load article and edit preview html directly w/o javascript bridge. -Switched to single query article download - the reason is it is tricker to be splitting lead/non-lead section retrieval across 2 requests and also if the point of this refactor is to streamline away low-performance javascript, it seems antithetical to be amending/injecting late arriving non-lead section html via javascript. Additionally, now that we're using gzip encoding properly the download is much smaller than it was when we first split the request in 2. -Moved audio tag hiding out of transforms since they didn't work anyway - instead hobbled the audio tags before the html is sent to the web view, which does work. -Fixed tapping fragment links - jumping to sections should be more reliable. Change-Id: Ie5aa09d7ac36f06930ac1bfbe09c0259240253fe --- M Wikipedia.xcodeproj/project.pbxproj M wikipedia/Categories/UIWebView+LoadAssetsHtml.h M wikipedia/Categories/UIWebView+LoadAssetsHtml.m M wikipedia/Networking/Fetchers/ArticleFetcher.h M wikipedia/Networking/Fetchers/ArticleFetcher.m M wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m M wikipedia/View Controllers/WebView/WebViewController.m M wikipedia/assets/bundle.js M wikipedia/assets/index.html M wikipedia/assets/preview.html M wikipedia/mw-bridge/CommunicationBridge.h M wikipedia/mw-bridge/CommunicationBridge.m M www/index.html M www/js/bridge.js M www/js/listeners.js M www/js/transforms.js M www/preview.html 17 files changed, 382 insertions(+), 528 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/29/176329/1 diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index f60aa06..bd946c3 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -1981,7 +1981,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = scripts/make-css-assets.bash; + shellScript = #scripts/make-css-assets.bash; }; 04272E7619404CDF00CC682F /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -2011,7 +2011,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = scripts/icon-svgs-to-pngs.sh; + shellScript = #scripts/icon-svgs-to-pngs.sh; }; 048702AE19F75B0800B7D307 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -2039,7 +2039,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = scripts/update-storyboard-strings.php; + shellScript = #scripts/update-storyboard-strings.php; }; D4C16A631970949A00CD91AD /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -2055,7 +2055,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = scripts/update-qqq.php; + shellScript = #scripts/update-qqq.php; }; /* End PBXShellScriptBuildPhase section */ diff --git a/wikipedia/Categories/UIWebView+LoadAssetsHtml.h b/wikipedia/Categories/UIWebView+LoadAssetsHtml.h index 6db5425..600291e 100644 --- a/wikipedia/Categories/UIWebView+LoadAssetsHtml.h +++ b/wikipedia/Categories/UIWebView+LoadAssetsHtml.h @@ -8,4 +8,9 @@ // Loads contents of fileName. Assumes the file is in the assets folder. -(void)loadHTMLFromAssetsFile:(NSString *)fileName; +// Loads html passed to it injected into html from fileName. +// Warning! Probably don't call this directly! Call the method of the same +// name on the CommunicationBridge object for reasons documented there. +-(void)loadHTML:(NSString *)string withAssetsFile:(NSString *)fileName; + @end diff --git a/wikipedia/Categories/UIWebView+LoadAssetsHtml.m b/wikipedia/Categories/UIWebView+LoadAssetsHtml.m index 3938158..866ee14 100644 --- a/wikipedia/Categories/UIWebView+LoadAssetsHtml.m +++ b/wikipedia/Categories/UIWebView+LoadAssetsHtml.m @@ -7,13 +7,72 @@ -(void)loadHTMLFromAssetsFile:(NSString *)fileName { -NSArray *documentsPath = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES); -NSString *assetsPath = [[documentsPath firstObject] stringByAppendingPathComponent:@assets]; -NSString
[MediaWiki-commits] [Gerrit] Remove @todo in phpunit tests - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Remove @todo in phpunit tests .. Remove @todo in phpunit tests Change-Id: Id1f3b2a0372b46a7bf7f0d70b142af227e5a393e --- M repo/tests/phpunit/includes/api/GetEntitiesTest.php M repo/tests/phpunit/includes/api/SetReferenceTest.php 2 files changed, 51 insertions(+), 23 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/tests/phpunit/includes/api/GetEntitiesTest.php b/repo/tests/phpunit/includes/api/GetEntitiesTest.php index df854e3..38f957b 100644 --- a/repo/tests/phpunit/includes/api/GetEntitiesTest.php +++ b/repo/tests/phpunit/includes/api/GetEntitiesTest.php @@ -521,7 +521,6 @@ /** * @dataProvider provideLanguageFallback -* @todo factor this into the main test method */ public function testLanguageFallback( $handle, $languages, $expectedLabels, $expectedDescriptions ) { $id = EntityTestHelper::getId( $handle ); diff --git a/repo/tests/phpunit/includes/api/SetReferenceTest.php b/repo/tests/phpunit/includes/api/SetReferenceTest.php index 69c4aff..6d64f39 100644 --- a/repo/tests/phpunit/includes/api/SetReferenceTest.php +++ b/repo/tests/phpunit/includes/api/SetReferenceTest.php @@ -310,37 +310,66 @@ } /** -* Currently tests bad calender model -* @todo test more bad serializations... +* @dataProvider provideInvalidSerializations */ - public function testInvalidSerialization() { + public function testInvalidSerialization( $snaksSerialization ) { $this-setExpectedException( 'UsageException' ); $params = array( 'action' = 'wbsetreference', 'statement' = 'Foo$Guid', - 'snaks' = '{ - P813:[ - { - snaktype:value, - property:P813, - datavalue:{ -value:{ - time:+0002013-10-05T00:00:00Z, - timezone:0, - before:0, - after:0, - precision:11, - calendarmodel:FOOBAR :D -}, -type:time - } - } - ] -}', + 'snaks' = $snaksSerialization ); $this-doApiRequestWithToken( $params ); } + public function provideInvalidSerializations() { + return array( + array( + '{ +P813:[ + { +snaktype:value, +property:P813, +datavalue:{ + value:{ + time:+0002013-10-05T00:00:00Z, + timezone:0, + before:0, + after:0, + precision:11, + calendarmodel:FOOBAR :D + }, + type:time +} + } +] + }' + ), + array( + '{ +P813:[ + { + snaktype:wubbledubble, +property:P813, +datavalue:{ + value:{ + time:+0002013-10-05T00:00:00Z, + timezone:0, + before:0, + after:0, + precision:11, +
[MediaWiki-commits] [Gerrit] move wikibase.api into own module - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: move wikibase.api into own module .. move wikibase.api into own module Bug: T68419 Change-Id: I97ceba76ba17bfe266dd4541520ef47ed457d1dc --- M composer.json M lib/resources/Resources.php D lib/resources/api/FormatValueCaller.js D lib/resources/api/ParseValueCaller.js D lib/resources/api/RepoApi.js D lib/resources/api/RepoApiError.js D lib/resources/api/getLocationAgnosticMwApi.js D lib/resources/api/namespace.js D lib/resources/api/resources.php D lib/tests/qunit/api/RepoApi.tests.js D lib/tests/qunit/api/RepoApiError.tests.js M lib/tests/qunit/resources.php 12 files changed, 1 insertion(+), 1,663 deletions(-) Approvals: Henning Snater: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.json b/composer.json index 063d098..ba34747 100644 --- a/composer.json +++ b/composer.json @@ -38,6 +38,7 @@ wikibase/data-model: ~2.4, wikibase/data-model-javascript: ~1.0, wikibase/data-model-serialization: ~1.2, + wikibase/javascript-api: ~1.0, wikibase/internal-serialization: ~1.3, wikibase/serialization-javascript: ~2.0, diff --git a/lib/resources/Resources.php b/lib/resources/Resources.php index 61eeceb..fd3e2ec 100644 --- a/lib/resources/Resources.php +++ b/lib/resources/Resources.php @@ -83,7 +83,6 @@ $modules = array_merge( $modules, - include( __DIR__ . '/api/resources.php' ), include( __DIR__ . '/deprecated/resources.php' ), include( __DIR__ . '/jquery.wikibase/resources.php' ), include( __DIR__ . '/jquery.wikibase-shared/resources.php' ) diff --git a/lib/resources/api/FormatValueCaller.js b/lib/resources/api/FormatValueCaller.js deleted file mode 100644 index 9836a1f..000 --- a/lib/resources/api/FormatValueCaller.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @licence GNU GPL v2+ - * @author H. Snater mediaw...@snater.com - */ -( function( wb, $ ) { - 'use strict'; - - var MODULE = wb.api; - - /** -* @constructor -* -* @param {wikibase.api.RepoApi} api -* @param {dataTypes.DataTypeStore} dataTypeStore -*/ - var SELF = MODULE.FormatValueCaller = function( api, dataTypeStore ) { - this._api = api; - this._dataTypeStore = dataTypeStore; - }; - - $.extend( SELF.prototype, { - - /** -* @type {wikibase.api.RepoApi} -*/ - _api: null, - - /** -* @type {dataTypes.DataTypeStore} -*/ - _dataTypeStore: null, - - /** -* Makes a request to the API to format values on the server side. Will return a jQuery.Promise -* which will be resolved if formatting is successful or rejected if it fails or the API cannot -* be reached. -* @since 0.5 -* -* @param {dataValues.DataValue} dataValue -* @param {string} [dataType] -* @param {string} [outputFormat] -* @param {Object} [options] -* @return {jQuery.Promise} -* Resolved parameters: -* - {string} Formatted DataValue. -* Rejected parameters: -* - {wikibase.api.RepoApiError} -*/ - formatValue: function( dataValue, dataType, outputFormat, options ) { - - // Evaluate optional arguments: - if( outputFormat === undefined ) { - if( $.isPlainObject( dataType ) ) { - options = dataType; - dataType = undefined; - } else if( !this._dataTypeStore.hasDataType( dataType ) ) { - outputFormat = dataType; - dataType = undefined; - } - } else if( options === undefined ) { - if( $.isPlainObject( outputFormat ) ) { - options = outputFormat; - outputFormat = undefined; - } - } - - var deferred = $.Deferred(); - - this._api.formatValue( - { - value: dataValue.toJSON(), - type: dataValue.getType() - }, - options, - dataType, -
[MediaWiki-commits] [Gerrit] Rearranged site link views - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Rearranged site link views .. Rearranged site link views Intermediate step on the way to implementing the new UI: - Replaced table HTML structure with ul - Language name is not displayed anymore - Removed pointless message about site links being complete - Implemented temporary css media query for already displaying the site links next to the main entity content if the viewport is wide enough. Change-Id: I01a663381e4b5f9637bbf28f892e4cf3a1f94582 --- M lib/i18n/en.json M lib/i18n/qqq.json M lib/resources/jquery.wikibase/jquery.wikibase.sitelinkgroupview.js M lib/resources/jquery.wikibase/jquery.wikibase.sitelinklistview.js M lib/resources/jquery.wikibase/jquery.wikibase.sitelinkview.js M lib/resources/jquery.wikibase/resources.php M lib/resources/jquery.wikibase/themes/default/jquery.wikibase.entityview.css M lib/resources/jquery.wikibase/themes/default/jquery.wikibase.sitelinkgrouplistview.css M lib/resources/jquery.wikibase/themes/default/jquery.wikibase.sitelinkgroupview.css M lib/resources/jquery.wikibase/themes/default/jquery.wikibase.sitelinklistview.css M lib/resources/jquery.wikibase/themes/default/jquery.wikibase.sitelinkview.css M repo/i18n/en.json M repo/i18n/qqq.json M repo/includes/View/SiteLinksView.php M repo/resources/jquery/jquery.sticknode.js M repo/resources/templates.php M repo/tests/phpunit/includes/View/SiteLinksViewTest.php 17 files changed, 108 insertions(+), 435 deletions(-) Approvals: Adrian Lang: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/i18n/en.json b/lib/i18n/en.json index b6a94ca..24baca4 100644 --- a/lib/i18n/en.json +++ b/lib/i18n/en.json @@ -56,8 +56,6 @@ wikibase-replicationnote: Please notice that it can take several minutes until the changes are visible on all wikis., wikibase-sitelinks-wikipedia: Wikipedia pages linked to this item, wikibase-sitelinks-sitename-columnheading: Language, - wikibase-sitelinks-sitename-columnheading-special: Site, - wikibase-sitelinks-siteid-columnheading: Code, wikibase-sitelinks-link-columnheading: Linked page, wikibase-snakview-snaktypeselector-somevalue: unknown value, wikibase-snakview-snaktypeselector-novalue: no value, diff --git a/lib/i18n/qqq.json b/lib/i18n/qqq.json index ed69cf5..d73b044 100644 --- a/lib/i18n/qqq.json +++ b/lib/i18n/qqq.json @@ -65,8 +65,6 @@ wikibase-replicationnote: Note telling the user that it can take a few minutes until the made changes are visible on all wikis.\nPreceded by message {{msg-mw|Wikibase-linkitem-success-link}}, wikibase-sitelinks-wikipedia: [[File:Screenshot WikidataRepo 2012-05-13 A.png|right|0x150px]]\nHeader messages for pages on different Wikipedias linked to this item. Similar messages can be created for each group of target sites, depending on configuration.\nSee also Wikidatas glossary for [[d:Wikidata:Glossary#sitelinks|site links]] and [[d:Wikidata:Glossary#Item|item]].\n{{Related|Wikibase-sitelinks}}, wikibase-sitelinks-sitename-columnheading: Site links table column heading for the column containing the language names.\n{{Identical|Language}}, - wikibase-sitelinks-sitename-columnheading-special: Site links table column heading for the sitename column for special sites such as e.g. Commons.\n{{Identical|Site}}, - wikibase-sitelinks-siteid-columnheading: Site links table column heading for the column containing the language codes.\n{{Identical|Code}}, wikibase-sitelinks-link-columnheading: Site links table column heading for the column containg the title/link of/to the referenced (wiki) page.\n{{Identical|Linked page}}, wikibase-snakview-snaktypeselector-somevalue: Short descriptive title of a some-value snak (see [[d:Wikidata:Glossary]]) used in a drop-down menu allowing to select the snak type when adding or editing a snak. The drop-down menu can be opened by clicking an anchor right next to the input element(s) used to specify a claim's value. Although this is regarded a 'special', seldom used feature, the term 'snak' should be avoided here since the concept of snaks is a technical abstraction that does not give any additional meaning within the user interface. The basic meaning of this option is that a value exists but it is unknown., wikibase-snakview-snaktypeselector-novalue: A short descriptive title of a no-value snak (see [[d:Wikidata:Glossary]]) used in a drop-down menu allowing to select the snak type when adding or editing a snak. The drop-down menu can be opened by clicking an anchor right next to the input element(s) used to specify a claim's value. Although this is regarded a 'special', seldom used feature, the term 'snak' should be avoided here since the concept of snaks is a technical abstraction that does not give any additional meaning
[MediaWiki-commits] [Gerrit] Construct properties with a data type - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Construct properties with a data type .. Construct properties with a data type (Doing without is deprecated, so we can enforce type being set in the future) Change-Id: I48391fc617ec0a6423b7bfe3f94226dcbd8c1ffa --- M repo/tests/phpunit/includes/ChangeOp/ChangeOpClaimTest.php M repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php M repo/tests/phpunit/includes/View/ClaimsViewTest.php M repo/tests/phpunit/includes/api/CreateRedirectModuleTest.php 4 files changed, 4 insertions(+), 4 deletions(-) Approvals: Adrian Lang: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpClaimTest.php b/repo/tests/phpunit/includes/ChangeOp/ChangeOpClaimTest.php index 103abf5..3d0dbe7 100644 --- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpClaimTest.php +++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpClaimTest.php @@ -214,7 +214,7 @@ } public function testApplyWithProperty() { - $property = Property::newEmpty(); + $property = Property::newFromType( 'string' ); $property-setId( new PropertyId( 'P73923' ) ); $statement = $this-makeStatement( $property, new PropertyNoValueSnak( 45 ) ); diff --git a/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php b/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php index 491fda2..fd7c4a4 100644 --- a/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php +++ b/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php @@ -50,7 +50,7 @@ $this-repo-putEntity( $item ); // a property - $prop = Property::newEmpty(); + $prop = Property::newFromType( 'string' ); $prop-setId( new PropertyId( 'P11' ) ); $this-repo-putEntity( $prop ); diff --git a/repo/tests/phpunit/includes/View/ClaimsViewTest.php b/repo/tests/phpunit/includes/View/ClaimsViewTest.php index 60a3343..74586c9 100644 --- a/repo/tests/phpunit/includes/View/ClaimsViewTest.php +++ b/repo/tests/phpunit/includes/View/ClaimsViewTest.php @@ -70,7 +70,7 @@ $store = WikibaseRepo::getDefaultInstance()-getEntityStore(); $testUser = new TestUser( 'WikibaseUser' ); - $property = Property::newEmpty(); + $property = Property::newFromType( 'string' ); $property-setLabel( 'en', scriptalert( 'omg!!!' );/script ); $property-setDataTypeId( 'string' ); diff --git a/repo/tests/phpunit/includes/api/CreateRedirectModuleTest.php b/repo/tests/phpunit/includes/api/CreateRedirectModuleTest.php index 43e3500..f3f1c43 100644 --- a/repo/tests/phpunit/includes/api/CreateRedirectModuleTest.php +++ b/repo/tests/phpunit/includes/api/CreateRedirectModuleTest.php @@ -55,7 +55,7 @@ $this-repo-putEntity( $item ); // a property - $prop = Property::newEmpty(); + $prop = Property::newFromType( 'string' ); $prop-setId( new PropertyId( 'P11' ) ); $this-repo-putEntity( $prop ); -- To view, visit https://gerrit.wikimedia.org/r/176322 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I48391fc617ec0a6423b7bfe3f94226dcbd8c1ffa Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Addshore addshorew...@gmail.com Gerrit-Reviewer: Adrian Lang adrian.l...@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] Use Statement rank enum - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Use Statement rank enum .. Use Statement rank enum Change-Id: I7f8270b6854d4f95ddf272822ee1b434d11a1fa8 --- M client/tests/phpunit/includes/scribunto/WikibaseLuaIntegrationTestItemSetUpHelper.php 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Adrian Lang: Looks good to me, approved jenkins-bot: Verified diff --git a/client/tests/phpunit/includes/scribunto/WikibaseLuaIntegrationTestItemSetUpHelper.php b/client/tests/phpunit/includes/scribunto/WikibaseLuaIntegrationTestItemSetUpHelper.php index 180292e..b9bf4e6 100644 --- a/client/tests/phpunit/includes/scribunto/WikibaseLuaIntegrationTestItemSetUpHelper.php +++ b/client/tests/phpunit/includes/scribunto/WikibaseLuaIntegrationTestItemSetUpHelper.php @@ -57,7 +57,7 @@ ); $statement1 = $this-getTestStatement( $stringSnak ); - $statement1-setRank( Claim::RANK_PREFERRED ); + $statement1-setRank( Statement::RANK_PREFERRED ); $stringProperty-getStatements()-addStatement( $statement1 ); $this-mockRepository-putEntity( $stringProperty ); @@ -68,7 +68,7 @@ ); $statement2 = $this-getTestStatement( $stringSnak2 ); - $statement2-setRank( Claim::RANK_NORMAL ); + $statement2-setRank( Statement::RANK_NORMAL ); $siteLinks = array( $siteLink ); $siteLinks[] = new SiteLink( -- To view, visit https://gerrit.wikimedia.org/r/176321 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f8270b6854d4f95ddf272822ee1b434d11a1fa8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Adrian Lang adrian.l...@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] Use Statement rank enum - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Use Statement rank enum .. Use Statement rank enum Change-Id: I4bbcb43131be2dd723c8f272abd5ecec29518654 --- M repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php 1 file changed, 9 insertions(+), 9 deletions(-) Approvals: Adrian Lang: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php b/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php index 2c69b29..5bde95e 100644 --- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php +++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php @@ -4,9 +4,9 @@ use Wikibase\ChangeOp\ChangeOpFactoryProvider; use Wikibase\ChangeOp\ChangeOpsMerge; -use Wikibase\DataModel\Claim\Claim; use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; +use Wikibase\DataModel\Statement\Statement; use Wikibase\Repo\WikibaseRepo; use Wikibase\Validators\EntityConstraintProvider; @@ -246,7 +246,7 @@ 'q' = array( ), 'g' = 'Q111$D8404CDA-25E4-4334-AF13-A390BCD9C556', 'refs' = array(), - 'rank' = Claim::RANK_NORMAL, + 'rank' = Statement::RANK_NORMAL, ) ), ), @@ -258,7 +258,7 @@ 'q' = array( ), 'g' = 'Q111$D8404CDA-25E4-4334-AF13-A390BCD9C556', 'refs' = array(), - 'rank' = Claim::RANK_NORMAL, + 'rank' = Statement::RANK_NORMAL, ) ), ), @@ -270,7 +270,7 @@ 'q' = array( array( 'novalue', 56 ) ), 'g' = 'Q111$D8404CDA-25E4-4334-AF13-A3290BCD9C0F', 'refs' = array(), - 'rank' = Claim::RANK_NORMAL, + 'rank' = Statement::RANK_NORMAL, ) ), ), @@ -282,7 +282,7 @@ 'q' = array( array( 'novalue', 56 ) ), 'g' = 'Q111$D8404CDA-25E4-4334-AF13-A3290BCD9C0F', 'refs' = array(), - 'rank' = Claim::RANK_NORMAL, + 'rank' = Statement::RANK_NORMAL, ) ), ), @@ -299,7 +299,7 @@ 'q' = array( array( 'novalue', 88 ) ), 'g' = 'Q111$D8404CDA-25E4-4334-AF88-A3290BCD9C0F', 'refs' = array(), - 'rank' = Claim::RANK_NORMAL, + 'rank' = Statement::RANK_NORMAL, ) ), ), @@ -316,7 +316,7 @@ 'q' = array( array( 'novalue', 88 ) ), 'g' = 'Q111$D8404CDA-25E4-4334-AF88-A3290BCD9C0F', 'refs' = array(), - 'rank' = Claim::RANK_NORMAL, + 'rank' = Statement::RANK_NORMAL, ) ), ), @@ -336,7 +336,7 @@ 'q' = array( array( 'novalue', 88 ) ), 'g' = 'Q111$D8404CDA-25E4-4334-AF88-A3290BCD9C0F', 'refs' = array(), - 'rank' = Claim::RANK_NORMAL, + 'rank' = Statement::RANK_NORMAL, ) ), ), @@ -364,7 +364,7 @@ 'q' = array( array( 'novalue', 88 ) ), 'g' = 'Q111$D8404CDA-25E4-4334-AF88-A3290BCD9C0F', 'refs' = array(), - 'rank' = Claim::RANK_NORMAL, + 'rank' =
[MediaWiki-commits] [Gerrit] Fix broken CreatedBlacklistedItems - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Fix broken CreatedBlacklistedItems .. Fix broken CreatedBlacklistedItems Item was not referenced. Also removed usage of deprecated methods Change-Id: Ie08a2436709e95acd04d0a0a8995cc53ea00e08d --- M repo/maintenance/createBlacklistedItems.php 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Adrian Lang: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/maintenance/createBlacklistedItems.php b/repo/maintenance/createBlacklistedItems.php index 3d57b6c..aea62d5 100644 --- a/repo/maintenance/createBlacklistedItems.php +++ b/repo/maintenance/createBlacklistedItems.php @@ -2,7 +2,7 @@ namespace Wikibase; -use Wikibase\DataModel\SiteLink; +use Wikibase\DataModel\Entity\Item; use Wikibase\Repo\WikibaseRepo; $basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' ) : __DIR__ . '/../../../..'; @@ -70,8 +70,8 @@ $item = Item::newEmpty(); $item-setId( $id ); - $item-setLabel( 'en', $name ); - $item-addSiteLink( new SiteLink( 'enwiki', $name ) ); + $item-getFingerprint()-setLabel( 'en', $name ); + $item-getSiteLinkList()-addNewSiteLink( 'enwiki', $name ); $store-saveEntity( $item, 'Import', $user, EDIT_NEW ); } -- To view, visit https://gerrit.wikimedia.org/r/176316 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie08a2436709e95acd04d0a0a8995cc53ea00e08d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Adrian Lang adrian.l...@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] Wikidataquery: Instantiate using the correct constructor - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/176330 Change subject: [FIX] Wikidataquery: Instantiate using the correct constructor .. [FIX] Wikidataquery: Instantiate using the correct constructor Change-Id: If0513951d0e31a8b1697443856556e20b402c5d5 --- M pywikibot/data/wikidataquery.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/30/176330/1 diff --git a/pywikibot/data/wikidataquery.py b/pywikibot/data/wikidataquery.py index c3eaf35..5ad6bed 100644 --- a/pywikibot/data/wikidataquery.py +++ b/pywikibot/data/wikidataquery.py @@ -567,7 +567,7 @@ data = json.loads(resp) except ValueError: pywikibot.warning(uData received from host but no JSON could be decoded) -raise pywikibot.ServerError +raise pywikibot.ServerError(Data received from host but no JSON could be decoded) return data -- To view, visit https://gerrit.wikimedia.org/r/176330 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0513951d0e31a8b1697443856556e20b402c5d5 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [FIX] Wikidataquery: raise ServerError correctly - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [FIX] Wikidataquery: raise ServerError correctly .. [FIX] Wikidataquery: raise ServerError correctly Change-Id: If0513951d0e31a8b1697443856556e20b402c5d5 --- M pywikibot/data/wikidataquery.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/data/wikidataquery.py b/pywikibot/data/wikidataquery.py index c3eaf35..5ad6bed 100644 --- a/pywikibot/data/wikidataquery.py +++ b/pywikibot/data/wikidataquery.py @@ -567,7 +567,7 @@ data = json.loads(resp) except ValueError: pywikibot.warning(uData received from host but no JSON could be decoded) -raise pywikibot.ServerError +raise pywikibot.ServerError(Data received from host but no JSON could be decoded) return data -- To view, visit https://gerrit.wikimedia.org/r/176330 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If0513951d0e31a8b1697443856556e20b402c5d5 Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [FIX] HTTP: Use urlparse to get host if site not given - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/176331 Change subject: [FIX] HTTP: Use urlparse to get host if site not given .. [FIX] HTTP: Use urlparse to get host if site not given Change-Id: I18b0acbdb00ecfa474646efb5796d88664c1e173 --- M pywikibot/comms/http.py 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/31/176331/1 diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index f3e93c8..9e65821 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -241,6 +241,7 @@ site.ignore_certificate_error()) else: baseuri = uri +host = urlparse.urlparse(uri).netloc format_string = kwargs.setdefault(headers, {}).get(user-agent) kwargs[headers][user-agent] = user_agent(site, format_string) @@ -260,7 +261,7 @@ raise request.data if request.data[0].status == 504: -raise Server504Error(Server %s timed out % site.hostname()) +raise Server504Error(Server %s timed out % host) if request.data[0].status == 414: raise Server414Error('Too long GET request') -- To view, visit https://gerrit.wikimedia.org/r/176331 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18b0acbdb00ecfa474646efb5796d88664c1e173 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [FIX] HTTP: Use urlparse to get host if site not given - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [FIX] HTTP: Use urlparse to get host if site not given .. [FIX] HTTP: Use urlparse to get host if site not given Change-Id: I18b0acbdb00ecfa474646efb5796d88664c1e173 --- M pywikibot/comms/http.py 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index f3e93c8..9e65821 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -241,6 +241,7 @@ site.ignore_certificate_error()) else: baseuri = uri +host = urlparse.urlparse(uri).netloc format_string = kwargs.setdefault(headers, {}).get(user-agent) kwargs[headers][user-agent] = user_agent(site, format_string) @@ -260,7 +261,7 @@ raise request.data if request.data[0].status == 504: -raise Server504Error(Server %s timed out % site.hostname()) +raise Server504Error(Server %s timed out % host) if request.data[0].status == 414: raise Server414Error('Too long GET request') -- To view, visit https://gerrit.wikimedia.org/r/176331 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I18b0acbdb00ecfa474646efb5796d88664c1e173 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make ircecho run as ircecho user - change (operations...ircecho)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/176333 Change subject: Make ircecho run as ircecho user .. Make ircecho run as ircecho user - Add postinst that creates user Bug: T76203 Change-Id: I773b1dd604f8e0df26e69f10f2ba1535a0715213 --- M debian/ircecho.init A debian/postinst 2 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/ircecho refs/changes/33/176333/1 diff --git a/debian/ircecho.init b/debian/ircecho.init index 901d87b..e3085e6 100644 --- a/debian/ircecho.init +++ b/debian/ircecho.init @@ -16,7 +16,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC=Input to IRC echoer DAEMON=/usr/ircecho/bin/ircecho -USER=nobody +USER=ircecho SCRIPTNAME=/etc/init.d/ircecho NAME=ircecho diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 000..962d877 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,4 @@ +#!/bin/sh + +# Create ircecho user +adduser --no-create-home --system ircecho -- To view, visit https://gerrit.wikimedia.org/r/176333 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I773b1dd604f8e0df26e69f10f2ba1535a0715213 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/ircecho Gerrit-Branch: master Gerrit-Owner: Yuvipanda yuvipa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Include anchor in group page wiki link - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Include anchor in group page wiki link .. Include anchor in group page wiki link We effectively did this when outputting an HTML link in the function above, but not for the wiki text version. Just use getFullText instead of getPrefixedText, which handles adding anchors where necessary and nothing else. Bug: T75959 Change-Id: I1a4aa46d26e738c2a97e41463231da632e4ca8e5 --- M includes/User.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/User.php b/includes/User.php index 16a78f6..5348020 100644 --- a/includes/User.php +++ b/includes/User.php @@ -4476,7 +4476,7 @@ } $title = self::getGroupPage( $group ); if ( $title ) { - $page = $title-getPrefixedText(); + $page = $title-getFullText(); return [[$page|$text]]; } else { return $text; -- To view, visit https://gerrit.wikimedia.org/r/176297 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a4aa46d26e738c2a97e41463231da632e4ca8e5 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Alex Monk kren...@wikimedia.org Gerrit-Reviewer: Emufarmers emufarm...@gmail.com Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: MZMcBride w...@mzmcbride.com Gerrit-Reviewer: Umherirrender umherirrender_de...@web.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use wgContentTranslationCluster when available - change (mediawiki...ContentTranslation)
jenkins-bot has submitted this change and it was merged. Change subject: Use wgContentTranslationCluster when available .. Use wgContentTranslationCluster when available Change-Id: I42f7bc0d1743263c3e59ce3c9fd334201c85053e --- M ContentTranslation.php M includes/Database.php 2 files changed, 12 insertions(+), 3 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/ContentTranslation.php b/ContentTranslation.php index 7f9fc50..63e11c5 100644 --- a/ContentTranslation.php +++ b/ContentTranslation.php @@ -57,6 +57,11 @@ // Provide the database name as the value. // See sql/contenttranslation.sql for scripts to create this database. $GLOBALS['wgContentTranslationDatabase'] = null; + +// If the content translation database is located in a different cluster, +// specify the name of the cluster. +$GLOBALS['wgContentTranslationCluster'] = false; + $GLOBALS['wgExtensionMessagesFiles']['ContentTranslationAlias'] = $dir/ContentTranslation.alias.php; diff --git a/includes/Database.php b/includes/Database.php index cd5933c..d9b0b54 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -11,9 +11,13 @@ * @return DatabaseBase */ public static function getConnection( $type ) { - global $wgContentTranslationDatabase; - return wfGetLB( $wgContentTranslationDatabase )-getConnection( $type, array(), - $wgContentTranslationDatabase ); + global $wgContentTranslationDatabase, $wgContentTranslationCluster; + + $lb = $wgContentTranslationCluster + ? wfGetLBFactory()-getExternalLB( $wgContentTranslationCluster ) + : wfGetLB( $wgContentTranslationDatabase ); + + return $lb-getConnectionRef( $type, array(), $wgContentTranslationDatabase ); } } -- To view, visit https://gerrit.wikimedia.org/r/175955 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I42f7bc0d1743263c3e59ce3c9fd334201c85053e Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: KartikMistry kartik.mis...@gmail.com Gerrit-Reviewer: KartikMistry kartik.mis...@gmail.com 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] hiera: role-based backend, role() helper function (WiP) - change (operations/puppet)
Giuseppe Lavagetto has uploaded a new change for review. https://gerrit.wikimedia.org/r/176334 Change subject: hiera: role-based backend, role() helper function (WiP) .. hiera: role-based backend, role() helper function (WiP) Change-Id: I9a7e54539a421936ba4ced8c4229abacdde0a4fd Signed-off-by: Giuseppe Lavagetto glavage...@wikimedia.org --- A modules/wmflib/lib/hiera/backend/role_backend.rb A modules/wmflib/lib/puppet/parser/functions/role.rb 2 files changed, 108 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/34/176334/1 diff --git a/modules/wmflib/lib/hiera/backend/role_backend.rb b/modules/wmflib/lib/hiera/backend/role_backend.rb new file mode 100644 index 000..0dea101 --- /dev/null +++ b/modules/wmflib/lib/hiera/backend/role_backend.rb @@ -0,0 +1,85 @@ +class Hiera + module Backend +class Role_backend + def initialize(cache=nil) +require 'yaml' +@cache = cache || Filecache.new +config = Config[:role] + end + + def get_path(key, role, source) +# Variables for role::foo::bar will be searched in: +# role/foo/bar.yaml +# role/$::site/foo/bar.yaml +# etc, depending on your hierarchy +path = role.gsub(/^::/,'').split('::').shift().join('/') +if source == 'common' + src = role/#{path} +else + src = role/#{source}/#{path} +end +return Backend.datafile(:role, scope, src, yaml) + end + + def merge_answer(new_answer, answer, resolution_type) +case resolution_type +when :array + raise Exception, Hiera type mismatch: expected Array and got #{new_answer.class} unless new_answer.kind_of? Array or new_answer.kind_of? String + answer ||= [] + answer new_answer +when :hash + raise Exception, Hiera type mismatch: expected Hash and got #{new_answer.class} unless new_answer.kind_of? Hash + answer ||= {} + answer = Backend.merge_answer(new_answer,answer) +else + answer = new_answer + return true +end +return false + end + + def lookup(key, scope, order_override, resolution_type) +topscope_var = '::role' +resultset = nil +return unless scope.include?topscope_var +roles = scope[topscope_var] +hierarchy = Config.include?[:role_hierarchy] ? Config[:role_hierachy] : nil +roles.keys.each do |role| + answer = nil + Backend.datasources(scope,order_override,hierarchy) do |source| +file = get_path(key,role,source) +next if yamlfile.nil? +Hiera.debug(Searching in #{file} for #{key}) +next unless File.exist?(yamlfile) + +data = @cache.read(yamlfile, Hash) do |content| + YAML.load(content) +end +next if data.empty? +next unless data.include? key +new_answer = Backend.parse_answer(data[key], scope) +Hiera.debug(Found: #{key} = #{new_answer}) +break if merge_answer(new_answer, answer, resolution_type) + end + # Now we got one answer for this role, we can merge it with what we got earlier. + case resolution_type + when :array +resultset ||= [] +resultset answer + when :hash +resultset ||= {} +resultset = Backend.merge_answer(answer, resultset) + else +# We raise an exception if we have received conflicting results +if resultset and answer != resultset + raise Exception, Conflicting value for #{key} found in role #{role} +else + resultset = answer +end + end +end +resultset + end +end + end +end diff --git a/modules/wmflib/lib/puppet/parser/functions/role.rb b/modules/wmflib/lib/puppet/parser/functions/role.rb new file mode 100644 index 000..1376878 --- /dev/null +++ b/modules/wmflib/lib/puppet/parser/functions/role.rb @@ -0,0 +1,23 @@ +module Puppet::Parser::Functions + newfunction(:role, :arity = 1) do |args| +# This will add to the catalog, and to the node specifically: +# - A global 'role' hash with the 'role::#{arg}' key set to true; if the variable is present, append to it +# - Include class role::#{arg} if present +args.flatten do |arg| + rolename = 'role::' + arg + rolevar = compiler.topscope.lookupvar('::role') + if rolevar +rolevar[rolename] = true + else +compiler.topscope.setvar('role', {rolename = true}) + end + + role_class = compiler.topscope.find_hostclass(rolename) + if !role_class +raise class not in scope + else +send Puppet::Parser::Functions.function(:include), [rolename] + end +end +
[MediaWiki-commits] [Gerrit] Move {Entity, Property, Item}View to Wikibase\Repo\View - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Move {Entity,Property,Item}View to Wikibase\Repo\View .. Move {Entity,Property,Item}View to Wikibase\Repo\View Change-Id: I42cdba5ccd507a530fd9a56cda29739577994da3 --- R repo/includes/View/EntityView.php M repo/includes/View/EntityViewFactory.php R repo/includes/View/ItemView.php R repo/includes/View/PropertyView.php M repo/tests/phpunit/includes/EntityParserOutputGeneratorTest.php M repo/tests/phpunit/includes/View/EntityViewFactoryTest.php R repo/tests/phpunit/includes/View/EntityViewTest.php R repo/tests/phpunit/includes/View/ItemViewTest.php R repo/tests/phpunit/includes/View/PropertyViewTest.php 9 files changed, 15 insertions(+), 20 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/includes/EntityView.php b/repo/includes/View/EntityView.php similarity index 97% rename from repo/includes/EntityView.php rename to repo/includes/View/EntityView.php index 137a03c..ee53a3b 100644 --- a/repo/includes/EntityView.php +++ b/repo/includes/View/EntityView.php @@ -1,14 +1,12 @@ ?php -namespace Wikibase; +namespace Wikibase\Repo\View; use Html; use InvalidArgumentException; use Language; use Wikibase\DataModel\Entity\Entity; -use Wikibase\Repo\View\ClaimsView; -use Wikibase\Repo\View\FingerprintView; -use Wikibase\Repo\View\TextInjector; +use Wikibase\EntityRevision; /** * Base class for creating views for all different kinds of Wikibase\Entity. diff --git a/repo/includes/View/EntityViewFactory.php b/repo/includes/View/EntityViewFactory.php index f97697e..0a942b4 100644 --- a/repo/includes/View/EntityViewFactory.php +++ b/repo/includes/View/EntityViewFactory.php @@ -6,15 +6,12 @@ use Language; use ValueFormatters\FormatterOptions; use ValueFormatters\ValueFormatter; -use Wikibase\EntityView; -use Wikibase\ItemView; use Wikibase\LanguageFallbackChain; use Wikibase\Lib\OutputFormatSnakFormatterFactory; use Wikibase\Lib\SnakFormatter; use Wikibase\Lib\Store\EntityLookup; use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Lib\Store\LabelLookup; -use Wikibase\PropertyView; use Wikibase\Repo\WikibaseRepo; /** diff --git a/repo/includes/ItemView.php b/repo/includes/View/ItemView.php similarity index 95% rename from repo/includes/ItemView.php rename to repo/includes/View/ItemView.php index f791ebd..16fd88e 100644 --- a/repo/includes/ItemView.php +++ b/repo/includes/View/ItemView.php @@ -1,11 +1,10 @@ ?php -namespace Wikibase; +namespace Wikibase\Repo\View; use InvalidArgumentException; use Wikibase\DataModel\Entity\Item; -use Wikibase\Repo\View\SectionEditLinkGenerator; -use Wikibase\Repo\View\SiteLinksView; +use Wikibase\EntityRevision; use Wikibase\Repo\WikibaseRepo; /** diff --git a/repo/includes/PropertyView.php b/repo/includes/View/PropertyView.php similarity index 97% rename from repo/includes/PropertyView.php rename to repo/includes/View/PropertyView.php index 40105fa..54f832f 100644 --- a/repo/includes/PropertyView.php +++ b/repo/includes/View/PropertyView.php @@ -1,10 +1,11 @@ ?php -namespace Wikibase; +namespace Wikibase\Repo\View; use DataTypes\DataType; use InvalidArgumentException; use Wikibase\DataModel\Entity\Property; +use Wikibase\EntityRevision; use Wikibase\Repo\WikibaseRepo; use Wikibase\Repo\View\FingerprintView; use Wikibase\Repo\View\ClaimsView; diff --git a/repo/tests/phpunit/includes/EntityParserOutputGeneratorTest.php b/repo/tests/phpunit/includes/EntityParserOutputGeneratorTest.php index 66210a3..cc43627 100644 --- a/repo/tests/phpunit/includes/EntityParserOutputGeneratorTest.php +++ b/repo/tests/phpunit/includes/EntityParserOutputGeneratorTest.php @@ -77,7 +77,7 @@ -disableOriginalConstructor() -getMock(); - $entityView = $this-getMockBuilder( 'Wikibase\EntityView' ) + $entityView = $this-getMockBuilder( 'Wikibase\Repo\View\EntityView' ) -disableOriginalConstructor() -getMock(); diff --git a/repo/tests/phpunit/includes/View/EntityViewFactoryTest.php b/repo/tests/phpunit/includes/View/EntityViewFactoryTest.php index ff72816..979cdb4 100644 --- a/repo/tests/phpunit/includes/View/EntityViewFactoryTest.php +++ b/repo/tests/phpunit/includes/View/EntityViewFactoryTest.php @@ -38,8 +38,8 @@ public function newEntityViewProvider() { return array( - array( 'Wikibase\ItemView', 'item' ), - array( 'Wikibase\PropertyView', 'property' ) + array( 'Wikibase\Repo\View\ItemView', 'item' ), + array( 'Wikibase\Repo\View\PropertyView', 'property' ) ); } diff --git a/repo/tests/phpunit/includes/EntityViewTest.php b/repo/tests/phpunit/includes/View/EntityViewTest.php similarity index 98% rename
[MediaWiki-commits] [Gerrit] [Open Search Xml] Disable extension, moved into core - change (translatewiki)
Raimond Spekking has uploaded a new change for review. https://gerrit.wikimedia.org/r/176335 Change subject: [Open Search Xml] Disable extension, moved into core .. [Open Search Xml] Disable extension, moved into core https://gerrit.wikimedia.org/r/#/c/171574/ Change-Id: Idfb65ad354bf3e4dd7e84e22cf29738f2e8d4440 --- M groups/MediaWiki/WikimediaAgg.yaml M groups/MediaWiki/mediawiki-extensions.txt 2 files changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/35/176335/1 diff --git a/groups/MediaWiki/WikimediaAgg.yaml b/groups/MediaWiki/WikimediaAgg.yaml index 8592cca..d5f565d 100644 --- a/groups/MediaWiki/WikimediaAgg.yaml +++ b/groups/MediaWiki/WikimediaAgg.yaml @@ -75,7 +75,6 @@ - ext-oai - ext-oauth - ext-oathauth # 2014-06-28 Used on https://wikitech.wikimedia.org - - ext-opensearchxml - ext-openstackmanager # 2011-12-28: labsconsole.wikimedia.org - ext-pageimages - ext-parsoid # All wikis diff --git a/groups/MediaWiki/mediawiki-extensions.txt b/groups/MediaWiki/mediawiki-extensions.txt index 94ea2a1..5c5527a 100644 --- a/groups/MediaWiki/mediawiki-extensions.txt +++ b/groups/MediaWiki/mediawiki-extensions.txt @@ -1460,7 +1460,7 @@ Open Graph Meta magicfile = OpenGraphMeta/OpenGraphMeta.magic.php -Open Search Xml +# Open Search Xml # Moved into core, Ie0ab90902ede9499879402290006466efba479e9 2014-11-27 Open Stack Manager aliasfile = OpenStackManager/OpenStackManager.alias.php -- To view, visit https://gerrit.wikimedia.org/r/176335 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idfb65ad354bf3e4dd7e84e22cf29738f2e8d4440 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] [Open Search Xml] Disable extension, moved into core - change (translatewiki)
Raimond Spekking has submitted this change and it was merged. Change subject: [Open Search Xml] Disable extension, moved into core .. [Open Search Xml] Disable extension, moved into core https://gerrit.wikimedia.org/r/#/c/171574/ Change-Id: Idfb65ad354bf3e4dd7e84e22cf29738f2e8d4440 --- M groups/MediaWiki/WikimediaAgg.yaml M groups/MediaWiki/mediawiki-extensions.txt 2 files changed, 1 insertion(+), 2 deletions(-) Approvals: Raimond Spekking: Verified; Looks good to me, approved diff --git a/groups/MediaWiki/WikimediaAgg.yaml b/groups/MediaWiki/WikimediaAgg.yaml index 8592cca..d5f565d 100644 --- a/groups/MediaWiki/WikimediaAgg.yaml +++ b/groups/MediaWiki/WikimediaAgg.yaml @@ -75,7 +75,6 @@ - ext-oai - ext-oauth - ext-oathauth # 2014-06-28 Used on https://wikitech.wikimedia.org - - ext-opensearchxml - ext-openstackmanager # 2011-12-28: labsconsole.wikimedia.org - ext-pageimages - ext-parsoid # All wikis diff --git a/groups/MediaWiki/mediawiki-extensions.txt b/groups/MediaWiki/mediawiki-extensions.txt index 94ea2a1..5c5527a 100644 --- a/groups/MediaWiki/mediawiki-extensions.txt +++ b/groups/MediaWiki/mediawiki-extensions.txt @@ -1460,7 +1460,7 @@ Open Graph Meta magicfile = OpenGraphMeta/OpenGraphMeta.magic.php -Open Search Xml +# Open Search Xml # Moved into core, Ie0ab90902ede9499879402290006466efba479e9 2014-11-27 Open Stack Manager aliasfile = OpenStackManager/OpenStackManager.alias.php -- To view, visit https://gerrit.wikimedia.org/r/176335 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idfb65ad354bf3e4dd7e84e22cf29738f2e8d4440 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 Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Upgrade phabricator plugins to force UTF-8 for conduit - change (operations...plugins)
Hello Chad, I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/176336 to review the following change. Change subject: Upgrade phabricator plugins to force UTF-8 for conduit .. Upgrade phabricator plugins to force UTF-8 for conduit its-phabricator is built from 9edf90a182e43bfeea7ebbcb20d4a52b6213600d (with its-hooks at 369c7d8a5a97ef8f074bd6c41d34e88b036f2d26) its-phabricator-from-bugzilla is built from 97c5f02d3ca6259488a763515251c5cc57a11a51 (with its-hooks at 3b8a1d4abaa6010faa0a18af8b7a00e68593f50c) Bug: T75788 Change-Id: I85d284577eb5d2cae9c46114f32a6ceb5dafb13b --- M its-phabricator-from-bugzilla.jar M its-phabricator.jar 2 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/gerrit/plugins refs/changes/36/176336/1 diff --git a/its-phabricator-from-bugzilla.jar b/its-phabricator-from-bugzilla.jar index 20cba44..5eb5c39 100644 --- a/its-phabricator-from-bugzilla.jar +++ b/its-phabricator-from-bugzilla.jar Binary files differ diff --git a/its-phabricator.jar b/its-phabricator.jar index d310ac8..c1840e9 100644 --- a/its-phabricator.jar +++ b/its-phabricator.jar Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/176336 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I85d284577eb5d2cae9c46114f32a6ceb5dafb13b Gerrit-PatchSet: 1 Gerrit-Project: operations/gerrit/plugins Gerrit-Branch: master Gerrit-Owner: QChris christ...@quelltextlich.at Gerrit-Reviewer: Chad ch...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] reimage: add a few configs, beautify output - change (operations/puppet)
Giuseppe Lavagetto has submitted this change and it was merged. Change subject: reimage: add a few configs, beautify output .. reimage: add a few configs, beautify output Change-Id: I255e94564efcd2fe8c481c3ecbf3d4a949f4cb2b Signed-off-by: Giuseppe Lavagetto glavage...@wikimedia.org --- M modules/puppetmaster/files/reimage.sh 1 file changed, 37 insertions(+), 13 deletions(-) Approvals: Giuseppe Lavagetto: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/puppetmaster/files/reimage.sh b/modules/puppetmaster/files/reimage.sh index faec1f2..29149c1 100755 --- a/modules/puppetmaster/files/reimage.sh +++ b/modules/puppetmaster/files/reimage.sh @@ -6,6 +6,8 @@ set -u SLEEPTIME=60 FORCE=0 +NOCLEAN=0 +NOREBOOT=0 function log { echo $@ @@ -18,6 +20,7 @@ # An additional, paranoid check. if puppet cert list --all | fgrep -q ${nodename}; then log unable to clean puppet cert, please check manually +log Maybe you need to use the -n switch? exit 1 fi log cleaning puppet facts cache for ${nodename} @@ -40,6 +43,7 @@ # salt-key --delete above exits 0 regardless, double check if salt-key --list accepted | fgrep -q ${nodename}; then log unable to clean salt key, please check manually +log Maybe you need to use the -n switch? exit 1 fi } @@ -47,15 +51,16 @@ function sign_puppet { nodename=${1} force_yes=${2} +log Seeking the Puppet certificate to sign while true; do -log Seeking the node cert to sign res=$(puppet cert list | sed -ne s/\$nodename\//p) if [ x${res} == x ]; then -log cert not found, sleeping for ${SLEEPTIME}s +#log cert not found, sleeping for ${SLEEPTIME}s +echo -n . sleep $SLEEPTIME continue fi - +echo + if [ ${force_yes} -eq 0 ]; then echo We have found a key for ${nodename} \ with the following fingerprint: @@ -76,13 +81,15 @@ function sign_salt { nodename=${1} force_yes=${2} +log Seeking the SALT node key to add +log This is the time to start a puppet run on the host. while true; do -log Seeking the node key to add if ! salt-key --list unaccepted | fgrep -q ${nodename}; then -log key not found, sleeping for ${SLEEPTIME}s +echo -n . sleep $SLEEPTIME continue fi; +echo + if [ ${force_yes} -eq 1 ]; then salt-key -y -a ${nodename} else @@ -104,19 +111,34 @@ export IPMI_PASSWORD ipmitool -I lanplus -H ${mgmtname} -U root -E chassis bootdev pxe ipmitool -I lanplus -H ${mgmtname} -U root -E chassis power cycle - } +function enable_and_run_puppet { +nodename=${1} +log Enabling puppet +ssh -i /root/.ssh/install_new -o UserKnownHostsFile=${hostsfile} -o GlobalKnownHostsFile=/dev/null ${nodename} puppet agent --enable +log Spawning the first puppet run as well +ssh -q -i /root/.ssh/install_new -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null ${nodename} puppet agent -t ${nodename}.puppetrun.log 21 +log The first puppet run is ongoing, you can see what the result is in the file ${nodename}.puppetrun.log +} + + function usage { -echo Usage: $0 [-y][-s SECONDS] nodename mgmtname; exit 1; +echo Usage: $0 [-y][-r][-n][-s SECONDS] nodename mgmtname; exit 1; } ## Main script -while getopts ys: option; do +while getopts yrns: option; do case $option in y) FORCE=1 +;; +r) +NOREBOOT=1 +;; +n) +NOCLEAN=1 ;; s) SLEEPTIME=${OPTARG} @@ -127,15 +149,17 @@ esac done shift $((OPTIND-1)) -nodename=$1 -mgmtname=$2 +nodename=${1:-} +mgmtname=${2:-} test -z ${nodename} usage test -z ${mgmtname} usage log Preparing reimaging of node ${nodename} -clean_puppet $nodename -clean_salt $nodename $FORCE -set_pxe_and_reboot $mgmtname +if [ $NOCLEAN -eq 0 ]; then +clean_puppet $nodename +clean_salt $nodename $FORCE +fi; +test $NOREBOOT -eq 0 set_pxe_and_reboot $mgmtname sign_puppet $nodename $FORCE sign_salt $nodename $FORCE -- To view, visit https://gerrit.wikimedia.org/r/175965 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I255e94564efcd2fe8c481c3ecbf3d4a949f4cb2b Gerrit-PatchSet: 5 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Giuseppe Lavagetto glavage...@wikimedia.org Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org Gerrit-Reviewer: Filippo Giunchedi fgiunch...@wikimedia.org Gerrit-Reviewer: Giuseppe Lavagetto glavage...@wikimedia.org Gerrit-Reviewer: jenkins-bot
[MediaWiki-commits] [Gerrit] Language fallback for labels of referenced items. - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Language fallback for labels of referenced items. .. Language fallback for labels of referenced items. Change-Id: I3973b059ec9ea03cd3cbcdd672ee1a0c8432d262 --- M lib/includes/LanguageFallbackChain.php M lib/tests/phpunit/LanguageFallbackChainTest.php M repo/includes/EntityParserOutputGenerator.php M repo/includes/EntityParserOutputGeneratorFactory.php 4 files changed, 47 insertions(+), 8 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/includes/LanguageFallbackChain.php b/lib/includes/LanguageFallbackChain.php index 4bd2f7d..1736535 100644 --- a/lib/includes/LanguageFallbackChain.php +++ b/lib/includes/LanguageFallbackChain.php @@ -39,6 +39,23 @@ } /** +* Return language codes to use when fetching entries from the database. +* +* @see LanguageWithConversion::getFetchLanguageCode +* +* @return string[] +*/ + public function getFetchLanguageCodes() { + $codes = array(); + + foreach ( $this-chain as $language ) { + $codes[] = $language-getFetchLanguageCode(); + } + + return $codes; + } + + /** * Try to fetch the best value in a multilingual data array. * * @param string[]|array[] $data Multilingual data with language codes as keys diff --git a/lib/tests/phpunit/LanguageFallbackChainTest.php b/lib/tests/phpunit/LanguageFallbackChainTest.php index e1294d5..ed845eb 100644 --- a/lib/tests/phpunit/LanguageFallbackChainTest.php +++ b/lib/tests/phpunit/LanguageFallbackChainTest.php @@ -3,7 +3,9 @@ namespace Wikibase\Test; use Language; +use Wikibase\LanguageFallbackChain; use Wikibase\LanguageFallbackChainFactory; +use Wikibase\LanguageWithConversion; /** * @covers Wikibase\LanguageFallbackChain @@ -198,4 +200,28 @@ ); } + public function provideFetchLanguageCodes() { + return array( + 'empty' = array( array() ), + 'de-ch' = array( array( 'de-ch', 'de', 'en' ) ), + 'zh' = array( array( 'zh-hans', 'zh-hant', 'zh-cn', 'zh-tw', 'zh-hk', 'zh-sg', 'zh-mo', 'zh-my', 'en' ) ), + ); + } + + /** +* @dataProvider provideFetchLanguageCodes +*/ + public function testGetFetchLanguageCodes( array $languages ) { + $languagesWithConversion = array(); + + foreach ( $languages as $language ) { + $languagesWithConversion[] = LanguageWithConversion::factory( $language ); + } + + $chain = new LanguageFallbackChain( $languagesWithConversion ); + + $codes = $chain-getFetchLanguageCodes(); + $this-assertEquals( $languages, $codes ); + } + } diff --git a/repo/includes/EntityParserOutputGenerator.php b/repo/includes/EntityParserOutputGenerator.php index 767a319..6da3f13 100644 --- a/repo/includes/EntityParserOutputGenerator.php +++ b/repo/includes/EntityParserOutputGenerator.php @@ -7,7 +7,6 @@ use ValueFormatters\ValueFormatter; use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\Item; -use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\SiteLinkList; use Wikibase\DataModel\StatementListProvider; use Wikibase\Lib\Store\EntityInfoBuilderFactory; @@ -221,10 +220,9 @@ $entityInfoBuilder-resolveRedirects(); $entityInfoBuilder-removeMissing(); - // @todo: apply language fallback! $entityInfoBuilder-collectTerms( array( 'label', 'description' ), - array( $this-languageCode ) + $this-languageFallbackChain-getFetchLanguageCodes() ); $entityInfoBuilder-collectDataTypes(); diff --git a/repo/includes/EntityParserOutputGeneratorFactory.php b/repo/includes/EntityParserOutputGeneratorFactory.php index 1efa6cc..bdb1463 100644 --- a/repo/includes/EntityParserOutputGeneratorFactory.php +++ b/repo/includes/EntityParserOutputGeneratorFactory.php @@ -131,11 +131,9 @@ * @return LanguageFallbackChain */ private function getLanguageFallbackChain( $languageCode ) { - // @fixme inject User - $context = RequestContext::getMain(); - - return $this-languageFallbackChainFactory-newFromUserAndLanguageCodeForPageView( - $context-getUser(), + // Language fallback must depend ONLY on the target language, + // so we don't confuse the parser cache with user specific HTML. + return $this-languageFallbackChainFactory-newFromLanguageCode( $languageCode
[MediaWiki-commits] [Gerrit] Remove broken conditional branch using a non-existing object - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Remove broken conditional branch using a non-existing object .. Remove broken conditional branch using a non-existing object Change-Id: I369b2f048215f23407f99c8784e88f8b8102ccee --- M client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php 1 file changed, 1 insertion(+), 5 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php index 2bad18d..3544cad 100644 --- a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php +++ b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php @@ -93,11 +93,7 @@ $item-setId( $id ); foreach ( $siteLinks as $siteId = $page ) { - if ( is_int( $siteId ) ) { - $siteIdentifier = $this-site-getGlobalId(); - } else { - $siteIdentifier = $siteId; - } + $siteIdentifier = $siteId; $item-getSiteLinkList()-addNewSiteLink( $siteIdentifier, $page ); } -- To view, visit https://gerrit.wikimedia.org/r/175763 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I369b2f048215f23407f99c8784e88f8b8102ccee Gerrit-PatchSet: 10 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Stop using deprecated Entity method in updateMockRepo - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Stop using deprecated Entity method in updateMockRepo .. Stop using deprecated Entity method in updateMockRepo Change-Id: Idb67a3a06c1067b3fb7e6ece7e157832712e8e82 --- M client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php index fdfadd9..2bad18d 100644 --- a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php +++ b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php @@ -89,8 +89,8 @@ private function updateMockRepo( MockRepository $repo, $entities ) { foreach ( $entities as $id = $siteLinks ) { if ( !( $siteLinks instanceof Entity ) ) { - $entity = Item::newEmpty(); - $entity-setId( new ItemId( $id ) ); + $item = Item::newEmpty(); + $item-setId( $id ); foreach ( $siteLinks as $siteId = $page ) { if ( is_int( $siteId ) ) { @@ -99,13 +99,13 @@ $siteIdentifier = $siteId; } - $entity-addSiteLink( new SiteLink( $siteIdentifier, $page ) ); + $item-getSiteLinkList()-addNewSiteLink( $siteIdentifier, $page ); } } else { - $entity = $siteLinks; + $item = $siteLinks; } - $repo-putEntity( $entity ); + $repo-putEntity( $item ); } } -- To view, visit https://gerrit.wikimedia.org/r/175762 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idb67a3a06c1067b3fb7e6ece7e157832712e8e82 Gerrit-PatchSet: 10 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updated code documentation - change (mediawiki...WikibaseJavaScriptApi)
Henning Snater has uploaded a new change for review. https://gerrit.wikimedia.org/r/176337 Change subject: Updated code documentation .. Updated code documentation Updated code documentation to be able to generate documentation using JSDuck. Includes resetting @since tags to 1.0. Change-Id: I8d08e17970faec48565b1af6683594301725d41f --- M .jshintrc M README.md M init.php M src/FormatValueCaller.js M src/ParseValueCaller.js M src/RepoApi.js M src/RepoApiError.js M src/getLocationAgnosticMwApi.js M src/namespace.js 9 files changed, 470 insertions(+), 296 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseJavaScriptApi refs/changes/37/176337/1 diff --git a/.jshintrc b/.jshintrc index a5afa4d..832d316 100644 --- a/.jshintrc +++ b/.jshintrc @@ -48,7 +48,6 @@ browser : true, // Standard browser globals e.g. `window`, `document`. - indent: 4, quotmark: false, maxlen: 100, maxparams: 7, diff --git a/README.md b/README.md index eb9ac81..8c60801 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ ## Release notes +### 1.0.2 (dev) + + Enhancements +* Updated code documentation to be able to generate documentation using JSDuck. + ### 1.0.1 (2014-11-28) * Bump the data-values/javascript dependency to 0.6.0 so that it matches Wikibase.git's. diff --git a/init.php b/init.php index 25a9fa4..301bd19 100644 --- a/init.php +++ b/init.php @@ -1,6 +1,6 @@ ?php -define( 'WIKIBASE_JAVASCRIPT_API_VERSION', '1.0.1' ); +define( 'WIKIBASE_JAVASCRIPT_API_VERSION', '1.0.2-dev' ); if ( defined( 'MEDIAWIKI' ) ) { call_user_func( function() { diff --git a/src/FormatValueCaller.js b/src/FormatValueCaller.js index 0f44558..be62a2e 100644 --- a/src/FormatValueCaller.js +++ b/src/FormatValueCaller.js @@ -8,6 +8,11 @@ var MODULE = wb.api; /** +* @class wikibase.api.FormatValueCaller +* @since 1.0 +* @licence GNU GPL v2+ +* @author H. Snater mediaw...@snater.com +* * @constructor * * @param {wikibase.api.RepoApi} api @@ -21,30 +26,36 @@ $.extend( SELF.prototype, { /** -* @type {wikibase.api.RepoApi} +* @property {wikibase.api.RepoApi} +* @private */ _api: null, /** -* @type {dataTypes.DataTypeStore} +* @property {dataTypes.DataTypeStore} +* @private */ _dataTypeStore: null, /** * Makes a request to the API to format values on the server side. Will return a -* jQuery.Promise which will be resolved if formatting is successful or rejected if it fails -* or the API cannot be reached. -* @since 0.5 +* ```jQuery.Promise``` which will be resolved if formatting is successful or rejected if it +* fails or the API cannot be reached. * * @param {dataValues.DataValue} dataValue -* @param {string} [dataType] -* @param {string} [outputFormat] +* @param {string|Object} [dataType] ```DataType``` id. +*Assumed to be ```outputFormat``` if the ```dataTypeStore``` the +*```FormatValueCaller``` has been initialized with, does not contain a data type +*whose id matches the string supplied via this argument. +*Assumed to be ```options``` if {Object} and no additional arguments are provided. +* @param {string|Object} [outputFormat] +*Assumed to be ```options``` if {Object} and no additional arguments are provided. * @param {Object} [options] -* @return {jQuery.Promise} -* Resolved parameters: -* - {string} Formatted DataValue. -* Rejected parameters: -* - {wikibase.api.RepoApiError} +* @return {Object} jQuery.Promise +* @return {Function} return.done +* @return {string} return.done.formattedValue Formatted ```DataValue```. +* @return {Function} return.fail +* @return {wikibase.api.RepoApiError} error */ formatValue: function( dataValue, dataType, outputFormat, options ) { diff --git a/src/ParseValueCaller.js b/src/ParseValueCaller.js index 01f06b4..327971b 100644 --- a/src/ParseValueCaller.js +++ b/src/ParseValueCaller.js @@ -1,8 +1,3 @@ -/** - * @licence GNU GPL v2+ - * @author Jeroen De Dauw jeroended...@gmail.com - * @author H. Snater mediaw...@snater.com - */ ( function( wb, $ ) { 'use strict';
[MediaWiki-commits] [Gerrit] BSFileSystemHelper: Added small BS_CACHE_DIR support - change (mediawiki...BlueSpiceFoundation)
Pwirth has submitted this change and it was merged. Change subject: BSFileSystemHelper: Added small BS_CACHE_DIR support .. BSFileSystemHelper: Added small BS_CACHE_DIR support * Added missing wgProfileOut * Used DS instead of '/' * Fixed DataDir/DataPath/CacheDir getter * Added/Fixed some descriptions * Added getCacheFileContent method * Added path check for cache directory to hasTraversal method BsFileSystemHelper is still limited Change-Id: I005419f5ecdcb7a9d6192b3d85eddd4119b8585b --- M includes/utility/FileSystemHelper.class.php 1 file changed, 49 insertions(+), 27 deletions(-) Approvals: Tweichart: Checked; Looks good to me, but someone else must approve Pwirth: Verified; Looks good to me, approved diff --git a/includes/utility/FileSystemHelper.class.php b/includes/utility/FileSystemHelper.class.php index 98a741f..33656d4 100644 --- a/includes/utility/FileSystemHelper.class.php +++ b/includes/utility/FileSystemHelper.class.php @@ -24,17 +24,18 @@ if (empty($sSubDirName)) { wfProfileOut(__METHOD__); return Status::newGood(BS_CACHE_DIR); - } elseif (is_dir(BS_CACHE_DIR . '/' . $sSubDirName)) { + } elseif (is_dir(BS_CACHE_DIR . DS . $sSubDirName)) { wfProfileOut(__METHOD__); - return Status::newGood(BS_CACHE_DIR . '/' . $sSubDirName); + return Status::newGood(BS_CACHE_DIR . DS . $sSubDirName); } - if (!mkdir(BS_CACHE_DIR . '/' . $sSubDirName, 0777, true)) { + if (!mkdir(BS_CACHE_DIR . DS . $sSubDirName, 0777, true)) { wfProfileOut(__METHOD__); return Status::newFatal(BS_CACHE_DIR . ' is not accessible'); } - return Status::newGood(BS_CACHE_DIR . '/' . $sSubDirName); + wfProfileOut(__METHOD__); + return Status::newGood(BS_CACHE_DIR . DS . $sSubDirName); } /** @@ -60,17 +61,17 @@ if (empty($sSubDirName)) { wfProfileOut(__METHOD__); return Status::newGood(BS_DATA_DIR); - } elseif (is_dir(BS_DATA_DIR . '/' . $sSubDirName)) { + } elseif (is_dir(BS_DATA_DIR . DS . $sSubDirName)) { wfProfileOut(__METHOD__); - return Status::newGood(BS_DATA_DIR . '/' . $sSubDirName); + return Status::newGood(BS_DATA_DIR . DS . $sSubDirName); } - if (!mkdir(BS_DATA_DIR . '/' . $sSubDirName, 0777, true)) { + if (!mkdir(BS_DATA_DIR . DS . $sSubDirName, 0777, true)) { wfProfileOut(__METHOD__); return Status::newFatal(BS_DATA_DIR . ' is not accessible'); } wfProfileOut(__METHOD__); - return Status::newGood(BS_DATA_DIR . '/' . $sSubDirName); + return Status::newGood(BS_DATA_DIR . DS . $sSubDirName); } /** @@ -91,7 +92,7 @@ if (!file_put_contents($oStatus-getValue() . DS . $sFileName, $data)) { wfProfileOut(__METHOD__); - return Status::newFatal('could not save ' . $sFileName . ' to location: ' . $oStatus-getValue() . '/' . $sFileName); + return Status::newFatal('could not save ' . $sFileName . ' to location: ' . $oStatus-getValue() . DS . $sFileName); } wfProfileOut(__METHOD__); @@ -117,7 +118,7 @@ //todo: via FileRepo if (!file_put_contents($oStatus-getValue() . DS . $sFileName, $data)) { wfProfileOut(__METHOD__); - return Status::newFatal('could not save ' . $sFileName . ' to location: ' . $oStatus-getValue() . '/' . $sFileName); + return Status::newFatal('could not save ' . $sFileName . ' to location: ' . $oStatus-getValue() . DS . $sFileName); } wfProfileOut(__METHOD__); @@ -130,8 +131,7 @@ * @return string Filepath */ public static function getDataDirectory($sSubDirName = '') { - $sDataDir = ( $sSubDirName ) ? BS_DATA_DIR . DS . $sSubDirName : BS_DATA_DIR; - return $sDataDir; + return empty( $sSubDirName ) ? BS_DATA_DIR : BS_DATA_DIR . DS . $sSubDirName; } /** @@ -139,9 +139,8 @@ * @param string $sSubDirName * @return string URL */ - public static function getDataPath($sSubDirName = '') { - $sDataPath = ( $sSubDirName ) ? BS_DATA_PATH . '/' . $sSubDirName : BS_DATA_PATH; - return $sDataPath; + public static function getDataPath( $sSubDirName = '' ) { + return empty(
[MediaWiki-commits] [Gerrit] remove redundant selfs (per rubocop) - change (mediawiki/selenium)
Stan has uploaded a new change for review. https://gerrit.wikimedia.org/r/176340 Change subject: remove redundant selfs (per rubocop) .. remove redundant selfs (per rubocop) Bug: T75898 Change-Id: I2f77d551dfa25e203c79f83f490baa34252c8a49 --- M .rubocop_todo.yml M lib/mediawiki_selenium/support/pages/login_page.rb 2 files changed, 2 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium refs/changes/40/176340/1 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4a5e35a..3781aae 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -10,11 +10,6 @@ Style/GlobalVars: Enabled: false -# Offense count: 2 -# Cop supports --auto-correct. -Style/RedundantSelf: - Enabled: false - # Offense count: 6 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles. diff --git a/lib/mediawiki_selenium/support/pages/login_page.rb b/lib/mediawiki_selenium/support/pages/login_page.rb index bc3954b..2dac351 100644 --- a/lib/mediawiki_selenium/support/pages/login_page.rb +++ b/lib/mediawiki_selenium/support/pages/login_page.rb @@ -28,8 +28,8 @@ end def login_with(username, password, wait_for_logout_element = true) -self.username_element.when_present.send_keys(username) -self.password_element.when_present.send_keys(password) +username_element.when_present.send_keys(username) +password_element.when_present.send_keys(password) login_element.fire_event('onfocus') login_element.when_present.click logout_element.when_present(10) if wait_for_logout_element -- To view, visit https://gerrit.wikimedia.org/r/176340 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f77d551dfa25e203c79f83f490baa34252c8a49 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/selenium Gerrit-Branch: master Gerrit-Owner: Stan tris...@saticed.me.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] remove cop disable that no longer matches anything - change (mediawiki/selenium)
Stan has uploaded a new change for review. https://gerrit.wikimedia.org/r/176343 Change subject: remove cop disable that no longer matches anything .. remove cop disable that no longer matches anything Bug: T75898 Change-Id: If58b527d691cf15fb2157eb6282ccb7244a896d0 --- M .rubocop_todo.yml 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium refs/changes/43/176343/1 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7b1de81..bf88706 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -10,7 +10,3 @@ Style/GlobalVars: Enabled: false -# Offense count: 3 -# Cop supports --auto-correct. -Style/UnneededPercentQ: - Enabled: false -- To view, visit https://gerrit.wikimedia.org/r/176343 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If58b527d691cf15fb2157eb6282ccb7244a896d0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/selenium Gerrit-Branch: master Gerrit-Owner: Stan tris...@saticed.me.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] change delimiter for % per rubocop - change (mediawiki/selenium)
Stan has uploaded a new change for review. https://gerrit.wikimedia.org/r/176338 Change subject: change delimiter for % per rubocop .. change delimiter for % per rubocop Bug: T75898 Change-Id: I0c058256b8800b06f7b6baa43769ebf2dc6b0566 --- M .rubocop_todo.yml M lib/mediawiki_selenium/support/hooks.rb 2 files changed, 3 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium refs/changes/38/176338/1 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 2d01a0a..425299e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -10,12 +10,6 @@ Style/GlobalVars: Enabled: false -# Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: PreferredDelimiters. -Style/PercentLiteralDelimiters: - Enabled: false - # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/lib/mediawiki_selenium/support/hooks.rb b/lib/mediawiki_selenium/support/hooks.rb index 81fdf28..f9c1d1b 100644 --- a/lib/mediawiki_selenium/support/hooks.rb +++ b/lib/mediawiki_selenium/support/hooks.rb @@ -98,9 +98,9 @@ if environment == :saucelabs sid = $session_id || sauce_session_id -sauce_api(%{{passed: #{scenario.passed?}}}, sid) -sauce_api(%{{public: true}}, sid) -sauce_api(%{{'build': #{ENV['BUILD_NUMBER']}}}, sid) if ENV['BUILD_NUMBER'] +sauce_api(%({passed: #{scenario.passed?}}), sid) +sauce_api(%({public: true}), sid) +sauce_api(%({'build': #{ENV['BUILD_NUMBER']}}), sid) if ENV['BUILD_NUMBER'] end if @browser -- To view, visit https://gerrit.wikimedia.org/r/176338 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c058256b8800b06f7b6baa43769ebf2dc6b0566 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/selenium Gerrit-Branch: master Gerrit-Owner: Stan tris...@saticed.me.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] correct bracket spacing per rubocop - change (mediawiki/selenium)
Stan has uploaded a new change for review. https://gerrit.wikimedia.org/r/176341 Change subject: correct bracket spacing per rubocop .. correct bracket spacing per rubocop Bug: T75898 Change-Id: I015077f8e7c1710a4b8acca19323f316b5e6c950 --- M .rubocop_todo.yml M lib/mediawiki_selenium/support/env.rb 2 files changed, 2 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium refs/changes/41/176341/1 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3781aae..e01db6a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -10,12 +10,6 @@ Style/GlobalVars: Enabled: false -# Offense count: 6 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles. -Style/SpaceInsideHashLiteralBraces: - Enabled: false - # Offense count: 1 # Cop supports --auto-correct. Style/SpecialGlobalVars: diff --git a/lib/mediawiki_selenium/support/env.rb b/lib/mediawiki_selenium/support/env.rb index ea9c8f8..2168c3f 100644 --- a/lib/mediawiki_selenium/support/env.rb +++ b/lib/mediawiki_selenium/support/env.rb @@ -64,7 +64,7 @@ profile['intl.accept_languages'] = configuration[:language] browser = Watir::Browser.new browser_name, profile: profile elsif configuration configuration[:language] browser_name == :chrome -prefs = {intl: {accept_languages: configuration[:language]}} +prefs = { intl: { accept_languages: configuration[:language] } } browser = Watir::Browser.new browser_name, prefs: prefs elsif configuration configuration[:language] browser_name == :phantomjs capabilities = Selenium::WebDriver::Remote::Capabilities.phantomjs @@ -89,7 +89,7 @@ url: https://saucelabs.com/rest/v1/#{ENV['SAUCE_ONDEMAND_USERNAME']}/jobs/#{session_id}, user: ENV['SAUCE_ONDEMAND_USERNAME'], password: ENV['SAUCE_ONDEMAND_ACCESS_KEY'], -headers: {content_type: 'application/json'}, +headers: { content_type: 'application/json' }, payload: json ) end -- To view, visit https://gerrit.wikimedia.org/r/176341 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I015077f8e7c1710a4b8acca19323f316b5e6c950 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/selenium Gerrit-Branch: master Gerrit-Owner: Stan tris...@saticed.me.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] cop no longer firing, removing - change (mediawiki/selenium)
Stan has uploaded a new change for review. https://gerrit.wikimedia.org/r/176339 Change subject: cop no longer firing, removing .. cop no longer firing, removing Bug: T75898 Change-Id: I04a2ff451d8ebe0e0fc3986f8d3da075b75ea427 --- M .rubocop_todo.yml 1 file changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium refs/changes/39/176339/1 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 425299e..4a5e35a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -10,12 +10,6 @@ Style/GlobalVars: Enabled: false -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/PercentQLiterals: - Enabled: false - # Offense count: 2 # Cop supports --auto-correct. Style/RedundantSelf: -- To view, visit https://gerrit.wikimedia.org/r/176339 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04a2ff451d8ebe0e0fc3986f8d3da075b75ea427 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/selenium Gerrit-Branch: master Gerrit-Owner: Stan tris...@saticed.me.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] use english special globals per rubocop - change (mediawiki/selenium)
Stan has uploaded a new change for review. https://gerrit.wikimedia.org/r/176342 Change subject: use english special globals per rubocop .. use english special globals per rubocop Bug: T75898 Change-Id: Ia9b1ee30f700d39d9c5e23ab437efdc6dba613da --- M .rubocop_todo.yml M mediawiki_selenium.gemspec 2 files changed, 2 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium refs/changes/42/176342/1 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e01db6a..7b1de81 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -10,11 +10,6 @@ Style/GlobalVars: Enabled: false -# Offense count: 1 -# Cop supports --auto-correct. -Style/SpecialGlobalVars: - Enabled: false - # Offense count: 3 # Cop supports --auto-correct. Style/UnneededPercentQ: diff --git a/mediawiki_selenium.gemspec b/mediawiki_selenium.gemspec index 3455df2..1a446e0 100644 --- a/mediawiki_selenium.gemspec +++ b/mediawiki_selenium.gemspec @@ -1,4 +1,5 @@ # coding: utf-8 +require 'English' lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'mediawiki_selenium/version' @@ -19,7 +20,7 @@ spec.homepage = 'https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/selenium' spec.license = 'GPL-2' - spec.files = `git ls-files`.split($/) + spec.files = `git ls-files`.split($RS) spec.require_paths = ['lib'] spec.add_runtime_dependency 'cucumber', '~ 1.3', '= 1.3.10' -- To view, visit https://gerrit.wikimedia.org/r/176342 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9b1ee30f700d39d9c5e23ab437efdc6dba613da Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/selenium Gerrit-Branch: master Gerrit-Owner: Stan tris...@saticed.me.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] remove empty rubocop_todo - change (mediawiki/selenium)
Stan has uploaded a new change for review. https://gerrit.wikimedia.org/r/176345 Change subject: remove empty rubocop_todo .. remove empty rubocop_todo Bug: T75898 Change-Id: I3fc593f1b741262f73ae4c94aec7cf86711c553a --- M .rubocop.yml D .rubocop_todo.yml 2 files changed, 0 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium refs/changes/45/176345/1 diff --git a/.rubocop.yml b/.rubocop.yml index 44f44f7..fdb5004 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,3 @@ -inherit_from: .rubocop_todo.yml - Metrics/ClassLength: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index eaa2d0d..000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,7 +0,0 @@ -# This configuration was generated by `rubocop --auto-gen-config` -# on 2014-10-20 16:46:25 +0200 using RuboCop version 0.26.1. -# The point is for the user to remove these configuration records -# one by one as the offenses are removed from the code base. -# Note that changes in the inspected code, or installation of new -# versions of RuboCop, may require this file to be generated again. - -- To view, visit https://gerrit.wikimedia.org/r/176345 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3fc593f1b741262f73ae4c94aec7cf86711c553a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/selenium Gerrit-Branch: master Gerrit-Owner: Stan tris...@saticed.me.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] disable global cop around globals that can't easily be removed - change (mediawiki/selenium)
Stan has uploaded a new change for review. https://gerrit.wikimedia.org/r/176344 Change subject: disable global cop around globals that can't easily be removed .. disable global cop around globals that can't easily be removed Bug: T75898 Change-Id: I2646e0faab250033de85f3326fc29eebced3abe2 --- M .rubocop_todo.yml M lib/mediawiki_selenium/support/hooks.rb M lib/mediawiki_selenium/support/sauce.rb 3 files changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium refs/changes/44/176344/1 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index bf88706..eaa2d0d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -5,8 +5,3 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 7 -# Configuration parameters: AllowedVariables. -Style/GlobalVars: - Enabled: false - diff --git a/lib/mediawiki_selenium/support/hooks.rb b/lib/mediawiki_selenium/support/hooks.rb index f9c1d1b..3d0f028 100644 --- a/lib/mediawiki_selenium/support/hooks.rb +++ b/lib/mediawiki_selenium/support/hooks.rb @@ -72,6 +72,8 @@ Before do |scenario| @random_string = Random.new.rand.to_s + # rubocop:disable Style/GlobalVars + # need $browser to be global to persist across scenarios # CirrusSearch and VisualEditor need this if ENV['REUSE_BROWSER'] == 'true' $browser @browser = $browser @@ -82,7 +84,9 @@ $browser = @browser # CirrusSearch and VisualEditor need this end + # need $session_id to be global to picked up by the custom output formatter $session_id = sauce_session_id + # rubocop:enable Style/GlobalVars end After do |scenario| @@ -97,7 +101,7 @@ end if environment == :saucelabs -sid = $session_id || sauce_session_id +sid = $session_id || sauce_session_id # rubocop:disable Style/GlobalVars sauce_api(%({passed: #{scenario.passed?}}), sid) sauce_api(%({public: true}), sid) sauce_api(%({'build': #{ENV['BUILD_NUMBER']}}), sid) if ENV['BUILD_NUMBER'] diff --git a/lib/mediawiki_selenium/support/sauce.rb b/lib/mediawiki_selenium/support/sauce.rb index 5086f43..a7ac0f9 100644 --- a/lib/mediawiki_selenium/support/sauce.rb +++ b/lib/mediawiki_selenium/support/sauce.rb @@ -18,8 +18,10 @@ def format_exception(exception) if ENV['HEADLESS'] == 'true' sauce_job_page = '' +# rubocop:disable Style/GlobalVars elsif $session_id sauce_job_page = Sauce Labs job URL: http://saucelabs.com/jobs/#{$session_id}\n; +# rubocop:enable Style/GlobalVars else sauce_job_page = 'Uh-oh. Could not find link to Sauce Labs job URL.' end -- To view, visit https://gerrit.wikimedia.org/r/176344 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2646e0faab250033de85f3326fc29eebced3abe2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/selenium Gerrit-Branch: master Gerrit-Owner: Stan tris...@saticed.me.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add unique sessionIDs - change (mediawiki...citoid)
Mvolz has submitted this change and it was merged. Change subject: Add unique sessionIDs .. Add unique sessionIDs Zotero requests require sessionIDs. Previously was using the same string for all requests; now using a different string for each request to the citoid app (but the same string for multiple zotero requests in the same request). Change-Id: I2406e9ada1ec208a5ea9fc6158ad42b2dff8652b --- M server.js 1 file changed, 7 insertions(+), 3 deletions(-) Approvals: Mvolz: Verified; Looks good to me, approved Catrope: Looks good to me, approved diff --git a/server.js b/server.js index 4d48c55..18ad095 100644 --- a/server.js +++ b/server.js @@ -17,7 +17,9 @@ }) .alias( 'c', 'config' ); var argv = opts.argv; +var crypto = require('crypto'); +/*Local modules*/ var distinguish = require('./lib/distinguish.js').distinguish; var requestFromURL = require('./lib/requests.js').requestFromURL; @@ -80,7 +82,7 @@ var opts, parsedURL, format = req.body.format, requestedURL = req.body.url, - sessionID = 123abc; + sessionID = crypto.randomBytes(20).toString('hex'); log.info(req); @@ -138,9 +140,11 @@ dSearch = decodeURIComponent(search); //decode urlencoded search string + sessionID = crypto.randomBytes(20).toString('hex'); //required zotero- not terribly important for this to be secure + opts = { zoteroURL:zoteroURL, - sessionID:123abc, + sessionID:sessionID, format:format }; @@ -152,7 +156,7 @@ res.send(body); } else { - res.statusCode = 520; //Server at requested location not available + res.statusCode = 520; //TODO: Server at requested location not available, not valid for non-urls res.send(body); } }); -- To view, visit https://gerrit.wikimedia.org/r/175974 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2406e9ada1ec208a5ea9fc6158ad42b2dff8652b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/citoid Gerrit-Branch: master Gerrit-Owner: Mvolz mv...@wikimedia.org Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Mvolz mv...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] CRUDPanel: Added hook - change (mediawiki...BlueSpiceFoundation)
Pwirth has uploaded a new change for review. https://gerrit.wikimedia.org/r/176346 Change subject: CRUDPanel: Added hook .. CRUDPanel: Added hook * Added document trigger to GRUDPanel initComponent Change-Id: Iaf5c7aa1fc9765cb66b46451047660dc198bb0f3 --- M resources/bluespice.extjs/BS/CRUDPanel.js 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/46/176346/1 diff --git a/resources/bluespice.extjs/BS/CRUDPanel.js b/resources/bluespice.extjs/BS/CRUDPanel.js index 2759475..5957c3b 100644 --- a/resources/bluespice.extjs/BS/CRUDPanel.js +++ b/resources/bluespice.extjs/BS/CRUDPanel.js @@ -67,6 +67,8 @@ this.addEvents( 'button-add','button-edit','button-delete' ); + $(document).trigger('BSCRUDPanelInitComponent', [this] ); + this.afterInitComponent( arguments ); this.callParent(arguments); -- To view, visit https://gerrit.wikimedia.org/r/176346 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf5c7aa1fc9765cb66b46451047660dc198bb0f3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth wi...@hallowelt.biz ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adjust tools column z-index to make the sticky header transi... - change (mediawiki...ContentTranslation)
Pginer has uploaded a new change for review. https://gerrit.wikimedia.org/r/176347 Change subject: Adjust tools column z-index to make the sticky header transition less jarring .. Adjust tools column z-index to make the sticky header transition less jarring The z-index is adjusted to make sure the publish button does not cover the tools column when moving when the header becomes fixed on top (which happens when you scroll down). Change-Id: I32bea280f0110acea6713938b0dce09dc56bacac --- M modules/translationview/styles/ext.cx.translationview.less 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/47/176347/1 diff --git a/modules/translationview/styles/ext.cx.translationview.less b/modules/translationview/styles/ext.cx.translationview.less index 6aeb2db..605b886 100644 --- a/modules/translationview/styles/ext.cx.translationview.less +++ b/modules/translationview/styles/ext.cx.translationview.less @@ -73,6 +73,7 @@ background: #f0f0f0; min-height: 100vh; position: relative; + z-index: 20; .sticky { .stick-to-side; -- To view, visit https://gerrit.wikimedia.org/r/176347 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32bea280f0110acea6713938b0dce09dc56bacac Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Pginer pgi...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] CRUDPanel: Added hook - change (mediawiki...BlueSpiceFoundation)
Pwirth has uploaded a new change for review. https://gerrit.wikimedia.org/r/176348 Change subject: CRUDPanel: Added hook .. CRUDPanel: Added hook * Added document trigger to GRUDPanel initComponent Change-Id: I2d5d9347723636825c101176158ecdf45cd25114 --- M resources/bluespice.extjs/BS/CRUDPanel.js 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/48/176348/1 diff --git a/resources/bluespice.extjs/BS/CRUDPanel.js b/resources/bluespice.extjs/BS/CRUDPanel.js index cd4c98a..f2844ca 100644 --- a/resources/bluespice.extjs/BS/CRUDPanel.js +++ b/resources/bluespice.extjs/BS/CRUDPanel.js @@ -67,6 +67,8 @@ this.addEvents( 'button-add','button-edit','button-delete' ); + $(document).trigger('BSCRUDPanelInitComponent', [this] ); + this.afterInitComponent( arguments ); this.callParent(arguments); -- To view, visit https://gerrit.wikimedia.org/r/176348 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d5d9347723636825c101176158ecdf45cd25114 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: REL1_22 Gerrit-Owner: Pwirth wi...@hallowelt.biz ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [FEAT] Date: Add/subtract months from a date - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/176349 Change subject: [FEAT] Date: Add/subtract months from a date .. [FEAT] Date: Add/subtract months from a date This allows to add or subtract any number of months as long as the number of months are an integer and the year contains at least two months. So 2014-11-28 + 1 month results in 2014-12-28. It just adds or subtracts one day and everytime the month number changes the number of months changed are reduced by one until no changes are left. It's then just iterating as long as it reaches the same day in the month. Bug: T73124 Change-Id: I4b204465b7224f4d86e3f4462847002f3382ac3a --- M pywikibot/date.py 1 file changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/49/176349/1 diff --git a/pywikibot/date.py b/pywikibot/date.py index 350bdf7..bc34323 100644 --- a/pywikibot/date.py +++ b/pywikibot/date.py @@ -2343,5 +2343,28 @@ return formats['YearAD'][lang](year) +def month_delta(date, month_delta=1): + +Add or subtract months from the date. + +@param date: The starting date +@type date: date +@param month_delta: The amount of months added or subtracted. +@type month_delta: int + +if int(month_delta) != month_delta: +raise ValueError('Month delta must be an integer') +delta = -1 if month_delta 0 else +1 +month = date.month +target_day = date.day +while date.day != target_day or month_delta != 0: +date += datetime.timedelta(days=delta) +if date.month != month: +# month number has changed +month_delta -= delta +month = date.month +return date + + if __name__ == __main__: print(__doc__) -- To view, visit https://gerrit.wikimedia.org/r/176349 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b204465b7224f4d86e3f4462847002f3382ac3a Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] tools: Add postgis package to exec_environ - change (operations/puppet)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/176350 Change subject: tools: Add postgis package to exec_environ .. tools: Add postgis package to exec_environ Bug: T76226 Change-Id: If4ac5f88d2430f5560cd6f0954f1068ad74dd4fe --- M modules/toollabs/manifests/exec_environ.pp 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/50/176350/1 diff --git a/modules/toollabs/manifests/exec_environ.pp b/modules/toollabs/manifests/exec_environ.pp index eb592bb..65416d8 100644 --- a/modules/toollabs/manifests/exec_environ.pp +++ b/modules/toollabs/manifests/exec_environ.pp @@ -335,6 +335,7 @@ 'phantomjs', # Bug #66928 'phpunit', 'poppler-utils', # Bug #53869. +'postgis', # Bug T76226 'postgresql-client', 'pstoedit',# Bug 57000 'pv', # Bug 57001 -- To view, visit https://gerrit.wikimedia.org/r/176350 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If4ac5f88d2430f5560cd6f0954f1068ad74dd4fe Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda yuvipa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove ve.instances - change (VisualEditor/VisualEditor)
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/176351 Change subject: Remove ve.instances .. Remove ve.instances A better API is provided by ve.init.target.getSurface(). Gadget documentation has been updated to reflect this. Change-Id: I823b492d1e3bc9496a359cb259b73240c3bf6ed0 --- M src/ui/ve.ui.Surface.js 1 file changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor refs/changes/51/176351/1 diff --git a/src/ui/ve.ui.Surface.js b/src/ui/ve.ui.Surface.js index d648ffd..a001a0d 100644 --- a/src/ui/ve.ui.Surface.js +++ b/src/ui/ve.ui.Surface.js @@ -66,9 +66,6 @@ .append( this.view.$element ); this.localOverlay.$element.append( this.$blockers, this.$controls, this.$menus ); this.globalOverlay.$element.append( this.dialogs.$element ); - - // Make instance globally accessible for debugging - ve.instances.push( this ); }; /* Inheritance */ @@ -94,9 +91,6 @@ * @fires destroy */ ve.ui.Surface.prototype.destroy = function () { - // Remove instance from global array - ve.instances.splice( ve.instances.indexOf( this ), 1 ); - // Stop periodic history tracking in model this.model.stopHistoryTracking(); -- To view, visit https://gerrit.wikimedia.org/r/176351 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I823b492d1e3bc9496a359cb259b73240c3bf6ed0 Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders esand...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert Rearranged site link views - change (mediawiki...Wikibase)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/176352 Change subject: Revert Rearranged site link views .. Revert Rearranged site link views We're not ready for this, yet. This reverts commit 084164575cd8f11f899df32f93e92074b09ef3cf. Change-Id: I358b31daf85c3f0f6c2c100f6e5442a1afe36e84 --- M lib/i18n/en.json M lib/i18n/qqq.json M lib/resources/jquery.wikibase/jquery.wikibase.sitelinkgroupview.js M lib/resources/jquery.wikibase/jquery.wikibase.sitelinklistview.js M lib/resources/jquery.wikibase/jquery.wikibase.sitelinkview.js M lib/resources/jquery.wikibase/resources.php M lib/resources/jquery.wikibase/themes/default/jquery.wikibase.entityview.css M lib/resources/jquery.wikibase/themes/default/jquery.wikibase.sitelinkgrouplistview.css M lib/resources/jquery.wikibase/themes/default/jquery.wikibase.sitelinkgroupview.css M lib/resources/jquery.wikibase/themes/default/jquery.wikibase.sitelinklistview.css M lib/resources/jquery.wikibase/themes/default/jquery.wikibase.sitelinkview.css M repo/i18n/en.json M repo/i18n/qqq.json M repo/includes/View/SiteLinksView.php M repo/resources/jquery/jquery.sticknode.js M repo/resources/templates.php M repo/tests/phpunit/includes/View/SiteLinksViewTest.php 17 files changed, 441 insertions(+), 114 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/52/176352/1 diff --git a/lib/i18n/en.json b/lib/i18n/en.json index 24baca4..b6a94ca 100644 --- a/lib/i18n/en.json +++ b/lib/i18n/en.json @@ -56,6 +56,8 @@ wikibase-replicationnote: Please notice that it can take several minutes until the changes are visible on all wikis., wikibase-sitelinks-wikipedia: Wikipedia pages linked to this item, wikibase-sitelinks-sitename-columnheading: Language, + wikibase-sitelinks-sitename-columnheading-special: Site, + wikibase-sitelinks-siteid-columnheading: Code, wikibase-sitelinks-link-columnheading: Linked page, wikibase-snakview-snaktypeselector-somevalue: unknown value, wikibase-snakview-snaktypeselector-novalue: no value, diff --git a/lib/i18n/qqq.json b/lib/i18n/qqq.json index d73b044..ed69cf5 100644 --- a/lib/i18n/qqq.json +++ b/lib/i18n/qqq.json @@ -65,6 +65,8 @@ wikibase-replicationnote: Note telling the user that it can take a few minutes until the made changes are visible on all wikis.\nPreceded by message {{msg-mw|Wikibase-linkitem-success-link}}, wikibase-sitelinks-wikipedia: [[File:Screenshot WikidataRepo 2012-05-13 A.png|right|0x150px]]\nHeader messages for pages on different Wikipedias linked to this item. Similar messages can be created for each group of target sites, depending on configuration.\nSee also Wikidatas glossary for [[d:Wikidata:Glossary#sitelinks|site links]] and [[d:Wikidata:Glossary#Item|item]].\n{{Related|Wikibase-sitelinks}}, wikibase-sitelinks-sitename-columnheading: Site links table column heading for the column containing the language names.\n{{Identical|Language}}, + wikibase-sitelinks-sitename-columnheading-special: Site links table column heading for the sitename column for special sites such as e.g. Commons.\n{{Identical|Site}}, + wikibase-sitelinks-siteid-columnheading: Site links table column heading for the column containing the language codes.\n{{Identical|Code}}, wikibase-sitelinks-link-columnheading: Site links table column heading for the column containg the title/link of/to the referenced (wiki) page.\n{{Identical|Linked page}}, wikibase-snakview-snaktypeselector-somevalue: Short descriptive title of a some-value snak (see [[d:Wikidata:Glossary]]) used in a drop-down menu allowing to select the snak type when adding or editing a snak. The drop-down menu can be opened by clicking an anchor right next to the input element(s) used to specify a claim's value. Although this is regarded a 'special', seldom used feature, the term 'snak' should be avoided here since the concept of snaks is a technical abstraction that does not give any additional meaning within the user interface. The basic meaning of this option is that a value exists but it is unknown., wikibase-snakview-snaktypeselector-novalue: A short descriptive title of a no-value snak (see [[d:Wikidata:Glossary]]) used in a drop-down menu allowing to select the snak type when adding or editing a snak. The drop-down menu can be opened by clicking an anchor right next to the input element(s) used to specify a claim's value. Although this is regarded a 'special', seldom used feature, the term 'snak' should be avoided here since the concept of snaks is a technical abstraction that does not give any additional meaning within the user interface. The basic meaning of this option is that no value exists., diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.sitelinkgroupview.js
[MediaWiki-commits] [Gerrit] tools: Add postgis package to exec_environ - change (operations/puppet)
Yuvipanda has submitted this change and it was merged. Change subject: tools: Add postgis package to exec_environ .. tools: Add postgis package to exec_environ Bug: T76226 Change-Id: If4ac5f88d2430f5560cd6f0954f1068ad74dd4fe --- M modules/toollabs/manifests/exec_environ.pp 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Yuvipanda: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/toollabs/manifests/exec_environ.pp b/modules/toollabs/manifests/exec_environ.pp index eb592bb..65416d8 100644 --- a/modules/toollabs/manifests/exec_environ.pp +++ b/modules/toollabs/manifests/exec_environ.pp @@ -335,6 +335,7 @@ 'phantomjs', # Bug #66928 'phpunit', 'poppler-utils', # Bug #53869. +'postgis', # Bug T76226 'postgresql-client', 'pstoedit',# Bug 57000 'pv', # Bug 57001 -- To view, visit https://gerrit.wikimedia.org/r/176350 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If4ac5f88d2430f5560cd6f0954f1068ad74dd4fe Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda yuvipa...@gmail.com Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com Gerrit-Reviewer: coren mpellet...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] BsFileSystemHelper: Merged all changes and fixes - change (mediawiki...BlueSpiceFoundation)
Pwirth has uploaded a new change for review. https://gerrit.wikimedia.org/r/176353 Change subject: BsFileSystemHelper: Merged all changes and fixes .. BsFileSystemHelper: Merged all changes and fixes * merged all changes and fixes from master Change-Id: I9537c7bfd1567c3782c7d6bdb16024d998719653 --- M includes/utility/FileSystemHelper.class.php 1 file changed, 86 insertions(+), 55 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/53/176353/1 diff --git a/includes/utility/FileSystemHelper.class.php b/includes/utility/FileSystemHelper.class.php index 7d79dfd..33656d4 100644 --- a/includes/utility/FileSystemHelper.class.php +++ b/includes/utility/FileSystemHelper.class.php @@ -5,7 +5,7 @@ /** * * @param string $sSubDirName -* @return Status +* @return Status */ public static function ensureCacheDirectory($sSubDirName = '') { wfProfileIn(__METHOD__); @@ -13,7 +13,7 @@ return Status::newFatal(wfMessage(bs-filesystemhelper-has-path-traversal)-plain()); if (!empty($sSubDirName) !preg_match('#^[a-zA-Z/\\\]+#', $sSubDirName)) { wfProfileOut(__METHOD__); - return Status::newFatal('Requested subdirectory of ' . BS_DATA_DIR . ' contains illegal chars'); + return Status::newFatal('Requested subdirectory of ' . BS_CACHE_DIR . ' contains illegal chars'); } if (!is_dir(BS_CACHE_DIR)) { if (!mkdir(BS_CACHE_DIR, 0777, true)) { @@ -24,21 +24,24 @@ if (empty($sSubDirName)) { wfProfileOut(__METHOD__); return Status::newGood(BS_CACHE_DIR); - } elseif (is_dir(BS_CACHE_DIR . '/' . $sSubDirName)) { + } elseif (is_dir(BS_CACHE_DIR . DS . $sSubDirName)) { wfProfileOut(__METHOD__); - return Status::newGood(BS_CACHE_DIR . '/' . $sSubDirName); + return Status::newGood(BS_CACHE_DIR . DS . $sSubDirName); } - if (!mkdir(BS_CACHE_DIR . '/' . $sSubDirName, 0777, true)) { + if (!mkdir(BS_CACHE_DIR . DS . $sSubDirName, 0777, true)) { wfProfileOut(__METHOD__); return Status::newFatal(BS_CACHE_DIR . ' is not accessible'); } + + wfProfileOut(__METHOD__); + return Status::newGood(BS_CACHE_DIR . DS . $sSubDirName); } /** * * @param string $sSubDirName -* @return Status +* @return Status */ public static function ensureDataDirectory($sSubDirName = '') { wfProfileIn(__METHOD__); @@ -58,24 +61,24 @@ if (empty($sSubDirName)) { wfProfileOut(__METHOD__); return Status::newGood(BS_DATA_DIR); - } elseif (is_dir(BS_DATA_DIR . '/' . $sSubDirName)) { + } elseif (is_dir(BS_DATA_DIR . DS . $sSubDirName)) { wfProfileOut(__METHOD__); - return Status::newGood(BS_DATA_DIR . '/' . $sSubDirName); + return Status::newGood(BS_DATA_DIR . DS . $sSubDirName); } - if (!mkdir(BS_DATA_DIR . '/' . $sSubDirName, 0777, true)) { + if (!mkdir(BS_DATA_DIR . DS . $sSubDirName, 0777, true)) { wfProfileOut(__METHOD__); return Status::newFatal(BS_DATA_DIR . ' is not accessible'); } wfProfileOut(__METHOD__); - return Status::newGood(BS_DATA_DIR . '/' . $sSubDirName); + return Status::newGood(BS_DATA_DIR . DS . $sSubDirName); } /** * * @param string $sSubDirName * @param mixed $data -* @return Status +* @return Status */ public static function saveToCacheDirectory($sFileName, $data, $sSubDirName = '') { wfProfileIn(__METHOD__); @@ -89,7 +92,7 @@ if (!file_put_contents($oStatus-getValue() . DS . $sFileName, $data)) { wfProfileOut(__METHOD__); - return Status::newFatal('could not save ' . $sFileName . ' to location: ' . $oStatus-getValue() . '/' . $sFileName); + return Status::newFatal('could not save ' . $sFileName . ' to location: ' . $oStatus-getValue() . DS . $sFileName); } wfProfileOut(__METHOD__); @@ -100,7 +103,7 @@ * * @param string $sSubDirName * @param mixed $data -* @return Status +* @return Status */ public static function
[MediaWiki-commits] [Gerrit] Adjust header styling on the dashboard - change (mediawiki...ContentTranslation)
Pginer has uploaded a new change for review. https://gerrit.wikimedia.org/r/176354 Change subject: Adjust header styling on the dashboard .. Adjust header styling on the dashboard This patchset makes the header to be consistent with the style used in the Translation view: white and with a line below (which is actually the border-top of the element below since user controls are not actually wrapped by the header element) Change-Id: I0b7a3986530ded0449a01fac249f5959be350a99 --- M modules/dashboard/styles/ext.cx.dashboard.less 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/54/176354/1 diff --git a/modules/dashboard/styles/ext.cx.dashboard.less b/modules/dashboard/styles/ext.cx.dashboard.less index d2e39ba..6151158 100644 --- a/modules/dashboard/styles/ext.cx.dashboard.less +++ b/modules/dashboard/styles/ext.cx.dashboard.less @@ -21,6 +21,8 @@ .mw-ui-one-whole; padding: 50px; background-color: #fff; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; .cx-cta__action { .mw-ui-one-quarter; @@ -33,6 +35,13 @@ } } +.cx-widget { + .mw-ui-grid; + color: @gray-darker; + background: white; + padding-bottom: 50px; +} + // Do not display the header bar containing the link to dashboard in dashboard page. .cx-header__bar { display: none; -- To view, visit https://gerrit.wikimedia.org/r/176354 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0b7a3986530ded0449a01fac249f5959be350a99 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Pginer pgi...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [WIP] Clean up UsageTablePrimer and related - change (mediawiki...Wikibase)
Thiemo Mättig (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/176356 Change subject: [WIP] Clean up UsageTablePrimer and related .. [WIP] Clean up UsageTablePrimer and related Two problems to be discussed: 1. Why must the addExtensionUpdate be static? 2. Why is the table name passed around as a variable in so many odd places? Change-Id: Icf85ad8ed940a95ba741f2640d06ab506d563dd4 --- M client/includes/Usage/Sql/SqlUsageTracker.php R client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php M client/includes/Usage/Sql/UsageTablePrimer.php M client/includes/Usage/Sql/UsageTableUpdater.php M client/includes/Usage/UsageTracker.php M client/tests/phpunit/includes/Usage/EntityUsageTest.php M client/tests/phpunit/includes/Usage/HashUsageAccumulatorTest.php M client/tests/phpunit/includes/Usage/ParserOutputUsageAccumulatorTest.php M client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php M client/tests/phpunit/includes/Usage/Sql/UsageTablePrimerTest.php M client/tests/phpunit/includes/Usage/Sql/UsageTableUpdaterTest.php M client/tests/phpunit/includes/Usage/UsageAccumulatorContractTester.php M client/tests/phpunit/includes/Usage/UsageLookupContractTester.php M client/tests/phpunit/includes/Usage/UsageTrackerContractTester.php 14 files changed, 55 insertions(+), 70 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/56/176356/1 diff --git a/client/includes/Usage/Sql/SqlUsageTracker.php b/client/includes/Usage/Sql/SqlUsageTracker.php index b29c94b..b907c77 100644 --- a/client/includes/Usage/Sql/SqlUsageTracker.php +++ b/client/includes/Usage/Sql/SqlUsageTracker.php @@ -54,7 +54,7 @@ * @return UsageTableUpdater */ private function newTableUpdater( DatabaseBase $db ) { - return new UsageTableUpdater( $db, 'wbc_entity_usage', $this-batchSize ); + return new UsageTableUpdater( $db, $this-batchSize ); } /** @@ -187,7 +187,7 @@ } $res = $db-select( - 'wbc_entity_usage', + UsageTracker::TABLE_NAME, array( 'eu_aspect', 'eu_entity_id' ), array( 'eu_page_id' = (int)$pageId ), __METHOD__ @@ -239,7 +239,7 @@ $db = $this-connectionManager-getReadConnection(); $res = $db-select( - 'wbc_entity_usage', + UsageTracker::TABLE_NAME, array( 'DISTINCT eu_page_id' ), $where, __METHOD__ @@ -291,7 +291,7 @@ $db = $this-connectionManager-getReadConnection(); $res = $db-select( - 'wbc_entity_usage', + UsageTracker::TABLE_NAME, array( 'eu_entity_id' ), $where, __METHOD__ diff --git a/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdate.php b/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php similarity index 71% rename from client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdate.php rename to client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php index 79fe713..662581a 100644 --- a/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdate.php +++ b/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php @@ -3,6 +3,8 @@ namespace Wikibase\Client\Usage\Sql; use DatabaseUpdater; +use MWException; +use Wikibase\Client\Usage\UsageTracker; use Wikibase\Client\WikibaseClient; use Wikibase\DataModel\Entity\EntityIdParser; @@ -48,36 +50,27 @@ * Applies any schema updates */ public function doSchemaUpdate() { - $table = 'wbc_entity_usage'; - - if ( !$this-dbUpdater-tableExists( $table ) ) { + if ( !$this-dbUpdater-tableExists( UsageTracker::TABLE_NAME ) ) { $db = $this-dbUpdater-getDB(); $script = $this-getUpdateScriptPath( 'entity_usage', $db-getType() ); - $this-dbUpdater-addExtensionTable( $table, $script ); + $this-dbUpdater-addExtensionTable( UsageTracker::TABLE_NAME, $script ); // Register function for populating the table. - // Note that this must be done with a static function, - // for reasons that do not need explaining at this juncture. - $this-dbUpdater-addExtensionUpdate( array( - array( __CLASS__, 'fillUsageTable' ), - $table - ) ); + $this-dbUpdater-addExtensionUpdate( array( array( $this, 'fillUsageTable' ) ) ); } } /** -* Static wrapper for
[MediaWiki-commits] [Gerrit] Adjust tools column z-index to make the sticky header transi... - change (mediawiki...ContentTranslation)
jenkins-bot has submitted this change and it was merged. Change subject: Adjust tools column z-index to make the sticky header transition less jarring .. Adjust tools column z-index to make the sticky header transition less jarring The z-index is adjusted to make sure the publish button does not cover the tools column when moving when the header becomes fixed on top (which happens when you scroll down). Change-Id: I32bea280f0110acea6713938b0dce09dc56bacac --- M modules/translationview/styles/ext.cx.translationview.less 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Santhosh: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/translationview/styles/ext.cx.translationview.less b/modules/translationview/styles/ext.cx.translationview.less index 6aeb2db..605b886 100644 --- a/modules/translationview/styles/ext.cx.translationview.less +++ b/modules/translationview/styles/ext.cx.translationview.less @@ -73,6 +73,7 @@ background: #f0f0f0; min-height: 100vh; position: relative; + z-index: 20; .sticky { .stick-to-side; -- To view, visit https://gerrit.wikimedia.org/r/176347 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I32bea280f0110acea6713938b0dce09dc56bacac Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Pginer pgi...@wikimedia.org Gerrit-Reviewer: Amire80 amir.ahar...@mail.huji.ac.il Gerrit-Reviewer: Santhosh santhosh.thottin...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adjust header styling on the dashboard - change (mediawiki...ContentTranslation)
jenkins-bot has submitted this change and it was merged. Change subject: Adjust header styling on the dashboard .. Adjust header styling on the dashboard This patchset makes the header to be consistent with the style used in the Translation view: white and with a line below (which is actually the border-top of the element below since user controls are not actually wrapped by the header element) Change-Id: I0b7a3986530ded0449a01fac249f5959be350a99 --- M modules/dashboard/styles/ext.cx.dashboard.less 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: Santhosh: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/dashboard/styles/ext.cx.dashboard.less b/modules/dashboard/styles/ext.cx.dashboard.less index d2e39ba..6151158 100644 --- a/modules/dashboard/styles/ext.cx.dashboard.less +++ b/modules/dashboard/styles/ext.cx.dashboard.less @@ -21,6 +21,8 @@ .mw-ui-one-whole; padding: 50px; background-color: #fff; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; .cx-cta__action { .mw-ui-one-quarter; @@ -33,6 +35,13 @@ } } +.cx-widget { + .mw-ui-grid; + color: @gray-darker; + background: white; + padding-bottom: 50px; +} + // Do not display the header bar containing the link to dashboard in dashboard page. .cx-header__bar { display: none; -- To view, visit https://gerrit.wikimedia.org/r/176354 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0b7a3986530ded0449a01fac249f5959be350a99 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Pginer pgi...@wikimedia.org Gerrit-Reviewer: Amire80 amir.ahar...@mail.huji.ac.il Gerrit-Reviewer: Santhosh santhosh.thottin...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Harmonize used Python 3 versions - change (mediawiki...EventLogging)
QChris has uploaded a new change for review. https://gerrit.wikimedia.org/r/176357 Change subject: Harmonize used Python 3 versions .. Harmonize used Python 3 versions The main tox.ini used Python 2.7, and 3.3. The server's tox.ini used Python 2.7 and 3.4. So they disagreed on the used Python 3. We teach tox to use all three versions in both the main and the server's tox configuration, as vanadium has 2.7, and 3.3 and stat1003 has 2.7 and 3.4. Change-Id: I5c215292f13d2f247a48fd16e0d51de6770229c0 --- M server/tox.ini M tox.ini 2 files changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging refs/changes/57/176357/1 diff --git a/server/tox.ini b/server/tox.ini index ea24863..9be5766 100644 --- a/server/tox.ini +++ b/server/tox.ini @@ -14,7 +14,7 @@ # .. _virtualenv: http://pypi.python.org/pypi/virtualenv [tox] -envlist = py27, py34, flake8 +envlist = py27, py33, py34, flake8 skipsdist = true [testenv] diff --git a/tox.ini b/tox.ini index 25903dd..3634504 100644 --- a/tox.ini +++ b/tox.ini @@ -16,3 +16,5 @@ [testenv:py27] [testenv:py33] + +[testenv:py34] -- To view, visit https://gerrit.wikimedia.org/r/176357 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c215292f13d2f247a48fd16e0d51de6770229c0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EventLogging Gerrit-Branch: master Gerrit-Owner: QChris christ...@quelltextlich.at ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Flake8 server/bin directory - change (mediawiki...EventLogging)
QChris has uploaded a new change for review. https://gerrit.wikimedia.org/r/176359 Change subject: Flake8 server/bin directory .. Flake8 server/bin directory Flake8 was not run on the server/bin directory. Hence, we now run it and fix the current flake8 warnings. For server/bin/eventlogging-devserver:format_config, flake8 complained about F821 undefined name 'items' . Since the function does not seem to be used at all, we remove the whole function. Change-Id: I4ed667dce15cff0b095fee0bdd3a91b0670f2f2e --- M server/bin/eventlogging-devserver M server/bin/eventlogging-processor M server/bin/eventlogging-reporter M server/tox.ini M tox.ini 5 files changed, 8 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging refs/changes/59/176359/1 diff --git a/server/bin/eventlogging-devserver b/server/bin/eventlogging-devserver index 85c3b0c..6670932 100755 --- a/server/bin/eventlogging-devserver +++ b/server/bin/eventlogging-devserver @@ -28,7 +28,7 @@ :copyright: (c) 2012 by Ori Livneh o...@wikimedia.org :license: GNU General Public Licence 2.0 or later - + # noqa # pylint: disable=E0611 from __future__ import print_function, unicode_literals @@ -72,11 +72,6 @@ parser = eventlogging.LogParser('%q %l %n %t %h') log_fmt = ('?%(QUERY_STRING)s %(SERVER_NAME)s %(SEQ_ID)d ' '%(TIME)s %(REMOTE_ADDR)s') - - -def format_config(vars): -code = '\n'.join('$%s = %r;' % item for item in items(vars)) -return highlight(code, php_lexer, formatter).strip() def heading(caption=None): diff --git a/server/bin/eventlogging-processor b/server/bin/eventlogging-processor index 74e2bd9..fce92d1 100755 --- a/server/bin/eventlogging-processor +++ b/server/bin/eventlogging-processor @@ -37,9 +37,6 @@ import argparse import logging -import jsonschema -import zmq - from eventlogging import (capsule_uuid, iter_unicode, json, LogParser, pub_socket, sub_socket, validate) diff --git a/server/bin/eventlogging-reporter b/server/bin/eventlogging-reporter index 20e6d65..fb7bcda 100755 --- a/server/bin/eventlogging-reporter +++ b/server/bin/eventlogging-reporter @@ -22,7 +22,6 @@ import ctypes.util import errno import inspect -import json import logging import math import os diff --git a/server/tox.ini b/server/tox.ini index 9be5766..b022bae 100644 --- a/server/tox.ini +++ b/server/tox.ini @@ -14,7 +14,7 @@ # .. _virtualenv: http://pypi.python.org/pypi/virtualenv [tox] -envlist = py27, py33, py34, flake8 +envlist = py27, py33, py34, flake8, flake8-bin skipsdist = true [testenv] @@ -25,3 +25,7 @@ [testenv:flake8] commands = flake8 deps = flake8 + +[testenv:flake8-bin] +commands = flake8 --filename=* bin +deps = flake8 diff --git a/tox.ini b/tox.ini index cf205d2..3681ec1 100644 --- a/tox.ini +++ b/tox.ini @@ -18,3 +18,5 @@ [testenv:py34] [testenv:flake8] + +[testenv:flake8-bin] -- To view, visit https://gerrit.wikimedia.org/r/176359 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ed667dce15cff0b095fee0bdd3a91b0670f2f2e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EventLogging Gerrit-Branch: master Gerrit-Owner: QChris christ...@quelltextlich.at ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Synchronize order of tox environments - change (mediawiki...EventLogging)
QChris has uploaded a new change for review. https://gerrit.wikimedia.org/r/176358 Change subject: Synchronize order of tox environments .. Synchronize order of tox environments The main tox configuration first ran flake8 and then the tests, while the server's tox configuration first ran the tests and then flake8. We harmonize both environments to first run the tests and then flake8. Change-Id: I034536bdec9fac66b070cf851af3ba58b4f05e6f --- M tox.ini 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging refs/changes/58/176358/1 diff --git a/tox.ini b/tox.ini index 3634504..cf205d2 100644 --- a/tox.ini +++ b/tox.ini @@ -11,10 +11,10 @@ # Redefine envs from /server/tox.ini -[testenv:flake8] - [testenv:py27] [testenv:py33] [testenv:py34] + +[testenv:flake8] -- To view, visit https://gerrit.wikimedia.org/r/176358 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I034536bdec9fac66b070cf851af3ba58b4f05e6f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EventLogging Gerrit-Branch: master Gerrit-Owner: QChris christ...@quelltextlich.at ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Inject siteLinkGroups into ItemView - change (mediawiki...Wikibase)
Thiemo Mättig (WMDE) has submitted this change and it was merged. Change subject: Inject siteLinkGroups into ItemView .. Inject siteLinkGroups into ItemView Change-Id: Icd9af0daf0353245eeb73c225dd9121a762d5e98 --- M repo/includes/View/EntityView.php M repo/includes/View/EntityViewFactory.php M repo/includes/View/ItemView.php M repo/includes/WikibaseRepo.php M repo/tests/phpunit/includes/View/EntityViewFactoryTest.php 5 files changed, 50 insertions(+), 8 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/includes/View/EntityView.php b/repo/includes/View/EntityView.php index ee53a3b..59731f1 100644 --- a/repo/includes/View/EntityView.php +++ b/repo/includes/View/EntityView.php @@ -45,6 +45,11 @@ */ protected $textInjector; + /** +* @param FingerprintView $fingerprintView +* @param ClaimsView $claimsView +* @param Language $language +*/ public function __construct( FingerprintView $fingerprintView, ClaimsView $claimsView, diff --git a/repo/includes/View/EntityViewFactory.php b/repo/includes/View/EntityViewFactory.php index 0a942b4..66e76f6 100644 --- a/repo/includes/View/EntityViewFactory.php +++ b/repo/includes/View/EntityViewFactory.php @@ -42,15 +42,22 @@ */ private $sectionEditLinkGenerator; + /** +* @var string[] +*/ + private $siteLinkGroups; + public function __construct( EntityTitleLookup $entityTitleLookup, EntityLookup $entityLookup, - OutputFormatSnakFormatterFactory $snakFormatterFactory + OutputFormatSnakFormatterFactory $snakFormatterFactory, + array $siteLinkGroups ) { $this-entityTitleLookup = $entityTitleLookup; $this-entityLookup = $entityLookup; $this-snakFormatterFactory = $snakFormatterFactory; $this-sectionEditLinkGenerator = new SectionEditLinkGenerator(); + $this-siteLinkGroups = $siteLinkGroups; } /** @@ -78,7 +85,7 @@ // @fixme support more entity types if ( $entityType === 'item' ) { - return new ItemView( $fingerprintView, $claimsView, $language ); + return new ItemView( $fingerprintView, $claimsView, $language, $this-siteLinkGroups ); } elseif ( $entityType === 'property' ) { $displayStatementsOnProperties = WikibaseRepo::getDefaultInstance()-getSettings() -getSetting( 'displayStatementsOnProperties' ); diff --git a/repo/includes/View/ItemView.php b/repo/includes/View/ItemView.php index 16fd88e..4c2f152 100644 --- a/repo/includes/View/ItemView.php +++ b/repo/includes/View/ItemView.php @@ -3,6 +3,7 @@ namespace Wikibase\Repo\View; use InvalidArgumentException; +use Language; use Wikibase\DataModel\Entity\Item; use Wikibase\EntityRevision; use Wikibase\Repo\WikibaseRepo; @@ -18,6 +19,30 @@ * @author Daniel Werner */ class ItemView extends EntityView { + + /** +* @var string[] +*/ + private $siteLinkGroups; + + /** +* @see EntityView::__construct +* +* @param FingerprintView $fingerprintView +* @param ClaimsView $claimsView +* @param Language $language +* @param string[] $siteLinkGroups +*/ + public function __construct( + FingerprintView $fingerprintView, + ClaimsView $claimsView, + Language $language, + array $siteLinkGroups + ) { + parent::__construct( $fingerprintView, $claimsView, $language ); + + $this-siteLinkGroups = $siteLinkGroups; + } /** * @see EntityView::getMainHtml @@ -54,8 +79,7 @@ protected function getTocSections() { $array = parent::getTocSections(); $array['claims'] = 'wikibase-statements'; - $groups = WikibaseRepo::getDefaultInstance()-getSettings()-getSetting( 'siteLinkGroups' ); - foreach ( $groups as $group ) { + foreach ( $this-siteLinkGroups as $group ) { $id = htmlspecialchars( 'sitelinks-' . $group, ENT_QUOTES ); $array[$id] = 'wikibase-sitelinks-' . $group; } @@ -74,7 +98,6 @@ */ protected function getHtmlForSiteLinks( Item $item, $editable = true ) { $wikibaseRepo = WikibaseRepo::getDefaultInstance(); - $groups = $wikibaseRepo-getSettings()-getSetting( 'siteLinkGroups' ); // FIXME: Inject this $siteLinksView = new SiteLinksView( @@ -86,7 +109,12 @@ $itemId = $item-getId(); -
[MediaWiki-commits] [Gerrit] Rewrite completely broken EntityView tests - change (mediawiki...Wikibase)
Thiemo Mättig (WMDE) has submitted this change and it was merged. Change subject: Rewrite completely broken EntityView tests .. Rewrite completely broken EntityView tests Change-Id: Ibc373a9017c25cc2bdacbabeea2b97d283e31b00 --- M repo/tests/phpunit/includes/View/EntityViewTest.php M repo/tests/phpunit/includes/View/ItemViewTest.php M repo/tests/phpunit/includes/View/PropertyViewTest.php 3 files changed, 88 insertions(+), 268 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/tests/phpunit/includes/View/EntityViewTest.php b/repo/tests/phpunit/includes/View/EntityViewTest.php index 3592b45..c689b99 100644 --- a/repo/tests/phpunit/includes/View/EntityViewTest.php +++ b/repo/tests/phpunit/includes/View/EntityViewTest.php @@ -2,35 +2,11 @@ namespace Wikibase\Test; -use IContextSource; -use InvalidArgumentException; -use Language; -use RequestContext; -use Title; -use ValueFormatters\FormatterOptions; -use Wikibase\DataModel\Claim\Claim; -use Wikibase\DataModel\Entity\BasicEntityIdParser; use Wikibase\DataModel\Entity\Entity; use Wikibase\DataModel\Entity\EntityId; -use Wikibase\DataModel\Entity\EntityIdValue; -use Wikibase\DataModel\Entity\Item; -use Wikibase\DataModel\Entity\ItemId; -use Wikibase\DataModel\Entity\Property; -use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\DataModel\Snak\PropertyValueSnak; -use Wikibase\DataModel\Snak\Snak; use Wikibase\DataModel\Statement\Statement; use Wikibase\EntityRevision; -use Wikibase\LanguageFallbackChain; -use Wikibase\Lib\Serializers\SerializationOptions; -use Wikibase\Lib\SnakFormatter; -use Wikibase\Lib\Store\EntityInfoBuilderFactory; -use Wikibase\Lib\Store\EntityTitleLookup; -use Wikibase\ParserOutputJsConfigBuilder; -use Wikibase\ReferencedEntitiesFinder; use Wikibase\Repo\View\EntityView; -use Wikibase\Repo\WikibaseRepo; -use Wikibase\Utils; /** * @covers Wikibase\Repo\View\EntityView @@ -47,166 +23,6 @@ * @author Daniel Kinzler */ abstract class EntityViewTest extends \MediaWikiLangTestCase { - - /** -* @var MockRepository -*/ - private $mockRepository; - - protected function newEntityIdParser() { - // The data provides use P123 and Q123 IDs, so the parser needs to understand these. - return new BasicEntityIdParser(); - } - - public function getTitleForId( EntityId $id ) { - $name = $id-getEntityType() . ':' . $id-getSerialization(); - return Title::makeTitle( NS_MAIN, $name ); - } - - /** -* @return EntityTitleLookup -*/ - protected function getEntityTitleLookupMock() { - $lookup = $this-getMock( 'Wikibase\Lib\Store\EntityTitleLookup' ); - $lookup-expects( $this-any() ) - -method( 'getTitleForId' ) - -will( $this-returnCallback( array( $this, 'getTitleForId' ) ) ); - - return $lookup; - } - - /** -* @return SnakFormatter -*/ - protected function newSnakFormatterMock() { - $snakFormatter = $this-getMock( 'Wikibase\Lib\SnakFormatter' ); - - $snakFormatter-expects( $this-any() )-method( 'formatSnak' ) - -will( $this-returnValue( '(value)' ) ); - - $snakFormatter-expects( $this-any() )-method( 'getFormat' ) - -will( $this-returnValue( SnakFormatter::FORMAT_HTML_WIDGET ) ); - - $snakFormatter-expects( $this-any() )-method( 'canFormatSnak' ) - -will( $this-returnValue( true ) ); - - return $snakFormatter; - } - - /** -* @param string $entityType -* @param EntityInfoBuilderFactory $entityInfoBuilderFactory -* @param EntityTitleLookup $entityTitleLookup -* @param IContextSource $context -* @param LanguageFallbackChain $languageFallbackChain -* -* @throws InvalidArgumentException -* @return EntityView -*/ - protected function newEntityView( - $entityType, - EntityInfoBuilderFactory $entityInfoBuilderFactory = null, - EntityTitleLookup $entityTitleLookup = null, - IContextSource $context = null, - LanguageFallbackChain $languageFallbackChain = null - ) { - if ( !is_string( $entityType ) ) { - throw new InvalidArgumentException( '$entityType must be a string!' ); - } - - $langCode = 'en'; - - if ( $context === null ) { - $context = new RequestContext(); - $context-setLanguage( $langCode ); - } - - if ( $languageFallbackChain === null ) { - $factory =
[MediaWiki-commits] [Gerrit] Initialize claims on entities whenever a claimlistview exists - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Initialize claims on entities whenever a claimlistview exists .. Initialize claims on entities whenever a claimlistview exists Also fix the behavior for properties: They weren't initialized if more than one claimlistview is present. Change-Id: I1582fe50080d2d5a982855ad189fa855f33a95bb --- M lib/resources/jquery.wikibase/jquery.wikibase.entityview.js 1 file changed, 1 insertion(+), 4 deletions(-) Approvals: Henning Snater: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js b/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js index 2e7eabd..b89dc33 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js @@ -103,10 +103,7 @@ // TODO: Have an itemview and propertyview instead of ugly hack here. var entityType = this.options.value.getType(); - if( - entityType === 'item' - || entityType === 'property' this.element.find( '.wb-claimlistview' ).length === 1 - ) { + if( this.element.find( '.wb-claimlistview' ).length 0 ) { this._initClaims(); } -- To view, visit https://gerrit.wikimedia.org/r/176360 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1582fe50080d2d5a982855ad189fa855f33a95bb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Hoo man h...@online.de Gerrit-Reviewer: Henning Snater henning.sna...@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 test for EntityIdHtmlLinkFormatter - change (mediawiki...Wikibase)
Daniel Kinzler has uploaded a new change for review. https://gerrit.wikimedia.org/r/176361 Change subject: Add test for EntityIdHtmlLinkFormatter .. Add test for EntityIdHtmlLinkFormatter Change-Id: I8f8239bfaa558e5469ab7d20228b7d1172b6e0f5 --- A lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php 1 file changed, 102 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/61/176361/1 diff --git a/lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php b/lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php new file mode 100644 index 000..7c83cb5 --- /dev/null +++ b/lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php @@ -0,0 +1,102 @@ +?php + +namespace Wikibase\Test; + +use ValueFormatters\FormatterOptions; +use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Entity\EntityIdValue; +use Wikibase\DataModel\Entity\ItemId; +use Wikibase\DataModel\Entity\PropertyId; +use Wikibase\Lib\EntityIdHtmlLinkFormatter; + +/** + * @covers Wikibase\Lib\EntityIdHtmlLinkFormatter + * + * @group ValueFormatters + * @group DataValueExtensions + * @group WikibaseLib + * @group Wikibase + * @group EntityIdFormatterTest + * + * @licence GNU GPL v2+ + * @author Jeroen De Dauw jeroended...@gmail.com + * @author Daniel Kinzler + * @author Katie Filbert aude.w...@gmail.com + */ +class EntityIdHtmlLinkFormatterTest extends \PHPUnit_Framework_TestCase { + + /** +* @return array +*/ + public function validProvider() { + $argLists = array(); + + $options = new FormatterOptions(); + $options-setOption( EntityIdHtmlLinkFormatter::OPT_LANG, 'es' ); + + $argLists['foo'] = array( new ItemId( 'Q42' ), 'es', '@^a.*foo/a$@', $options ); + + $options = new FormatterOptions(); + $options-setOption( EntityIdHtmlLinkFormatter::OPT_LANG, 'en' ); + $options-setOption( EntityIdHtmlLinkFormatter::OPT_LOOKUP_LABEL, false ); + + $argLists['no lookup'] = array( new EntityIdValue( new ItemId( 'Q42' ) ), 'en', '@^a.*Q42/a$@', $options ); + + $options = new FormatterOptions(); + $options-setOption( EntityIdHtmlLinkFormatter::OPT_LANG, 'en' ); + + $argLists['no label'] = array( new EntityIdValue( new ItemId( 'Q9001' ) ), 'en', '@^a.*Q9001/a$@', $options ); + + + $options = new FormatterOptions(); + $options-setOption( EntityIdHtmlLinkFormatter::OPT_LANG, 'en' ); + + $argLists['property id'] = array( new PropertyId( 'P9001' ), 'en', '@^a.*P9001/a$@', $options ); + + $options = new FormatterOptions(); + $options-setOption( EntityIdHtmlLinkFormatter::OPT_LANG, 'en' ); + + $argLists['unresolved-redirect'] = array( new ItemId( 'Q23' ), 'en', '@^a.*Q23/a$@', $options ); + + return $argLists; + } + + /** +* @dataProvider validProvider +* +* @param EntityId|EntityIdValue $entityId +* @param string $languageCode +* @param string $expectedPattern +* @param FormatterOptions $formatterOptions +*/ + public function testParseWithValidArguments( $entityId, $languageCode, $expectedPattern, + FormatterOptions $formatterOptions + ) { + $labelLookup = $this-getLabelLookup( $languageCode ); + $formatter = new EntityIdHtmlLinkFormatter( $formatterOptions, $labelLookup ); + + $formattedValue = $formatter-format( $entityId ); + + $this-assertInternalType( 'string', $formattedValue ); + $this-assertRegExp( $expectedPattern, $formattedValue ); + } + + protected function getLabelLookup( $languageCode ) { + $labelLookup = $this-getMockBuilder( 'Wikibase\Lib\Store\LabelLookup' ) + -disableOriginalConstructor() + -getMock(); + + $labelLookup-expects( $this-any() ) + -method( 'getLabel' ) + -will( $this-returnCallback( function( EntityId $entityId ) use ( $languageCode ) { + if ( $entityId-getSerialization() === 'Q42' $languageCode === 'es' ) { + return 'foo'; + } else { + throw new \OutOfBoundsException( 'Label not found' ); + } + } ) ); + + return $labelLookup; + } + +} -- To view, visit https://gerrit.wikimedia.org/r/176361 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f8239bfaa558e5469ab7d20228b7d1172b6e0f5 Gerrit-PatchSet: 1
[MediaWiki-commits] [Gerrit] Show an error if ViewEntityAction is used with non-Entity co... - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Show an error if ViewEntityAction is used with non-Entity content .. Show an error if ViewEntityAction is used with non-Entity content ViewEntityAction is being called with non-Entity content eg. if a user tries to diff wikitext content with entity content. Bug: T73546 Change-Id: I1a5781e017df645b51b3ecdb016cd6cbd2c3d557 --- M repo/i18n/en.json M repo/i18n/qqq.json M repo/includes/actions/ViewEntityAction.php 3 files changed, 17 insertions(+), 3 deletions(-) Approvals: Daniel Kinzler: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/i18n/en.json b/repo/i18n/en.json index e751fb2..bb416be 100644 --- a/repo/i18n/en.json +++ b/repo/i18n/en.json @@ -400,5 +400,7 @@ right-item-merge: Merge items, right-item-redirect: Create item redirects, right-property-term: Change property terms (labels, descriptions, aliases), - right-property-create: Create properties + right-property-create: Create properties, + wikibase-entity-not-viewable-title: Content type mismatch: Can not display content, + wikibase-entity-not-viewable: The given content of type \$1\ is not an Entity and can not be displayed by Wikibase. } diff --git a/repo/i18n/qqq.json b/repo/i18n/qqq.json index 03980e7..12ba988 100644 --- a/repo/i18n/qqq.json +++ b/repo/i18n/qqq.json @@ -427,5 +427,7 @@ right-item-merge: {{doc-right|item-merge}}\nRight to alter the contents of [[d:Special:MyLanguage/Wikidata:Glossary#Item|items]].\n{{Identical|Merge item}}, right-item-redirect: {{doc-right|item-redirect}}\nRight to create [[d:Special:MyLanguage/Wikidata:Glossary#Item|item]] redirects after merging items., right-property-term: {{doc-right|property-term}}\nRight to alter the [[d:Wikidata:Glossary#Term|terms]] of [[d:Wikidata:Glossary#Item|items]]., - right-property-create: {{doc-right|property-create}}\nRight to create new [[d:Wikidata:Glossary#Property|properties]]. + right-property-create: {{doc-right|property-create}}\nRight to create new [[d:Wikidata:Glossary#Property|properties]]., +wikibase-entity-not-viewable-title: Page title on the error page saying that content can't be displayed., +wikibase-entity-not-viewable: Error message saying that some content can't be rendered. $1 is the content model of the content that can't be displayed (eg. wikitext). } diff --git a/repo/includes/actions/ViewEntityAction.php b/repo/includes/actions/ViewEntityAction.php index 6298ef2..a747a01 100644 --- a/repo/includes/actions/ViewEntityAction.php +++ b/repo/includes/actions/ViewEntityAction.php @@ -95,6 +95,15 @@ $this-getArticle() ); + if ( !( $content instanceof EntityContent ) ) { + $this-getOutput()-showErrorPage( + 'wikibase-entity-not-viewable-title', + 'wikibase-entity-not-viewable', + $content-getModel() + ); + return; + } + $this-displayEntityContent( $content ); } } @@ -123,8 +132,9 @@ * * @param EntityContent $content */ - protected function displayEntityContent( EntityContent $content ) { + private function displayEntityContent( EntityContent $content ) { $outputPage = $this-getOutput(); + $editable = $this-isEditable(); // NOTE: page-wide property, independent of user permissions -- To view, visit https://gerrit.wikimedia.org/r/170506 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a5781e017df645b51b3ecdb016cd6cbd2c3d557 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Hoo man h...@online.de Gerrit-Reviewer: Adrian Lang adrian.l...@wikimedia.de Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: JanZerebecki jan.wikime...@zerebecki.de Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@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] Enable rspec checks for mediawiki-ruby-api - change (integration/config)
jenkins-bot has submitted this change and it was merged. Change subject: Enable rspec checks for mediawiki-ruby-api .. Enable rspec checks for mediawiki-ruby-api Change-Id: I6c077a4188c796ce6238e24d4e7631b7723bfdbd --- M jjb/mediawiki-misc.yaml M zuul/layout.yaml 2 files changed, 5 insertions(+), 0 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/jjb/mediawiki-misc.yaml b/jjb/mediawiki-misc.yaml index 48d7d4c..cc85b2c 100644 --- a/jjb/mediawiki-misc.yaml +++ b/jjb/mediawiki-misc.yaml @@ -33,6 +33,9 @@ - '{name}-gembuild' - '{name}-bundle-{bundlecommand}': bundlecommand: + - rspec + - '{name}-bundle-{bundlecommand}': + bundlecommand: - rubocop - '{name}-bundle-{bundlecommand}': bundlecommand: diff --git a/zuul/layout.yaml b/zuul/layout.yaml index 57306a0..e52fb4f 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -2156,11 +2156,13 @@ test: - mediawiki-ruby-api-bundle-rubocop - mediawiki-ruby-api-ruby1.9.3lint + - mediawiki-ruby-api-bundle-rspec - mediawiki-ruby-api-gembuild - mediawiki-ruby-api-bundle-yard gate-and-submit: - mediawiki-ruby-api-bundle-rubocop - mediawiki-ruby-api-ruby1.9.3lint + - mediawiki-ruby-api-bundle-rspec - mediawiki-ruby-api-gembuild - mediawiki-ruby-api-bundle-yard postmerge: -- To view, visit https://gerrit.wikimedia.org/r/175900 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6c077a4188c796ce6238e24d4e7631b7723bfdbd Gerrit-PatchSet: 3 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Dduvall dduv...@wikimedia.org Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org Gerrit-Reviewer: Hashar has...@free.fr Gerrit-Reviewer: JanZerebecki jan.wikime...@zerebecki.de 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] Config for MLEB 2014.11 - change (translatewiki)
KartikMistry has uploaded a new change for review. https://gerrit.wikimedia.org/r/176363 Change subject: Config for MLEB 2014.11 .. Config for MLEB 2014.11 * Translate is at: 8d749c1 * ULS is at: origin/master Change-Id: Icfce5457493d6d654e38e88dc888ccc122b67570 --- M melange/config.ini 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/63/176363/1 diff --git a/melange/config.ini b/melange/config.ini index 9aebe83..06a5a60 100644 --- a/melange/config.ini +++ b/melange/config.ini @@ -2,8 +2,8 @@ mediawikirepo=ssh://kar...@gerrit.wikimedia.org:29418/mediawiki/core.git extensionrepo=ssh://kar...@gerrit.wikimedia.org:29418/mediawiki/extensions/ branches=origin/master origin/REL1_21 origin/REL1_20 -releasever=2014.10 -releasever-prev=2014.09 +releasever=2014.11 +releasever-prev=2014.10 bundlename=MediaWiki language extension bundle downloadurl=https://translatewiki.net/mleb hasher=sha256sum @@ -18,7 +18,7 @@ cldr=origin/master CleanChanges=origin/master LocalisationUpdate=origin/master -Translate=8d749c1 +Translate=f0436a8 UniversalLanguageSelector=origin/master [install] -- To view, visit https://gerrit.wikimedia.org/r/176363 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icfce5457493d6d654e38e88dc888ccc122b67570 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: KartikMistry kartik.mis...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update version before MLEB release - change (mediawiki...UniversalLanguageSelector)
KartikMistry has uploaded a new change for review. https://gerrit.wikimedia.org/r/176364 Change subject: Update version before MLEB release .. Update version before MLEB release Change-Id: I38c52b97ceab88008869cb4b0e302f97176fbdd2 --- M UniversalLanguageSelector.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/64/176364/1 diff --git a/UniversalLanguageSelector.php b/UniversalLanguageSelector.php index 4d57274..cc00903 100644 --- a/UniversalLanguageSelector.php +++ b/UniversalLanguageSelector.php @@ -25,7 +25,7 @@ /** * Version number used in extension credits and in other placed where needed. */ -define( 'ULS_VERSION', '2014-10-31' ); +define( 'ULS_VERSION', '2014-11-28' ); $GLOBALS['wgExtensionCredits']['other'][] = array( 'path' = __FILE__, -- To view, visit https://gerrit.wikimedia.org/r/176364 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38c52b97ceab88008869cb4b0e302f97176fbdd2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: KartikMistry kartik.mis...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update version before MLEB release - change (mediawiki...Translate)
KartikMistry has uploaded a new change for review. https://gerrit.wikimedia.org/r/176365 Change subject: Update version before MLEB release .. Update version before MLEB release Change-Id: If16619829401c018a786226bb4a30f00f4dcb23d --- M Translate.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/65/176365/1 diff --git a/Translate.php b/Translate.php index b30d609..cb02535 100644 --- a/Translate.php +++ b/Translate.php @@ -17,7 +17,7 @@ /** * Version number used in extension credits and in other places where needed. */ -define( 'TRANSLATE_VERSION', '2014-10-31' ); +define( 'TRANSLATE_VERSION', '2014-11-28' ); /** * Extension credits properties. -- To view, visit https://gerrit.wikimedia.org/r/176365 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If16619829401c018a786226bb4a30f00f4dcb23d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: KartikMistry kartik.mis...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Prune Old bounce records - change (mediawiki...BounceHandler)
01tonythomas has uploaded a new change for review. https://gerrit.wikimedia.org/r/176366 Change subject: Prune Old bounce records .. Prune Old bounce records Bonce records needs to be occassionaly removed because: * User might update their faulty email address in between * The table will grow large Bug: T75876 Change-Id: I3f743f0166b4ac59e853e2fed4b9e05c7c44c196 --- M BounceHandler.php M includes/ProcessBounceEmails.php A includes/pruneOldBounceRecords.php 3 files changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BounceHandler refs/changes/66/176366/1 diff --git a/BounceHandler.php b/BounceHandler.php index 6189e96..fa5d3b4 100644 --- a/BounceHandler.php +++ b/BounceHandler.php @@ -34,6 +34,7 @@ $wgAutoloadClasses['ProcessBounceWithPlancake'] = $dir. '/includes/ProcessBounceWithPlancake.php'; $wgAutoloadClasses['ProcessBounceWithRegex'] = $dir. '/includes/ProcessBounceWithRegex.php'; $wgAutoloadClasses['VerpAddressGenerator'] = $dir. '/includes/VerpAddressGenerator.php'; +$wgAutoloadClasses['pruneOldBounceRecords'] = $dir. '/includes/pruneOldBounceRecords.php'; $wgJobClasses['BounceHandlerJob'] = 'BounceHandlerJob'; @@ -84,6 +85,9 @@ # Central DB name to use if the bounce table is to be shared $wgBounceHandlerSharedDB = false; +# Maximum time until which a bounce record should be stored in the table +$wgBounceRecordAgeMax = 5184000; //60 days + // Local composer install during development if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { require_once __DIR__ . '/vendor/autoload.php'; diff --git a/includes/ProcessBounceEmails.php b/includes/ProcessBounceEmails.php index 13609de..00a573a 100644 --- a/includes/ProcessBounceEmails.php +++ b/includes/ProcessBounceEmails.php @@ -44,7 +44,7 @@ * @return bool */ public function processBounceHeaders( $emailHeaders ) { - global $wgBounceRecordPeriod, $wgBounceRecordLimit, $wgBounceHandlerUnconfirmUsers; + global $wgBounceRecordPeriod, $wgBounceRecordLimit, $wgBounceHandlerUnconfirmUsers, $wgBounceRecordAgeMax; $to = $emailHeaders['to']; $subject = $emailHeaders['subject']; @@ -65,6 +65,9 @@ ); $dbw-insert( 'bounce_records', $rowData, __METHOD__ ); + $pruneOldRecords = new pruneOldBounceRecords( $wgBounceRecordAgeMax ); + $pruneOldRecords-pruneOldRecords( $dbw ); + $takeBounceActions = new BounceHandlerActions( $wikiId, $wgBounceRecordPeriod, $wgBounceRecordLimit, $wgBounceHandlerUnconfirmUsers ); $takeBounceActions-handleFailingRecipient( $failedUser ); diff --git a/includes/pruneOldBounceRecords.php b/includes/pruneOldBounceRecords.php new file mode 100644 index 000..797ffc4 --- /dev/null +++ b/includes/pruneOldBounceRecords.php @@ -0,0 +1,7 @@ +?php +/** + * Created by PhpStorm. + * User: router + * Date: 11/28/14 + * Time: 7:34 PM + */ \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/176366 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3f743f0166b4ac59e853e2fed4b9e05c7c44c196 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BounceHandler Gerrit-Branch: master Gerrit-Owner: 01tonythomas 01tonytho...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Refactored $.wikibase.entityselector - change (mediawiki...Wikibase)
Henning Snater has uploaded a new change for review. https://gerrit.wikimedia.org/r/176367 Change subject: Refactored $.wikibase.entityselector .. Refactored $.wikibase.entityselector - Removed unnecessary indentation level. - Updated documentation to be compatible to JSDuck parser. Change-Id: I81130d7c823d39865cf7d9488e0bae36c737d15e --- M lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js 1 file changed, 436 insertions(+), 410 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/67/176367/1 diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js index 6acd6a2..a4973e4 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js @@ -1,447 +1,473 @@ -/** - * Wikibase entity selector - * Enhances an input box with auto-complete and auto-suggestion functionality for Wikibase entities. - * @since 0.2 - * @licence GNU GPL v2+ - * @author H. Snater mediaw...@snater.com - * - * @example $( 'input' ).entityselector( { - * url: {string} URL to the API of a MediaWiki instance running Wikibase repository, - * language: {string} language code of the language to fetch results in - * } ); - * - * @option {string} url (REQUIRED) - * URL to retrieve results from. - * - * @option {string} language (REQUIRED, optional when in MediaWiki context) - * Code of the language results shall be fetched in. - * Default value: User language (when in MediaWiki context) - * - * @option {string} type - * Entity type that will be queried for results. - * Default value: 'item' - * - * @option {number|null} limit - * Number of results to query the API for. - * Default value: null (will pick limit specified server-side) - * - * @option {boolean} caseSensitive - * Whether the widget shall consider letter case when determining if the first suggestion - * matches with the current input triggering the select mechanism. - * Default: false - * - * @option {number} timeout - * Default AJAX timeout in milliseconds. - * Default value: 8000 - * - * @option messages {Object} - * Strings used within the widget. - * Messages should be specified using mwMsgOrString(resource loader module message key, - * fallback message) in order to use the messages specified in the resource loader module - * (if loaded). - * - {string} messages['aliases-label'] - * Label prepending the alias(es) if there is a search hit on at least one alias of an - * entity. - * Default value: 'also known as:' - * - {string} messages['more'] - * Label of the link to display more suggestions. - * Default value: 'more' - * - * @event selected - *Triggered after having selected an entity. - *Parameters: (1) {jQuery.Event} - *(2) {string} Entity id - * - * @dependency jQuery.event.special.eachchange - * @dependency jQuery.ui.ooMenu - * @dependency jQuery.ui.suggester - */ ( function( $, util, mw ) { 'use strict'; - // TODO: Get rid of MediaWiki context detection by submitting a message provider as option. +// TODO: Get rid of MediaWiki context detection by submitting a message provider as option. + +/** + * Whether loaded in MediaWiki context. + * @property {boolean} + * @ignore + */ +var IS_MW_CONTEXT = mw !== undefined mw.msg; + +/** + * Whether actual `entityselector` resource loader module is loaded. + * @property {boolean} + * @ignore + */ +var IS_MODULE_LOADED = ( + IS_MW_CONTEXT +$.inArray( 'jquery.wikibase.entityselector', mw.loader.getModuleNames() ) !== -1 +); + +/** + * Returns a message from the MediaWiki context if the `entityselector` module has been loaded. + * If it has not been loaded, the corresponding string defined in the options will be returned. + * @ignore + * + * @param {string} msgKey + * @param {string} string + * @return {string} + */ +function mwMsgOrString( msgKey, string ) { + return IS_MODULE_LOADED ? mw.msg( msgKey ) : string; +} + +/** + * Enhances an input box with auto-complete and auto-suggestion functionality for Wikibase entities. + * + * @example + * $( 'input' ).entityselector( { + * url: {string} URL to the API of a MediaWiki instance running Wikibase repository, + * language: {string} language code of the language to fetch results in + * } ); + * + * @since 0.2 + * @class jQuery.wikibase.entityselector + * @extends jQuery.ui.suggester + * @uses jQuery.event.special.eachchange + * @uses jQuery.ui.ooMenu + * @licence GNU GPL v2+ + * @author H. Snater mediaw...@snater.com + * + * @constructor + * + * @param {Object} options + *
[MediaWiki-commits] [Gerrit] Inject cache as constructor param of SiteSQLStore - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Inject cache as constructor param of SiteSQLStore .. Inject cache as constructor param of SiteSQLStore Change-Id: If1d08d4f3451b72d7d4d1c443cf2c82842ffd20f --- M includes/site/SiteSQLStore.php 1 file changed, 18 insertions(+), 9 deletions(-) Approvals: Daniel Kinzler: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/site/SiteSQLStore.php b/includes/site/SiteSQLStore.php index fde22f1..c1a350d 100644 --- a/includes/site/SiteSQLStore.php +++ b/includes/site/SiteSQLStore.php @@ -52,14 +52,24 @@ private $cacheTimeout = 3600; /** +* @var BagOStuff +*/ + private $cache; + + /** * @since 1.21 * * @param ORMTable|null $sitesTable +* @param BagOStuff|null $cache * * @return SiteStore */ - public static function newInstance( ORMTable $sitesTable = null ) { - return new static( $sitesTable ); + public static function newInstance( ORMTable $sitesTable = null, BagOStuff $cache = null ) { + if ( $cache === null ) { + $cache = wfGetMainCache(); + } + + return new static( $cache, $sitesTable ); } /** @@ -67,13 +77,15 @@ * * @since 1.21 * +* @param BagOStuff $cache * @param ORMTable|null $sitesTable */ - protected function __construct( ORMTable $sitesTable = null ) { + protected function __construct( BagOStuff $cache, ORMTable $sitesTable = null ) { if ( $sitesTable === null ) { $sitesTable = $this-newSitesTable(); } + $this-cache = $cache; $this-sitesTable = $sitesTable; } @@ -123,8 +135,7 @@ if ( $source === 'cache' ) { if ( $this-sites === null ) { - $cache = wfGetMainCache(); - $sites = $cache-get( $this-getCacheKey() ); + $sites = $this-cache-get( $this-getCacheKey() ); if ( is_object( $sites ) ) { $this-sites = $sites; @@ -257,8 +268,7 @@ } } - $cache = wfGetMainCache(); - $cache-set( $this-getCacheKey(), $this-sites, $this-cacheTimeout ); + $this-cache-set( $this-getCacheKey(), $this-sites, $this-cacheTimeout ); wfProfileOut( __METHOD__ ); } @@ -374,8 +384,7 @@ public function reset() { wfProfileIn( __METHOD__ ); // purge cache - $cache = wfGetMainCache(); - $cache-delete( $this-getCacheKey() ); + $this-cache-delete( $this-getCacheKey() ); $this-sites = null; wfProfileOut( __METHOD__ ); -- To view, visit https://gerrit.wikimedia.org/r/175229 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If1d08d4f3451b72d7d4d1c443cf2c82842ffd20f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core 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 win32 input for Python 3 - change (pywikibot/core)
John Vandenberg has uploaded a new change for review. https://gerrit.wikimedia.org/r/176368 Change subject: Fix win32 input for Python 3 .. Fix win32 input for Python 3 The win32 terminal interface used a custom routine for Python 2. This routine fails on Python 3, whereas the builtin input() functions correctly based on limited testing. Change-Id: I05b0afcae4850436da23621a35ce02a949a8f1ca --- M pywikibot/userinterfaces/terminal_interface_win32.py 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/68/176368/1 diff --git a/pywikibot/userinterfaces/terminal_interface_win32.py b/pywikibot/userinterfaces/terminal_interface_win32.py index 7e3fd89..c616726 100755 --- a/pywikibot/userinterfaces/terminal_interface_win32.py +++ b/pywikibot/userinterfaces/terminal_interface_win32.py @@ -8,6 +8,8 @@ __version__ = '$Id$' import re +import sys + from . import terminal_interface_base try: @@ -93,6 +95,9 @@ ctypes.windll.kernel32.SetConsoleTextAttribute(std_out_handle, windowsColors['default']) def _raw_input(self): +if sys.version_info[0] 2: +return input() + data = self.stdin.readline() if '\x1a' in data: raise EOFError() -- To view, visit https://gerrit.wikimedia.org/r/176368 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05b0afcae4850436da23621a35ce02a949a8f1ca Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: John Vandenberg jay...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Sanitize wikibase-item html formatting - change (mediawiki...Wikibase)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/176369 Change subject: Sanitize wikibase-item html formatting .. Sanitize wikibase-item html formatting And don't assume Title == serialization if we don't have an EntityTitleLookup. Change-Id: I82b90f8a8cad8f7b65a0c7a26d76611be7fb1f25 --- M lib/includes/formatters/EntityIdHtmlLinkFormatter.php M lib/includes/formatters/WikibaseValueFormatterBuilders.php M lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php 3 files changed, 74 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/69/176369/1 diff --git a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php index b4f5210..0b655c7 100644 --- a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php +++ b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php @@ -22,14 +22,14 @@ class EntityIdHtmlLinkFormatter extends EntityIdLabelFormatter { /** -* @var EntityTitleLookup|null +* @var EntityTitleLookup */ protected $entityTitleLookup; public function __construct( FormatterOptions $options, LabelLookup $labelLookup, - EntityTitleLookup $entityTitleLookup = null + EntityTitleLookup $entityTitleLookup ) { parent::__construct( $options, $labelLookup ); @@ -44,11 +44,8 @@ * @return string */ protected function formatEntityId( EntityId $entityId ) { - if ( isset( $this-entityTitleLookup ) ) { - $title = $this-entityTitleLookup-getTitleForId( $entityId ); - } else { - $title = Title::newFromText( $entityId-getSerialization() ); - } + $title = $this-entityTitleLookup-getTitleForId( $entityId ); + $attributes = array( 'title' = $title-getPrefixedText(), 'href' = $title-getLocalURL() diff --git a/lib/includes/formatters/WikibaseValueFormatterBuilders.php b/lib/includes/formatters/WikibaseValueFormatterBuilders.php index 734f8c5..4c93676 100644 --- a/lib/includes/formatters/WikibaseValueFormatterBuilders.php +++ b/lib/includes/formatters/WikibaseValueFormatterBuilders.php @@ -93,7 +93,7 @@ SnakFormatter::FORMAT_HTML = array( 'PT:url' = 'Wikibase\Lib\HtmlUrlFormatter', 'PT:commonsMedia' = 'Wikibase\Lib\CommonsLinkFormatter', - 'PT:wikibase-item' = array( 'this', 'newEntityIdHtmlLinkFormatter' ), + 'PT:wikibase-item' = array( 'this', 'newEntityIdHtmlFormatter' ), 'VT:time' = array( 'this', 'newHtmlTimeFormatter' ), 'VT:monolingualtext' = 'Wikibase\Formatters\MonolingualHtmlFormatter', ), @@ -558,14 +558,19 @@ * * @param FormatterOptions $options * -* @return EntityIdHtmlLinkFormatter +* @return ValueFormatter */ - private function newEntityIdHtmlLinkFormatter( FormatterOptions $options ) { - return new EntityIdHtmlLinkFormatter( - $options, - $this-newLabelLookup( $options ), - $this-entityTitleLookup - ); + private function newEntityIdHtmlFormatter( FormatterOptions $options ) { + $labelLookup = $this-newLabelLookup( $options ); + + if ( !$this-entityTitleLookup ) { + return new EscapingValueFormatter( + new EntityIdLabelFormatter( $options, $labelLookup ), + 'htmlspecialchars' + ); + } + + return new EntityIdHtmlLinkFormatter( $options, $labelLookup, $this-entityTitleLookup ); } /** diff --git a/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php b/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php index 4fe740f..20eb09b 100644 --- a/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php +++ b/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php @@ -2,11 +2,12 @@ namespace Wikibase\Lib\Test; +use Language; +use Title; use DataValues\MonolingualTextValue; use DataValues\QuantityValue; use DataValues\StringValue; use DataValues\TimeValue; -use Language; use ValueFormatters\FormatterOptions; use ValueFormatters\StringFormatter; use ValueFormatters\TimeFormatter; @@ -14,12 +15,12 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityIdValue; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\LanguageFallbackChain; use
[MediaWiki-commits] [Gerrit] No language fallback when serializing wbEntity. - change (mediawiki...Wikibase)
Daniel Kinzler has uploaded a new change for review. https://gerrit.wikimedia.org/r/176370 Change subject: No language fallback when serializing wbEntity. .. No language fallback when serializing wbEntity. wbEntity should (for now) only contain explicitly defined terms. If we later decide to include terms derived via language fallback, such terms should be makred accordingly. Bug: T76201 Change-Id: Ie00c62d48497c8f75c13df0cad8768c2efb11e22 --- M repo/includes/EntityParserOutputGeneratorFactory.php 1 file changed, 7 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/70/176370/1 diff --git a/repo/includes/EntityParserOutputGeneratorFactory.php b/repo/includes/EntityParserOutputGeneratorFactory.php index bdb1463..1a69a6b 100644 --- a/repo/includes/EntityParserOutputGeneratorFactory.php +++ b/repo/includes/EntityParserOutputGeneratorFactory.php @@ -7,6 +7,7 @@ use ParserOutput; use RequestContext; use User; +use ValueFormatters\ValueFormatter; use Wikibase\DataModel\Entity\Entity; use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityIdParser; @@ -102,7 +103,7 @@ return new ParserOutputJsConfigBuilder( $this-entityIdParser, $this-entityTitleLookup, - $this-makeSerializationOptions( $languageCode ) + $this-makeJsConfigSerializationOptions( $languageCode ) ); } @@ -143,12 +144,13 @@ * * @return SerializationOptions */ - private function makeSerializationOptions( $languageCode ) { - $fallbackChain = $this-getLanguageFallbackChain( $languageCode ); - $languageCodes = Utils::getLanguageCodes() + array( $languageCode = $fallbackChain ); + private function makeJsConfigSerializationOptions( $languageCode ) { + // NOTE: when serializing the full entity to be stored in the + // wbEntity JS config variable, we currently do not want any + // language fallback to be applied. $options = new SerializationOptions(); - $options-setLanguages( $languageCodes ); + $options-setOption( ValueFormatter::OPT_LANG, $languageCode ); return $options; } -- To view, visit https://gerrit.wikimedia.org/r/176370 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie00c62d48497c8f75c13df0cad8768c2efb11e22 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] Win32 input for py3: streams are unicode not bytes - change (pywikibot/core)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/176371 Change subject: Win32 input for py3: streams are unicode not bytes .. Win32 input for py3: streams are unicode not bytes On Python 2, streams are bytes, so the unicode data returned from the win32 api needs to be encoded (as utf-8, in this case). In Python 3, this is all unicode, so we need to skip the encoding step. Decoding works OK due to the 'if isinstance(x, unicode)' blocks. Change-Id: I4121ac87816b144e334e7e47c61ce445f0b6e2c9 --- M pywikibot/userinterfaces/win32_unicode.py 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/71/176371/1 diff --git a/pywikibot/userinterfaces/win32_unicode.py b/pywikibot/userinterfaces/win32_unicode.py index b92b273..dc85cc2 100755 --- a/pywikibot/userinterfaces/win32_unicode.py +++ b/pywikibot/userinterfaces/win32_unicode.py @@ -28,6 +28,9 @@ if sys.version_info[0] 2: unicode = str +PY3 = True +else: +PY3 = False if sys.platform == win32: import codecs @@ -137,7 +140,11 @@ result = ReadConsoleW(self._hConsole, self.buffer, maxnum, byref(numrecv), None) if not result: raise Exception(stdin failure) -return self.buffer.value[:numrecv.value].encode(self.encoding) +data = self.buffer.value[:numrecv.value] +if not PY3: +return data.encode(self.encoding) +else: +return data if real_stdout or real_stderr: # BOOL WINAPI WriteConsoleW(HANDLE hOutput, LPWSTR lpBuffer, DWORD nChars, -- To view, visit https://gerrit.wikimedia.org/r/176371 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4121ac87816b144e334e7e47c61ce445f0b6e2c9 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add IP::isInRanges() - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Add IP::isInRanges() .. Add IP::isInRanges() cf https://github.com/wikimedia/operations-mediawiki-config/blob/master/wmf-config/throttle.php#L43-L58 Change-Id: I8ae145035de9d349710971f17551da637e4d2242 --- M includes/utils/IP.php 1 file changed, 19 insertions(+), 0 deletions(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/utils/IP.php b/includes/utils/IP.php index 0e2db8c..77f9cd1 100644 --- a/includes/utils/IP.php +++ b/includes/utils/IP.php @@ -629,6 +629,25 @@ } /** +* Determines if an IP address is a list of CIDR a.b.c.d/n ranges. +* +* @since 1.25 +* +* @param string $ip the IP to check +* @param array $ranges the IP ranges, each element a range +* +* @return bool true if the specified adress belongs to the specified range; otherwise, false. +*/ + public static function isInRanges( $ip, $ranges ) { + foreach ( $ranges as $range ) { + if ( self::isInRange( $ip, $range ) ) { + return true; + } + } + return false; + } + + /** * Convert some unusual representations of IPv4 addresses to their * canonical dotted quad representation. * -- To view, visit https://gerrit.wikimedia.org/r/172558 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ae145035de9d349710971f17551da637e4d2242 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org Gerrit-Reviewer: Umherirrender umherirrender_de...@web.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Style visited links correctly - change (mediawiki/core)
Florianschmidtwelzow has uploaded a new change for review. https://gerrit.wikimedia.org/r/176372 Change subject: Style visited links correctly .. Style visited links correctly If a link is styled as a neutral button, the text color will change if the link is already visited. Style the text like a real button (same color for visited and not visited links) Task T76240 Change-Id: I18d985c1ada10becee15888b7f31d56976c7a2eb --- M resources/src/mediawiki.less/mediawiki.ui/mixins.less 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/72/176372/1 diff --git a/resources/src/mediawiki.less/mediawiki.ui/mixins.less b/resources/src/mediawiki.less/mediawiki.ui/mixins.less index 1f21b41..40a5c41 100644 --- a/resources/src/mediawiki.less/mediawiki.ui/mixins.less +++ b/resources/src/mediawiki.less/mediawiki.ui/mixins.less @@ -63,7 +63,8 @@ border: 1px solid @colorGray12; :hover, - :active { + :active, + :visited { // make sure that is isn't inheriting from a general rule color: @colorButtonText; } -- To view, visit https://gerrit.wikimedia.org/r/176372 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18d985c1ada10becee15888b7f31d56976c7a2eb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow florian.schmidt.wel...@t-online.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Maintenance script for populating wbc_entity_usage - change (mediawiki...Wikibase)
Daniel Kinzler has uploaded a new change for review. https://gerrit.wikimedia.org/r/176373 Change subject: Maintenance script for populating wbc_entity_usage .. Maintenance script for populating wbc_entity_usage Bug: T73050 Change-Id: I9e99723d90478d37ea30a63aa39d507763d0dfff --- M client/includes/Usage/Sql/UsageTablePrimer.php A client/maintenance/populateEntityUsage.php 2 files changed, 93 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/73/176373/1 diff --git a/client/includes/Usage/Sql/UsageTablePrimer.php b/client/includes/Usage/Sql/UsageTablePrimer.php index bb4f3eb..53a9409 100644 --- a/client/includes/Usage/Sql/UsageTablePrimer.php +++ b/client/includes/Usage/Sql/UsageTablePrimer.php @@ -116,8 +116,10 @@ /** * Fill the usage table with rows based on entries in page_props. +* +* @param int $fromPageId */ - public function fillUsageTable() { + public function fillUsageTable( $fromPageId = 0 ) { do { $count = $this-processUsageBatch( $fromPageId ); $this-progressReporter-reportMessage( Filling usage table: processed $count pages, starting with page #$fromPageId. ); diff --git a/client/maintenance/populateEntityUsage.php b/client/maintenance/populateEntityUsage.php new file mode 100644 index 000..e6b6e6f --- /dev/null +++ b/client/maintenance/populateEntityUsage.php @@ -0,0 +1,90 @@ +?php + +namespace Wikibase; + +use LoggedUpdateMaintenance; +use Wikibase\Client\Usage\Sql\UsageTablePrimer; +use Wikibase\Client\WikibaseClient; +use Wikibase\Lib\Reporting\ObservableMessageReporter; +use Wikibase\Lib\Reporting\ReportingExceptionHandler; + +$basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' ) : __DIR__ . '/../../../..'; + +require_once $basePath . '/maintenance/Maintenance.php'; + +/** + * Maintenance script for populating wbc_entity_usage based on the page_props table. + * + * @since 0.4 + * + * @licence GNU GPL v2+ + * @author Daniel Kinzler + */ +class PopulateEntityUsage extends LoggedUpdateMaintenance { + + public function __construct() { + parent::__construct(); + + $this-mDescription = 'Populate the wbc_entity_usage table based on entries in page_props.'; + + $this-addOption( 'start-page', The page ID to start from., false, true ); + $this-addOption( 'batch-size', Number of pages to update per database transaction (1000 per default), false, true ); + } + + /** +* @see LoggedUpdateMaintenance::doDBUpdates +* +* @return boolean +*/ + public function doDBUpdates() { + if ( !defined( 'WBC_VERSION' ) ) { + $this-output( You need to have Wikibase enabled in order to use this maintenance script!\n\n ); + exit; + } + + $batchSize = intval( $this-getOption( 'batch-size', 1000 ) ); + $startPage = intval( $this-getOption( 'start-oage', 1 ) ); + + $reporter = new ObservableMessageReporter(); + $reporter-registerReporterCallback( + array( $this, 'report' ) + ); + + $primer = new UsageTablePrimer( + WikibaseClient::getDefaultInstance()-getEntityIdParser(), + wfGetLB(), + 'wbc_entity_usage', + $batchSize + ); + + $primer-setProgressReporter( $reporter ); + $primer-setExceptionHandler( new ReportingExceptionHandler( $reporter ) ); + + $primer-fillUsageTable( $startPage ); + return true; + } + + /** +* @see LoggedUpdateMaintenance::getUpdateKey +* +* @return string +*/ + public function getUpdateKey() { + return 'Wikibase\PopulateEntityUsage'; + } + + /** +* Outputs a message vis the output() method. +* +* @since 0.4 +* +* @param $msg +*/ + public function report( $msg ) { + $this-output( $msg\n ); + } + +} + +$maintClass = 'Wikibase\PopulateEntityUsage'; +require_once( RUN_MAINTENANCE_IF_MAIN ); -- To view, visit https://gerrit.wikimedia.org/r/176373 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e99723d90478d37ea30a63aa39d507763d0dfff 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] Mention the Continue label as a parameter in visualeditor-... - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Mention the Continue label as a parameter in visualeditor-recreate .. Mention the Continue label as a parameter in visualeditor-recreate Bug: T75971 Change-Id: Id075233da4e8a2978b07b5f2735ac6620ff5330d --- M VisualEditor.php M modules/ve-mw/i18n/en.json M modules/ve-mw/i18n/qqq.json M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 4 files changed, 8 insertions(+), 3 deletions(-) Approvals: Divec: Looks good to me, approved jenkins-bot: Verified diff --git a/VisualEditor.php b/VisualEditor.php index 328b4bf..8b2bef1 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -889,6 +889,9 @@ 'visualeditor-wikitext-warning-title', 'visualeditor-window-title', + // Mentioned in another message + 'ooui-dialog-process-continue', + // Used by the TOC widget (currently experimental) 'toc', 'showtoc', diff --git a/modules/ve-mw/i18n/en.json b/modules/ve-mw/i18n/en.json index 23ab2e8..05f1e91 100644 --- a/modules/ve-mw/i18n/en.json +++ b/modules/ve-mw/i18n/en.json @@ -273,7 +273,7 @@ visualeditor-savedialog-warning-dirty: Your edit may have been corrupted – please review before saving., visualeditor-saveerror: Error saving data to server: $1., visualeditor-serializeerror: Error loading data from server: $1., - visualeditor-recreate: The page has been deleted since you started editing. Press continue to recreate it., + visualeditor-recreate: The page has been deleted since you started editing. Press \$1\ to recreate it., visualeditor-settings-tool: Page settings, visualeditor-timeout:It looks like this editor is currently unavailable. Would you like to edit in source mode instead?, visualeditor-toolbar-cite-label: Cite, diff --git a/modules/ve-mw/i18n/qqq.json b/modules/ve-mw/i18n/qqq.json index fbdf3ef..74b0bc7 100644 --- a/modules/ve-mw/i18n/qqq.json +++ b/modules/ve-mw/i18n/qqq.json @@ -282,7 +282,7 @@ visualeditor-savedialog-warning-dirty: Note displayed to users in the save dialog if VisualEditor believes that it may have corrupted the page., visualeditor-saveerror: Text shown when the editor fails to save properly.\n\nParameters:\n* $1 is an error message, in English., visualeditor-serializeerror: Text shown when the editor fails to load the wikitext for saving.\n\nParameters:\n* $1 is an error message, in English., - visualeditor-recreate: Text shown when the editor fails to save the page due to it having been deleted since they opened VE. The \continue\ message is {{mw-msg|ooui-dialog-process-continue}}., + visualeditor-recreate: Text shown when the editor fails to save the page due to it having been deleted since they opened VE. $1 is the message {{msg-mw|ooui-dialog-process-continue}}., visualeditor-settings-tool: Text of tool in the toolbar the lets users set specific page settings.\n{{Identical|Page settings}}, visualeditor-timeout: Text (JavaScript confirm()) shown when the editor fails to load properly due to a 504 Gateway Timeout error., visualeditor-toolbar-cite-label: Label text for the toolbar button for inserting customized references.\n{{Identical|Cite}}, diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index b79fdfc..e1eaf56 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -667,8 +667,10 @@ * @method */ ve.init.mw.ViewPageTarget.prototype.onSaveErrorPageDeleted = function () { + var continueLabel = mw.msg( 'ooui-dialog-process-continue' ); + this.pageDeletedWarning = true; - this.showSaveError( mw.msg( 'visualeditor-recreate' ), true, true ); + this.showSaveError( mw.msg( 'visualeditor-recreate', continueLabel ), true, true ); }; /** -- To view, visit https://gerrit.wikimedia.org/r/176298 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id075233da4e8a2978b07b5f2735ac6620ff5330d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il Gerrit-Reviewer: Alex Monk kren...@wikimedia.org Gerrit-Reviewer: Divec da...@sheetmusic.org.uk Gerrit-Reviewer: Jforrester jforres...@wikimedia.org Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: d20cc32..9dad038 - change (mediawiki/extensions)
Jenkins-mwext-sync has uploaded a new change for review. https://gerrit.wikimedia.org/r/176374 Change subject: Syncronize VisualEditor: d20cc32..9dad038 .. Syncronize VisualEditor: d20cc32..9dad038 Change-Id: Iadcc87d7113f96195b49410c7bfb6beb2effe571 --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions refs/changes/74/176374/1 diff --git a/VisualEditor b/VisualEditor index d20cc32..9dad038 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit d20cc324fb43d88c3e77e25bea197f6242607894 +Subproject commit 9dad03819eae7227fe385a01594f59450370909e -- To view, visit https://gerrit.wikimedia.org/r/176374 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iadcc87d7113f96195b49410c7bfb6beb2effe571 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Register Cargo and WikibaseJavaScriptApi - change (mediawiki/extensions)
Hashar has submitted this change and it was merged. Change subject: Register Cargo and WikibaseJavaScriptApi .. Register Cargo and WikibaseJavaScriptApi Change-Id: I7a9475930decfb7a2aedbedcb0773fecb8281ac0 --- M .gitmodules 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Hashar: Verified; Looks good to me, approved diff --git a/.gitmodules b/.gitmodules index 66d31dd..7337cc6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -266,6 +266,10 @@ path = Capiunto url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Capiunto.git branch = . +[submodule Cargo] + path = Cargo + url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Cargo.git + branch = . [submodule Carp] path = Carp url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Carp.git @@ -2702,6 +2706,10 @@ path = WikibaseClient url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/WikibaseClient.git branch = . +[submodule WikibaseJavaScriptApi] + path = WikibaseJavaScriptApi + url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/WikibaseJavaScriptApi.git + branch = . [submodule WikibaseLib] path = WikibaseLib url = https://gerrit.wikimedia.org/r/p/mediawiki/extensions/WikibaseLib.git -- To view, visit https://gerrit.wikimedia.org/r/176362 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a9475930decfb7a2aedbedcb0773fecb8281ac0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Hashar has...@free.fr Gerrit-Reviewer: Hashar has...@free.fr ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add EntityIdHtmlLinkFormatterTest - change (mediawiki...Wikibase)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/176375 Change subject: Add EntityIdHtmlLinkFormatterTest .. Add EntityIdHtmlLinkFormatterTest Regression test to catch things like T75580 Change-Id: Ie760640593f8877f0c3d1f9afa99f2ce625046c2 --- A lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php 1 file changed, 133 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/75/176375/1 diff --git a/lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php b/lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php new file mode 100644 index 000..be80a51 --- /dev/null +++ b/lib/tests/phpunit/formatters/EntityIdHtmlLinkFormatterTest.php @@ -0,0 +1,133 @@ +?php + +namespace Wikibase\Lib\Test; + +use OutOfBoundsException; +use Title; +use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Entity\ItemId; +use Wikibase\Lib\EntityIdHtmlLinkFormatter; +use Wikibase\Lib\Store\StorageException; +use ValueFormatters\FormatterOptions; + +/** + * @covers Wikibase\Lib\EntityIdHtmlLinkFormatter + * + * @group ValueFormatters + * @group WikibaseLib + * @group Wikibase + * + * @licence GNU GPL v2+ + * @author Marius Hoch h...@online.de + */ +class EntityIdHtmlLinkFormatterTest extends \PHPUnit_Framework_TestCase { + + private function getLabelLookup() { + $labelLookup = $this-getMock( 'Wikibase\Lib\Store\LabelLookup' ); + $labelLookup-expects( $this-any() ) + -method( 'getLabel' ) + -will( $this-returnValue( 'A label' ) ); + + return $labelLookup; + } + + private function getLabelLookupNoEntity() { + $labelLookup = $this-getMock( 'Wikibase\Lib\Store\LabelLookup' ); + $labelLookup-expects( $this-any() ) + -method( 'getLabel' ) + -will( $this-throwException( new StorageException( 'meep' ) ) ); + + return $labelLookup; + } + + private function getLabelLookupNoLabel() { + $labelLookup = $this-getMock( 'Wikibase\Lib\Store\LabelLookup' ); + $labelLookup-expects( $this-any() ) + -method( 'getLabel' ) + -will( $this-throwException( new OutOfBoundsException( 'meep' ) ) ); + + return $labelLookup; + } + + /** +* @return EntityTitleLookup +*/ + private function newEntityTitleLookup() { + $entityTitleLookup = $this-getMock( 'Wikibase\Lib\Store\EntityTitleLookup' ); + $entityTitleLookup-expects( $this-any() ) + -method( 'getTitleForId' ) + -will( $this-returnCallback( function ( EntityId $entityId ) { + return Title::newFromText( $entityId-getSerialization() ); + } ) + ); + + return $entityTitleLookup; + } + + public function formatProvider() { + $escapedItemUrl = preg_quote( Title::newFromText( 'Q42' )-getLocalURL(), '/' ); + + return array( + 'has a label' = array( + 'expectedRegex' = '/' . $escapedItemUrl . '.*A label/', + 'lookupLabel' = true + ), + has no label = array( + 'expectedRegex' = '/' . $escapedItemUrl . '.*Q42/', + 'lookupLabel' = true, + 'hasLabel' = false + ), + doesn't exist, lookup labels = array( + 'expectedRegex' = '/^Q42' . preg_quote( wfMessage( 'word-separator' )-text(), '/' ) . '.*' . + preg_quote( wfMessage( 'parentheses', wfMessage( 'wikibase-deletedentity-item' )-text() )-text(), '/' ) . + '/', + 'lookupLabel' = true, + 'hasLabel' = false, + 'exists'= false + ), + doesn't exist, don't lookup labels = array( + 'expectedRegex' = '/' . $escapedItemUrl . '.*Q42/', + 'lookupLabel' = false, + 'hasLabel' = false, + 'exists'= false + ), + Don't lookup labels, has label = array( + 'expectedRegex' = '/' . $escapedItemUrl . '.*Q42/', + 'lookupLabel' = false + ), +
[MediaWiki-commits] [Gerrit] Introduce config.weblink_dead_days instead of global day - change (pywikibot/compat)
jenkins-bot has submitted this change and it was merged. Change subject: Introduce config.weblink_dead_days instead of global day .. Introduce config.weblink_dead_days instead of global day Using global day prevents from importing linkchecker classes into another script. Rename the variable and add it to 'config.py' Change-Id: Ic95c31ecc7dbb557db8319b5857a4e94e4347db6 --- M config.py M weblinkchecker.py 2 files changed, 13 insertions(+), 8 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/config.py b/config.py index 50fafa2..19f8369 100644 --- a/config.py +++ b/config.py @@ -336,6 +336,9 @@ report_dead_links_on_talk = False +# Don't alert on links days_dead old or younger +weblink_dead_days = 7 + ## DATABASE SETTINGS ## db_hostname = 'localhost' db_username = 'wikiuser' diff --git a/weblinkchecker.py b/weblinkchecker.py index e7f2a90..501e01d 100644 --- a/weblinkchecker.py +++ b/weblinkchecker.py @@ -51,8 +51,9 @@ -notalk Overrides the report_dead_links_on_talk config variable, disabling the feature. --day the first time found dead link longer than x day ago, it should - probably be fixed or removed. if no set, default is 7 day. + +-day Do not report broken link if the link is there only since + x days or less. If not set, the default is 7 days. All other parameters will be regarded as part of the title of a single page, and the bot will only work on that single page. @@ -71,6 +72,9 @@ links on the article's talk page if (and ONLY if) the linked page has been unavailable at least two times during a timespan of at least one week. + +weblink_dead_days - sets the timespan (default: one week) after which +a dead link will be reported Syntax examples: python weblinkchecker.py -start:! @@ -500,7 +504,7 @@ else: pywikibot.output('*[[%s]] links to %s - %s.' % (self.page.title(), self.url, message)) -self.history.setLinkDead(self.url, message, self.page, day) +self.history.setLinkDead(self.url, message, self.page, config.weblink_dead_days) class History: @@ -570,7 +574,7 @@ self.reportThread.report(url, errorReport, containingPage, archiveURL) -def setLinkDead(self, url, error, page, day): +def setLinkDead(self, url, error, page, weblink_dead_days): Adds the fact that the link was found dead to the .dat file. @@ -586,7 +590,7 @@ # if the first time we found this link longer than x day ago # (default is a week), it should probably be fixed or removed. # We'll list it in a file so that it can be removed manually. -if timeSinceFirstFound 60 * 60 * 24 * day: +if timeSinceFirstFound 60 * 60 * 24 * weblink_dead_days: # search for archived page archiveURL = pywikibot.weblib.getInternetArchiveURL(self.site, url) if archiveURL is None: @@ -806,8 +810,6 @@ # that are also used by other scripts and that determine on which pages # to work on. genFactory = pagegenerators.GeneratorFactory() -global day -day = 7 for arg in pywikibot.handleArgs(): if arg == '-talk': config.report_dead_links_on_talk = True @@ -823,7 +825,7 @@ elif arg.startswith('-ignore:'): HTTPignore.append(int(arg[8:])) elif arg.startswith('-day:'): -day = int(arg[5:]) +config.weblink_dead_days = int(arg[5:]) elif arg.startswith('-xmlstart'): if len(arg) == 9: xmlStart = pywikibot.input( -- To view, visit https://gerrit.wikimedia.org/r/175610 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic95c31ecc7dbb557db8319b5857a4e94e4347db6 Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Xqt i...@gno.de 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] Show Locked message at Special:CentralAuth only if account... - change (mediawiki...CentralAuth)
Glaisher has uploaded a new change for review. https://gerrit.wikimedia.org/r/176376 Change subject: Show Locked message at Special:CentralAuth only if account is locked .. Show Locked message at Special:CentralAuth only if account is locked Bug: T73278 Change-Id: I24db96b1e088e6f55105803ea182def12f2d1ad5 --- M includes/specials/SpecialCentralAuth.php 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth refs/changes/76/176376/1 diff --git a/includes/specials/SpecialCentralAuth.php b/includes/specials/SpecialCentralAuth.php index 4d26914..05f28a0 100644 --- a/includes/specials/SpecialCentralAuth.php +++ b/includes/specials/SpecialCentralAuth.php @@ -287,9 +287,12 @@ 'username' = $globalUser-getName(), 'registered' = htmlspecialchars( $this-getLanguage()-timeanddate( $reg, true ) . ($age) ), 'editcount' = htmlspecialchars( $this-getLanguage()-formatNum( $this-evaluateTotalEditcount() ) ), - 'locked' = $this-msg( $globalUser-isLocked() ? 'centralauth-admin-yes' : 'centralauth-admin-no' )-escaped(), ); + if ( $globalUser-isLocked() ) { + $attribs['locked'] = $this-msg('centralauth-admin-yes')-escaped(); + } + if ( $this-mCanOversight ) { $attribs['hidden'] = $this-formatHiddenLevel( $globalUser-getHiddenLevel() ); } -- To view, visit https://gerrit.wikimedia.org/r/176376 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24db96b1e088e6f55105803ea182def12f2d1ad5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralAuth Gerrit-Branch: master Gerrit-Owner: Glaisher glaisher.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] No language fallback when serializing wbEntity. - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: No language fallback when serializing wbEntity. .. No language fallback when serializing wbEntity. wbEntity should (for now) only contain explicitly defined terms. If we later decide to include terms derived via language fallback, such terms should be makred accordingly. Bug: T76210 Change-Id: Ie00c62d48497c8f75c13df0cad8768c2efb11e22 --- M repo/includes/EntityParserOutputGeneratorFactory.php 1 file changed, 7 insertions(+), 5 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/includes/EntityParserOutputGeneratorFactory.php b/repo/includes/EntityParserOutputGeneratorFactory.php index bdb1463..1a69a6b 100644 --- a/repo/includes/EntityParserOutputGeneratorFactory.php +++ b/repo/includes/EntityParserOutputGeneratorFactory.php @@ -7,6 +7,7 @@ use ParserOutput; use RequestContext; use User; +use ValueFormatters\ValueFormatter; use Wikibase\DataModel\Entity\Entity; use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityIdParser; @@ -102,7 +103,7 @@ return new ParserOutputJsConfigBuilder( $this-entityIdParser, $this-entityTitleLookup, - $this-makeSerializationOptions( $languageCode ) + $this-makeJsConfigSerializationOptions( $languageCode ) ); } @@ -143,12 +144,13 @@ * * @return SerializationOptions */ - private function makeSerializationOptions( $languageCode ) { - $fallbackChain = $this-getLanguageFallbackChain( $languageCode ); - $languageCodes = Utils::getLanguageCodes() + array( $languageCode = $fallbackChain ); + private function makeJsConfigSerializationOptions( $languageCode ) { + // NOTE: when serializing the full entity to be stored in the + // wbEntity JS config variable, we currently do not want any + // language fallback to be applied. $options = new SerializationOptions(); - $options-setLanguages( $languageCodes ); + $options-setOption( ValueFormatter::OPT_LANG, $languageCode ); return $options; } -- To view, visit https://gerrit.wikimedia.org/r/176370 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie00c62d48497c8f75c13df0cad8768c2efb11e22 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de Gerrit-Reviewer: Aklapper aklap...@wikimedia.org Gerrit-Reviewer: Henning Snater henning.sna...@wikimedia.de Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: JanZerebecki jan.wikime...@zerebecki.de Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@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] Update version before MLEB release - change (mediawiki...UniversalLanguageSelector)
jenkins-bot has submitted this change and it was merged. Change subject: Update version before MLEB release .. Update version before MLEB release Change-Id: I38c52b97ceab88008869cb4b0e302f97176fbdd2 --- M UniversalLanguageSelector.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/UniversalLanguageSelector.php b/UniversalLanguageSelector.php index 4d57274..cc00903 100644 --- a/UniversalLanguageSelector.php +++ b/UniversalLanguageSelector.php @@ -25,7 +25,7 @@ /** * Version number used in extension credits and in other placed where needed. */ -define( 'ULS_VERSION', '2014-10-31' ); +define( 'ULS_VERSION', '2014-11-28' ); $GLOBALS['wgExtensionCredits']['other'][] = array( 'path' = __FILE__, -- To view, visit https://gerrit.wikimedia.org/r/176364 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I38c52b97ceab88008869cb4b0e302f97176fbdd2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: KartikMistry kartik.mis...@gmail.com Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Style visited links correctly - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Style visited links correctly .. Style visited links correctly If a link is styled as a neutral button, the text color will change if the link is already visited. Style the text like a real button (same color for visited and not visited links) Bug: T76240 Change-Id: I18d985c1ada10becee15888b7f31d56976c7a2eb --- M resources/src/mediawiki.less/mediawiki.ui/mixins.less 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki.less/mediawiki.ui/mixins.less b/resources/src/mediawiki.less/mediawiki.ui/mixins.less index 1f21b41..40a5c41 100644 --- a/resources/src/mediawiki.less/mediawiki.ui/mixins.less +++ b/resources/src/mediawiki.less/mediawiki.ui/mixins.less @@ -63,7 +63,8 @@ border: 1px solid @colorGray12; :hover, - :active { + :active, + :visited { // make sure that is isn't inheriting from a general rule color: @colorButtonText; } -- To view, visit https://gerrit.wikimedia.org/r/176372 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I18d985c1ada10becee15888b7f31d56976c7a2eb Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow florian.schmidt.wel...@t-online.de Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: Florianschmidtwelzow florian.schmidt.wel...@t-online.de Gerrit-Reviewer: Jack Phoenix j...@countervandalism.net Gerrit-Reviewer: Jdlrobson jrob...@wikimedia.org Gerrit-Reviewer: Prtksxna psax...@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] Win32 input for py3: streams are unicode not bytes - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Win32 input for py3: streams are unicode not bytes .. Win32 input for py3: streams are unicode not bytes On Python 2, streams are bytes, so the unicode data returned from the win32 api needs to be encoded (as utf-8, in this case). In Python 3, this is all unicode, so we need to skip the encoding step. Decoding works OK due to the 'if isinstance(x, unicode)' blocks. Bug: T76236 Change-Id: I4121ac87816b144e334e7e47c61ce445f0b6e2c9 --- M pywikibot/userinterfaces/win32_unicode.py 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/userinterfaces/win32_unicode.py b/pywikibot/userinterfaces/win32_unicode.py index b92b273..dc85cc2 100755 --- a/pywikibot/userinterfaces/win32_unicode.py +++ b/pywikibot/userinterfaces/win32_unicode.py @@ -28,6 +28,9 @@ if sys.version_info[0] 2: unicode = str +PY3 = True +else: +PY3 = False if sys.platform == win32: import codecs @@ -137,7 +140,11 @@ result = ReadConsoleW(self._hConsole, self.buffer, maxnum, byref(numrecv), None) if not result: raise Exception(stdin failure) -return self.buffer.value[:numrecv.value].encode(self.encoding) +data = self.buffer.value[:numrecv.value] +if not PY3: +return data.encode(self.encoding) +else: +return data if real_stdout or real_stderr: # BOOL WINAPI WriteConsoleW(HANDLE hOutput, LPWSTR lpBuffer, DWORD nChars, -- To view, visit https://gerrit.wikimedia.org/r/176371 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4121ac87816b144e334e7e47c61ce445f0b6e2c9 Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: XZise commodorefabia...@gmx.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove jobs that only exist in experimental Wikidata pipeline. - change (integration/config)
JanZerebecki has uploaded a new change for review. https://gerrit.wikimedia.org/r/176377 Change subject: Remove jobs that only exist in experimental Wikidata pipeline. .. Remove jobs that only exist in experimental Wikidata pipeline. Change-Id: Ife66e39153b3a73ab00cc76573094ddbf476e3ea --- M jjb/wikidata.yaml M zuul/layout.yaml 2 files changed, 0 insertions(+), 90 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/77/176377/1 diff --git a/jjb/wikidata.yaml b/jjb/wikidata.yaml index 4e990e9..9643946 100644 --- a/jjb/wikidata.yaml +++ b/jjb/wikidata.yaml @@ -11,11 +11,6 @@ - shell: $WORKSPACE/extensions/Wikibase/build/jenkins/mw-apply-wb-settings.sh -r {repoorclient} -e {experimental} -b false - builder: -name: wd-build-apply-settings -builders: - - shell: $WORKSPACE/extensions/Wikidata/extensions/Wikibase/build/jenkins/mw-apply-wb-settings.sh -r {repoorclient} -e {experimental} -b true - -- builder: name: wd-runtests builders: - shell: | @@ -73,49 +68,6 @@ - qunit-cleanup - mw-teardown -- job-template: -name: 'mwext-Wikidata-{kind}-tests' -node: contintLabsSlave UbuntuPrecise -defaults: use-zuul-for-mw-ext -triggers: - - zuul -builders: - - mw-setup-extension: -mwbranch: 'master' # This should test against the current branch (not important yet) -dependencies: '{dependencies}' - - wd-build-apply-settings: - repoorclient: '{repoorclient}' - experimental: '{experimental}' - - mw-run-update-script - - wd-runtests: - params: '{phpunit-params}' -publishers: - - archive-log-dir - - junit: -results: 'log/junit*.xml' - - mw-teardown - -- job-template: -name: 'mwext-Wikidata-qunit' -node: contintLabsSlave UbuntuPrecise -concurrent: true -defaults: use-zuul-for-mw-ext -triggers: - - zuul -builders: - - mw-setup-extension: -mwbranch: 'master' -dependencies: '{dependencies}' - - wd-build-apply-settings: - repoorclient: 'repo' # qunit tests are in lib so this can be either.. - experimental: 'true' - - mw-run-update-script - - qunit -publishers: - - archive-log-dir - - qunit-cleanup - - mw-teardown - - project: name: wikidata # By default we do not need any other extensions: @@ -152,35 +104,3 @@ - 'mwext-Wikibase-qunit': ext-name: 'Wikibase' - - 'mwext-Wikidata-{kind}-tests': -ext-name: 'Wikidata' -kind: client -repoorclient: 'client' -experimental: 'true' -dependencies: 'Scribunto' -phpunit-params: '--group Wikibase,WikibaseClient' - - - 'mwext-Wikidata-{kind}-tests': -ext-name: 'Wikidata' -kind: client-nonexperimental -repoorclient: 'client' -experimental: 'false' -dependencies: 'Scribunto' -phpunit-params: '--group Wikibase,WikibaseClient' - - - 'mwext-Wikidata-{kind}-tests': -ext-name: 'Wikidata' -kind: repo -repoorclient: 'repo' -experimental: 'true' -phpunit-params: '--group Wikibase,PropertySuggester' - - - 'mwext-Wikidata-{kind}-tests': -ext-name: 'Wikidata' -kind: repo-nonexperimental -repoorclient: 'repo' -experimental: 'false' -phpunit-params: '--group Wikibase,PropertySuggester' - - - 'mwext-Wikidata-qunit': -ext-name: 'Wikidata' diff --git a/zuul/layout.yaml b/zuul/layout.yaml index e52fb4f..7d90c0e 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -1632,8 +1632,6 @@ - name: ^mwext-Wikibase-qunit$ voting: false - - name: ^mwext-Wikidata-qunit$ -voting: false - name: mediawiki-core-jsduck branch: ^(REL1_21|REL1_22|REL1_23|REL1_24|master)$ @@ -5772,14 +5770,6 @@ - name: mediawiki/extensions/Wikidata template: - name: extension-unittests -experimental: - - mwext-Wikidata-jslint - - mwext-Wikidata-lint - - mwext-Wikidata-client-tests - - mwext-Wikidata-client-nonexperimental-tests - - mwext-Wikidata-repo-tests - - mwext-Wikidata-repo-nonexperimental-tests - - mwext-Wikidata-qunit - name: mediawiki/extensions/WikiForum template: -- To view, visit https://gerrit.wikimedia.org/r/176377 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ife66e39153b3a73ab00cc76573094ddbf476e3ea Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: JanZerebecki jan.wikime...@zerebecki.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Introducing RecentChangesRowsForDisplay hook. - change (mediawiki/core)
Daniel Kinzler has uploaded a new change for review. https://gerrit.wikimedia.org/r/176378 Change subject: Introducing RecentChangesRowsForDisplay hook. .. Introducing RecentChangesRowsForDisplay hook. The RecentChangesRowsForDisplay can be used to inspect or manipulate the set of RC rows shown by Special:Watchlist or Special:RecentChanges. We want this for Wikidata, because it would allow us to pre-fetch information about any item pages which are about to be listed. That way, we avoid hitting the database every time the LinkBegin hook is called (which we use to show the item's label in the user's language, instead of a cryptic Q1234567 number). Bug: T72309 Change-Id: I383fea69b4d408cda57114db1758ae49a647b6a4 --- M RELEASE-NOTES-1.25 M docs/hooks.txt M includes/specialpage/ChangesListSpecialPage.php M includes/specials/SpecialRecentchanges.php 4 files changed, 20 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/78/176378/1 diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index caf29f0..fe295b6 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -220,6 +220,8 @@ fail for custom tokens registered only via the deprecated ApiTokensGetTokenTypes hook. The ApiQueryTokensRegisterTypes hook should be used for this to work. * Added wgRelevantArticleId to the client-side config, for use on special pages. +* Added hook 'RecentChangesRowsForDisplay', called before displaying a set of RC + rows. == Compatibility == diff --git a/docs/hooks.txt b/docs/hooks.txt index 0146b86..fa022a0 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2207,6 +2207,16 @@ 'RecentChange_save': Called at the end of RecentChange::save(). $recentChange: RecentChange object +'RecentChangesRowsForDisplay': Called before displaying a set of RC rows. +Returning false from the handler function has the same effect as +setting $rows = false. +$rows: A ResultWrapper containing the rows, or the bool value false. + Hook handlers are free to inspect, modify, or replace the $rows. + Care should be taken to reset the result set's iterator state by calling + reset(), if needed. +$opts: FormOptions that were used to generate the rows. +$context: IContextSource of the page that will show the rows. + 'RedirectSpecialArticleRedirectParams': Lets you alter the set of parameter names such as oldid that are preserved when using redirecting special pages such as Special:MyPage and Special:MyTalk. diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index c28aa86..771c45b 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -82,7 +82,13 @@ $opts = $this-getOptions(); $conds = $this-buildMainQueryConds( $opts ); - return $this-doMainQuery( $conds, $opts ); + $rows = $this-doMainQuery( $conds, $opts ); + + if ( !wfRunHooks( 'RecentChangesRowsForDisplay', array( $rows, $opts, $this-getContext() ) ) ) { + $rows = false; + } + + return $rows; } /** diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 58b51b3..7a27664 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -607,7 +607,7 @@ $newrows[$k] = $rowsarr[$k]; } } - $rows = $newrows; + $rows = new FakeResultWrapper( $newrows ); } /** -- To view, visit https://gerrit.wikimedia.org/r/176378 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I383fea69b4d408cda57114db1758ae49a647b6a4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core 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] Fix i18n - change (mediawiki...CollapsibleVector)
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/176379 Change subject: Fix i18n .. Fix i18n * Fixes directory to look for in i18n. Change-Id: I4b89b22776ac8cea1180e2f87fe6719bda416edd --- M CollapsibleVector.i18n.php A i18n/ksh.json A i18n/sr-ec.json 3 files changed, 22 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollapsibleVector refs/changes/79/176379/1 diff --git a/CollapsibleVector.i18n.php b/CollapsibleVector.i18n.php index 5eb3bcd..a5e726d 100644 --- a/CollapsibleVector.i18n.php +++ b/CollapsibleVector.i18n.php @@ -15,7 +15,7 @@ function wfJsonI18nShim838dd91d281628a2( $cache, $code, $cachedData ) { $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . /./i18n/$csCode.json; + $fileName = dirname( __FILE__ ) . /i18n/$csCode.json; if ( is_readable( $fileName ) ) { $data = FormatJson::decode( file_get_contents( $fileName ), true ); foreach ( array_keys( $data ) as $key ) { @@ -32,4 +32,4 @@ } $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim838dd91d281628a2'; -} +} \ No newline at end of file diff --git a/i18n/ksh.json b/i18n/ksh.json new file mode 100644 index 000..6c12901 --- /dev/null +++ b/i18n/ksh.json @@ -0,0 +1,12 @@ +{ + @metadata: { + authors: [ + Purodha + ] + }, + collapsiblevector: Verschöhneronge för de Bovverfläsch „Vector“, + collapsiblevector-desc: Ene Zohsaz för de Bovverfläsch „Vector“, + collapsiblevector-collapsiblenav-preference: Donn et Ußblände vun de Jroppe em Menüh aan de Sigg en de Bovverfläsch „Vector“ zohlohße, + collapsiblevector-collapsiblenav-more: Mieh Schprohche, + collapsiblevector-noexperiments-preference: Donn mesch nit met neu Sache zom Ußprobehre behälleje. +} diff --git a/i18n/sr-ec.json b/i18n/sr-ec.json new file mode 100644 index 000..2cb0648 --- /dev/null +++ b/i18n/sr-ec.json @@ -0,0 +1,8 @@ +{ + @metadata: { + authors: [ + Milicevic01 + ] + }, + collapsiblevector-collapsiblenav-more: Више језика +} -- To view, visit https://gerrit.wikimedia.org/r/176379 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b89b22776ac8cea1180e2f87fe6719bda416edd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollapsibleVector Gerrit-Branch: master Gerrit-Owner: Paladox thomasmulhall...@yahoo.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix i18n - change (mediawiki...CollapsibleVector)
Paladox has submitted this change and it was merged. Change subject: Fix i18n .. Fix i18n * Fixes directory to look for in i18n. Change-Id: I4b89b22776ac8cea1180e2f87fe6719bda416edd --- M CollapsibleVector.i18n.php 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Paladox: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/CollapsibleVector.i18n.php b/CollapsibleVector.i18n.php index 5eb3bcd..a5e726d 100644 --- a/CollapsibleVector.i18n.php +++ b/CollapsibleVector.i18n.php @@ -15,7 +15,7 @@ function wfJsonI18nShim838dd91d281628a2( $cache, $code, $cachedData ) { $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . /./i18n/$csCode.json; + $fileName = dirname( __FILE__ ) . /i18n/$csCode.json; if ( is_readable( $fileName ) ) { $data = FormatJson::decode( file_get_contents( $fileName ), true ); foreach ( array_keys( $data ) as $key ) { @@ -32,4 +32,4 @@ } $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim838dd91d281628a2'; -} +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/176379 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4b89b22776ac8cea1180e2f87fe6719bda416edd Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CollapsibleVector Gerrit-Branch: master Gerrit-Owner: Paladox thomasmulhall...@yahoo.com Gerrit-Reviewer: Paladox thomasmulhall...@yahoo.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix i18n - change (mediawiki...CollapsibleVector)
Paladox has submitted this change and it was merged. Change subject: Fix i18n .. Fix i18n * Fixes directory to look for in i18n. Change-Id: I4b89b22776ac8cea1180e2f87fe6719bda416edd (cherry picked from commit b918293a01d3b17d083d555dce46624122d73458) --- M CollapsibleVector.i18n.php 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Paladox: Verified; Looks good to me, approved diff --git a/CollapsibleVector.i18n.php b/CollapsibleVector.i18n.php index 5eb3bcd..a5e726d 100644 --- a/CollapsibleVector.i18n.php +++ b/CollapsibleVector.i18n.php @@ -15,7 +15,7 @@ function wfJsonI18nShim838dd91d281628a2( $cache, $code, $cachedData ) { $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . /./i18n/$csCode.json; + $fileName = dirname( __FILE__ ) . /i18n/$csCode.json; if ( is_readable( $fileName ) ) { $data = FormatJson::decode( file_get_contents( $fileName ), true ); foreach ( array_keys( $data ) as $key ) { @@ -32,4 +32,4 @@ } $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim838dd91d281628a2'; -} +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/176380 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4b89b22776ac8cea1180e2f87fe6719bda416edd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollapsibleVector Gerrit-Branch: REL1_24 Gerrit-Owner: Paladox thomasmulhall...@yahoo.com Gerrit-Reviewer: Paladox thomasmulhall...@yahoo.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix i18n - change (mediawiki...CollapsibleVector)
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/176380 Change subject: Fix i18n .. Fix i18n * Fixes directory to look for in i18n. Change-Id: I4b89b22776ac8cea1180e2f87fe6719bda416edd (cherry picked from commit b918293a01d3b17d083d555dce46624122d73458) --- M CollapsibleVector.i18n.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollapsibleVector refs/changes/80/176380/1 diff --git a/CollapsibleVector.i18n.php b/CollapsibleVector.i18n.php index 5eb3bcd..a5e726d 100644 --- a/CollapsibleVector.i18n.php +++ b/CollapsibleVector.i18n.php @@ -15,7 +15,7 @@ function wfJsonI18nShim838dd91d281628a2( $cache, $code, $cachedData ) { $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . /./i18n/$csCode.json; + $fileName = dirname( __FILE__ ) . /i18n/$csCode.json; if ( is_readable( $fileName ) ) { $data = FormatJson::decode( file_get_contents( $fileName ), true ); foreach ( array_keys( $data ) as $key ) { @@ -32,4 +32,4 @@ } $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim838dd91d281628a2'; -} +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/176380 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b89b22776ac8cea1180e2f87fe6719bda416edd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollapsibleVector Gerrit-Branch: REL1_24 Gerrit-Owner: Paladox thomasmulhall...@yahoo.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Sanitize wikibase-item html formatting - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Sanitize wikibase-item html formatting .. Sanitize wikibase-item html formatting And don't assume Title == serialization if we don't have an EntityTitleLookup. Change-Id: I82b90f8a8cad8f7b65a0c7a26d76611be7fb1f25 --- M lib/includes/formatters/EntityIdHtmlLinkFormatter.php M lib/includes/formatters/WikibaseValueFormatterBuilders.php M lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php 3 files changed, 74 insertions(+), 21 deletions(-) Approvals: Daniel Kinzler: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php index b4f5210..0b655c7 100644 --- a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php +++ b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php @@ -22,14 +22,14 @@ class EntityIdHtmlLinkFormatter extends EntityIdLabelFormatter { /** -* @var EntityTitleLookup|null +* @var EntityTitleLookup */ protected $entityTitleLookup; public function __construct( FormatterOptions $options, LabelLookup $labelLookup, - EntityTitleLookup $entityTitleLookup = null + EntityTitleLookup $entityTitleLookup ) { parent::__construct( $options, $labelLookup ); @@ -44,11 +44,8 @@ * @return string */ protected function formatEntityId( EntityId $entityId ) { - if ( isset( $this-entityTitleLookup ) ) { - $title = $this-entityTitleLookup-getTitleForId( $entityId ); - } else { - $title = Title::newFromText( $entityId-getSerialization() ); - } + $title = $this-entityTitleLookup-getTitleForId( $entityId ); + $attributes = array( 'title' = $title-getPrefixedText(), 'href' = $title-getLocalURL() diff --git a/lib/includes/formatters/WikibaseValueFormatterBuilders.php b/lib/includes/formatters/WikibaseValueFormatterBuilders.php index 734f8c5..4c93676 100644 --- a/lib/includes/formatters/WikibaseValueFormatterBuilders.php +++ b/lib/includes/formatters/WikibaseValueFormatterBuilders.php @@ -93,7 +93,7 @@ SnakFormatter::FORMAT_HTML = array( 'PT:url' = 'Wikibase\Lib\HtmlUrlFormatter', 'PT:commonsMedia' = 'Wikibase\Lib\CommonsLinkFormatter', - 'PT:wikibase-item' = array( 'this', 'newEntityIdHtmlLinkFormatter' ), + 'PT:wikibase-item' = array( 'this', 'newEntityIdHtmlFormatter' ), 'VT:time' = array( 'this', 'newHtmlTimeFormatter' ), 'VT:monolingualtext' = 'Wikibase\Formatters\MonolingualHtmlFormatter', ), @@ -558,14 +558,19 @@ * * @param FormatterOptions $options * -* @return EntityIdHtmlLinkFormatter +* @return ValueFormatter */ - private function newEntityIdHtmlLinkFormatter( FormatterOptions $options ) { - return new EntityIdHtmlLinkFormatter( - $options, - $this-newLabelLookup( $options ), - $this-entityTitleLookup - ); + private function newEntityIdHtmlFormatter( FormatterOptions $options ) { + $labelLookup = $this-newLabelLookup( $options ); + + if ( !$this-entityTitleLookup ) { + return new EscapingValueFormatter( + new EntityIdLabelFormatter( $options, $labelLookup ), + 'htmlspecialchars' + ); + } + + return new EntityIdHtmlLinkFormatter( $options, $labelLookup, $this-entityTitleLookup ); } /** diff --git a/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php b/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php index 4fe740f..20eb09b 100644 --- a/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php +++ b/lib/tests/phpunit/formatters/WikibaseValueFormatterBuildersTest.php @@ -2,11 +2,12 @@ namespace Wikibase\Lib\Test; +use Language; +use Title; use DataValues\MonolingualTextValue; use DataValues\QuantityValue; use DataValues\StringValue; use DataValues\TimeValue; -use Language; use ValueFormatters\FormatterOptions; use ValueFormatters\StringFormatter; use ValueFormatters\TimeFormatter; @@ -14,12 +15,12 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityIdValue; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\LanguageFallbackChain; use Wikibase\LanguageFallbackChainFactory; use Wikibase\Lib\EntityIdFormatter; use
[MediaWiki-commits] [Gerrit] Trigger tests for EditAccount - change (integration/config)
jenkins-bot has submitted this change and it was merged. Change subject: Trigger tests for EditAccount .. Trigger tests for EditAccount Change-Id: I81bfa768c851cf924b32cc051d0c6ff736e32ae2 --- M jjb/mediawiki-extensions.yaml M zuul/layout.yaml 2 files changed, 5 insertions(+), 0 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/jjb/mediawiki-extensions.yaml b/jjb/mediawiki-extensions.yaml index a9d57c6..55fdfc9 100644 --- a/jjb/mediawiki-extensions.yaml +++ b/jjb/mediawiki-extensions.yaml @@ -487,6 +487,7 @@ - DynamicSidebar - E3Experiments - Echo + - EditAccount - Editcount - EditPageTracking - EditSubpages diff --git a/zuul/layout.yaml b/zuul/layout.yaml index e52fb4f..a2d80ad 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -3131,6 +3131,10 @@ - name: extension-qunit - name: extension-rubylint + - name: mediawiki/extensions/EditAccount +template: + - name: extension-unittests + - name: mediawiki/extensions/Editcount template: - name: extension-unittests -- To view, visit https://gerrit.wikimedia.org/r/172276 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I81bfa768c851cf924b32cc051d0c6ff736e32ae2 Gerrit-PatchSet: 3 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Lewis Cawte le...@lewiscawte.me 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 Debian packaging. - change (mediawiki...tidy)
Ori.livneh has submitted this change and it was merged. Change subject: Add Debian packaging. .. Add Debian packaging. Change-Id: I27dcce8f49074e504b2ae323bf9458fc0996a94a --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/docs A debian/hhvm-tidy.substvars A debian/rules A debian/source/format 8 files changed, 158 insertions(+), 0 deletions(-) Approvals: Ori.livneh: Verified; Looks good to me, approved diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 000..94c1a68 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +hhvm-tidy (0.1-1) trusty-wikimedia; urgency=medium + + * Initial release. + + -- Ori Livneh o...@wikimedia.org Sat, 22 Nov 2014 03:38:29 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 000..a35907a --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: hhvm-tidy +Section: web +Priority: optional +Maintainer: Ori Livneh o...@wikimedia.org +Build-Depends: debhelper (= 9), hhvm-dev, cmake, libtidy-dev +Standards-Version: 3.9.5 + +Package: hhvm-tidy +Architecture: any +Depends: ${hhvm:ApiVersion}, libtidy-0.99-0 +Description: tidy module for HHVM + This is a HHVM extension based on Libtidy (http://tidy.sf.net). It allows + a PHP developer to clean, repair, and traverse HTML, XHTML and XML documents. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 000..21d5176 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,98 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: hhvm-tidy +Source: https://github.com/wikimedia/mediawiki-php-tidy + + +Files: * +Copyright: 1999 - 2014 The PHP Group + 2014 Tim Starling +License: PHP + + The PHP License, version 3.01 + Copyright (c) 1999 - 2010 The PHP Group. All rights reserved. + + . + Redistribution and use in source and binary forms, with or without + modification, is permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + . + 3. The name PHP must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact gr...@php.net. + . + 4. Products derived from this software may not be called PHP, nor + may PHP appear in their name, without prior written permission + from gr...@php.net. You may indicate that your software works in + conjunction with PHP by saying Foo for PHP instead of calling + it PHP Foo or phpfoo + . + 5. The PHP Group may publish revised and/or new versions of the + license from time to time. Each version will be given a + distinguishing version number. + Once covered code has been published under a particular version + of the license, you may always continue to use it under the terms + of that version. You may also choose to use such covered code + under the terms of any subsequent version of the license + published by the PHP Group. No one other than the PHP Group has + the right to modify the terms applicable to covered code created + under this License. + . + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + This product includes PHP software, freely available from + http://www.php.net/software/. + . + THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND + ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP + DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + . + + . + This software consists of voluntary contributions made by many
[MediaWiki-commits] [Gerrit] Update README.md - change (mediawiki...CollapsibleVector)
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/176381 Change subject: Update README.md .. Update README.md * Update README.md Change-Id: Iaf4fa1db0faf7936985ddd733341396644120b5b --- M CollapsibleVector.i18n.php M README.md 2 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollapsibleVector refs/changes/81/176381/1 diff --git a/CollapsibleVector.i18n.php b/CollapsibleVector.i18n.php index 5eb3bcd..a5e726d 100644 --- a/CollapsibleVector.i18n.php +++ b/CollapsibleVector.i18n.php @@ -15,7 +15,7 @@ function wfJsonI18nShim838dd91d281628a2( $cache, $code, $cachedData ) { $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . /./i18n/$csCode.json; + $fileName = dirname( __FILE__ ) . /i18n/$csCode.json; if ( is_readable( $fileName ) ) { $data = FormatJson::decode( file_get_contents( $fileName ), true ); foreach ( array_keys( $data ) as $key ) { @@ -32,4 +32,4 @@ } $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim838dd91d281628a2'; -} +} \ No newline at end of file diff --git a/README.md b/README.md index f4dc4ed..1120af1 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ CollapsibleVector = -# Vector provides enhancements to the Vector skin +Vector provides enhancements to the Vector skin -# This extension requires MediaWiki 1.24+. +This extension requires MediaWiki 1.24+. -# Example LocalSettings.php additions +Example LocalSettings.php additions require_once( $IP/extensions/CollapsibleVector/CollapsibleVector.php ); -# Before configuring this extension, see CollapsibleVector.php and become familiar with the initial state and structure of the -# $wgVectorFeatures configuration variable. Essentially it's an array of arrays, keyed by feature name, each containing -# global and user keys with boolean values. global indicates that it should be turned on for everyone always, while -# user indicates that users should be allowed to turn it on or off in their user preferences. +Before configuring this extension, see CollapsibleVector.php and become familiar with the initial state and structure of the +$wgVectorFeatures configuration variable. Essentially it's an array of arrays, keyed by feature name, each containing +global and user keys with boolean values. global indicates that it should be turned on for everyone always, while +user indicates that users should be allowed to turn it on or off in their user preferences. -# To enable a preference by default but still allow users to disable it in preferences, use something like... +To enable a preference by default but still allow users to disable it in preferences, use something like... $wgDefaultUserOptions['vector-collapsiblenav'] = 1; -- To view, visit https://gerrit.wikimedia.org/r/176381 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf4fa1db0faf7936985ddd733341396644120b5b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollapsibleVector Gerrit-Branch: master Gerrit-Owner: Paladox thomasmulhall...@yahoo.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update README.md - change (mediawiki...CollapsibleVector)
Paladox has submitted this change and it was merged. Change subject: Update README.md .. Update README.md * Update README.md Change-Id: Iaf4fa1db0faf7936985ddd733341396644120b5b --- M README.md 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Paladox: Verified; Looks good to me, approved diff --git a/README.md b/README.md index f4dc4ed..1120af1 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ CollapsibleVector = -# Vector provides enhancements to the Vector skin +Vector provides enhancements to the Vector skin -# This extension requires MediaWiki 1.24+. +This extension requires MediaWiki 1.24+. -# Example LocalSettings.php additions +Example LocalSettings.php additions require_once( $IP/extensions/CollapsibleVector/CollapsibleVector.php ); -# Before configuring this extension, see CollapsibleVector.php and become familiar with the initial state and structure of the -# $wgVectorFeatures configuration variable. Essentially it's an array of arrays, keyed by feature name, each containing -# global and user keys with boolean values. global indicates that it should be turned on for everyone always, while -# user indicates that users should be allowed to turn it on or off in their user preferences. +Before configuring this extension, see CollapsibleVector.php and become familiar with the initial state and structure of the +$wgVectorFeatures configuration variable. Essentially it's an array of arrays, keyed by feature name, each containing +global and user keys with boolean values. global indicates that it should be turned on for everyone always, while +user indicates that users should be allowed to turn it on or off in their user preferences. -# To enable a preference by default but still allow users to disable it in preferences, use something like... +To enable a preference by default but still allow users to disable it in preferences, use something like... $wgDefaultUserOptions['vector-collapsiblenav'] = 1; -- To view, visit https://gerrit.wikimedia.org/r/176381 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaf4fa1db0faf7936985ddd733341396644120b5b Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CollapsibleVector Gerrit-Branch: master Gerrit-Owner: Paladox thomasmulhall...@yahoo.com Gerrit-Reviewer: Paladox thomasmulhall...@yahoo.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 README.md - change (mediawiki...CollapsibleVector)
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/176382 Change subject: Update README.md .. Update README.md * Update README.md Change-Id: Iaf4fa1db0faf7936985ddd733341396644120b5b (cherry picked from commit 8ce6debd24cff59d9bad1982dd9d4f501de648fa) --- M README.md 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollapsibleVector refs/changes/82/176382/1 diff --git a/README.md b/README.md index f4dc4ed..1120af1 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ CollapsibleVector = -# Vector provides enhancements to the Vector skin +Vector provides enhancements to the Vector skin -# This extension requires MediaWiki 1.24+. +This extension requires MediaWiki 1.24+. -# Example LocalSettings.php additions +Example LocalSettings.php additions require_once( $IP/extensions/CollapsibleVector/CollapsibleVector.php ); -# Before configuring this extension, see CollapsibleVector.php and become familiar with the initial state and structure of the -# $wgVectorFeatures configuration variable. Essentially it's an array of arrays, keyed by feature name, each containing -# global and user keys with boolean values. global indicates that it should be turned on for everyone always, while -# user indicates that users should be allowed to turn it on or off in their user preferences. +Before configuring this extension, see CollapsibleVector.php and become familiar with the initial state and structure of the +$wgVectorFeatures configuration variable. Essentially it's an array of arrays, keyed by feature name, each containing +global and user keys with boolean values. global indicates that it should be turned on for everyone always, while +user indicates that users should be allowed to turn it on or off in their user preferences. -# To enable a preference by default but still allow users to disable it in preferences, use something like... +To enable a preference by default but still allow users to disable it in preferences, use something like... $wgDefaultUserOptions['vector-collapsiblenav'] = 1; -- To view, visit https://gerrit.wikimedia.org/r/176382 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf4fa1db0faf7936985ddd733341396644120b5b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollapsibleVector Gerrit-Branch: REL1_24 Gerrit-Owner: Paladox thomasmulhall...@yahoo.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update README.md - change (mediawiki...CollapsibleVector)
Paladox has submitted this change and it was merged. Change subject: Update README.md .. Update README.md * Update README.md Change-Id: Iaf4fa1db0faf7936985ddd733341396644120b5b (cherry picked from commit 8ce6debd24cff59d9bad1982dd9d4f501de648fa) --- M README.md 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Paladox: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/README.md b/README.md index f4dc4ed..1120af1 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ CollapsibleVector = -# Vector provides enhancements to the Vector skin +Vector provides enhancements to the Vector skin -# This extension requires MediaWiki 1.24+. +This extension requires MediaWiki 1.24+. -# Example LocalSettings.php additions +Example LocalSettings.php additions require_once( $IP/extensions/CollapsibleVector/CollapsibleVector.php ); -# Before configuring this extension, see CollapsibleVector.php and become familiar with the initial state and structure of the -# $wgVectorFeatures configuration variable. Essentially it's an array of arrays, keyed by feature name, each containing -# global and user keys with boolean values. global indicates that it should be turned on for everyone always, while -# user indicates that users should be allowed to turn it on or off in their user preferences. +Before configuring this extension, see CollapsibleVector.php and become familiar with the initial state and structure of the +$wgVectorFeatures configuration variable. Essentially it's an array of arrays, keyed by feature name, each containing +global and user keys with boolean values. global indicates that it should be turned on for everyone always, while +user indicates that users should be allowed to turn it on or off in their user preferences. -# To enable a preference by default but still allow users to disable it in preferences, use something like... +To enable a preference by default but still allow users to disable it in preferences, use something like... $wgDefaultUserOptions['vector-collapsiblenav'] = 1; -- To view, visit https://gerrit.wikimedia.org/r/176382 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaf4fa1db0faf7936985ddd733341396644120b5b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollapsibleVector Gerrit-Branch: REL1_24 Gerrit-Owner: Paladox thomasmulhall...@yahoo.com Gerrit-Reviewer: Paladox thomasmulhall...@yahoo.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] Make NoLangLinkHandler testable. - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Make NoLangLinkHandler testable. .. Make NoLangLinkHandler testable. Change-Id: I4b0a0a76d406beb93e23de6ba86948bf3fc00684 --- M client/includes/parserhooks/NoLangLinkHandler.php A client/tests/phpunit/includes/hooks/NoLangLinkHandlerTest.php 2 files changed, 86 insertions(+), 11 deletions(-) Approvals: JanZerebecki: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/parserhooks/NoLangLinkHandler.php b/client/includes/parserhooks/NoLangLinkHandler.php index 71619dd..ef5e1bc 100644 --- a/client/includes/parserhooks/NoLangLinkHandler.php +++ b/client/includes/parserhooks/NoLangLinkHandler.php @@ -19,6 +19,41 @@ class NoLangLinkHandler { /** +* @var NamespaceChecker +*/ + private $namespaceChecker; + + /** +* Parser function +* +* @since 0.4 +* +* @param \Parser $parser +* +* @return string +*/ + public static function handle( $parser ) { + $handler = self::newFromGlobalState(); + $handler-doHandle( $parser ); + } + + private static function newFromGlobalState() { + $wikibaseClient = WikibaseClient::getDefaultInstance(); + $settings = $wikibaseClient-getSettings(); + + $namespaceChecker = new NamespaceChecker( + $settings-getSetting( 'excludeNamespaces' ), + $settings-getSetting( 'namespaces' ) + ); + + return new NoLangLinkHandler( $namespaceChecker ); + } + + public function __construct( NamespaceChecker $namespaceChecker ) { + $this-namespaceChecker = $namespaceChecker; + } + + /** * Get the noexternallanglinks page property from the ParserOutput, * which is set by the {{#noexternallanglinks}} parser function. * @@ -49,22 +84,15 @@ /** * Parser function * -* @since 0.4 +* @since 0.5 * * @param \Parser $parser * * @return string */ - public static function handle( $parser ) { - $wikibaseClient = WikibaseClient::getDefaultInstance(); - $settings = $wikibaseClient-getSettings(); + public function doHandle( $parser ) { - $namespaceChecker = new NamespaceChecker( - $settings-getSetting( 'excludeNamespaces' ), - $settings-getSetting( 'namespaces' ) - ); - - if ( !$namespaceChecker-isWikibaseEnabled( $parser-getTitle()-getNamespace() ) ) { + if ( !$this-namespaceChecker-isWikibaseEnabled( $parser-getTitle()-getNamespace() ) ) { // shorten out return ''; } @@ -76,7 +104,7 @@ $output = $parser-getOutput(); $nel = array_merge( self::getNoExternalLangLinks( $output ), $langs ); - self::setNoExternalLangLinks( $output, $nel ); + $this-setNoExternalLangLinks( $output, $nel ); return ''; } diff --git a/client/tests/phpunit/includes/hooks/NoLangLinkHandlerTest.php b/client/tests/phpunit/includes/hooks/NoLangLinkHandlerTest.php new file mode 100644 index 000..973fa94 --- /dev/null +++ b/client/tests/phpunit/includes/hooks/NoLangLinkHandlerTest.php @@ -0,0 +1,47 @@ +?php + +namespace Wikibase\Client\Tests\Hooks; + +use Parser; +use ParserOptions; +use ParserOutput; +use Wikibase\NamespaceChecker; +use Wikibase\NoLangLinkHandler; + +/** + * @covers Wikibase\NoLangLinkHandler + * + * @group WikibaseClient + * @group HookHandler + * @group Wikibase + * + * @licence GNU GPL v2+ + * @author Daniel Kinzler + */ +class NoLangLinkHandlerTest extends \PHPUnit_Framework_TestCase { + + public function testGetSetNoExternalLangLinks() { + $pout = new ParserOutput(); + $list = array( 'xy', 'abc' ); + + NoLangLinkHandler::setNoExternalLangLinks( $pout, $list ); + $actual = NoLangLinkHandler::getNoExternalLangLinks( $pout ); + + $this-assertEquals( $list, $actual ); + } + + public function testDoHandle() { + $handler = new NoLangLinkHandler( new NamespaceChecker( array(), array() ) ); + $parser = new Parser(); + $parser-startExternalParse( null, new ParserOptions(), Parser::OT_HTML ); + + $handler-doHandle( $parser, 'en', 'fr' ); + $actual = NoLangLinkHandler::getNoExternalLangLinks( $parser-getOutput() ); + $this-assertEquals( array( 'en', 'fr' ), $actual ); + + $handler-doHandle( $parser, '*', 'zh' ); + $actual = NoLangLinkHandler::getNoExternalLangLinks(
[MediaWiki-commits] [Gerrit] Use HHVM+EZC internal tidy - change (mediawiki/core)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/176383 Change subject: Use HHVM+EZC internal tidy .. Use HHVM+EZC internal tidy EZC doesn't currently support direct access to object properties via the obj-std.properties hashtable, but tidy uses this extensively. But it turns out that for production use cases, tidy_repair_string() should be sufficient. $wgDebugTidy and $wgValidateAllHtml are not used, and no deployed extension calls MWTidy::checkErrors(). The only difference I know of is that errors from tidy (status==2) lead to the tidy output being used, rather than discarded. But TY_(ReportFatal) has very few callers in tidylib -- probably none that are reachable from stripped parser output. So, throw an exception if MWTidy::checkErrors() is requested on an HHVM instance with the tidy extension. For MWTidy::tidy(), use tidy_repair_string(). Refactor some relevant code. Bug: T758 Change-Id: I8d5b1c2c9f9ddce46d8ad099a671a2e297d256e0 (cherry picked from commit e6fdbfec472ec12655805089492e51bf6d29f86e) --- M includes/parser/MWTidy.php 1 file changed, 50 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/83/176383/1 diff --git a/includes/parser/MWTidy.php b/includes/parser/MWTidy.php index b310862..ff62e9b 100644 --- a/includes/parser/MWTidy.php +++ b/includes/parser/MWTidy.php @@ -127,17 +127,11 @@ * @return string Corrected HTML output */ public static function tidy( $text ) { - global $wgTidyInternal; - $wrapper = new MWTidyWrapper; $wrappedtext = $wrapper-getWrapped( $text ); $retVal = null; - if ( $wgTidyInternal ) { - $correctedtext = self::execInternalTidy( $wrappedtext, false, $retVal ); - } else { - $correctedtext = self::execExternalTidy( $wrappedtext, false, $retVal ); - } + $correctedtext = self::clean( $wrappedtext, false, $retVal ); if ( $retVal 0 ) { wfDebug( Possible tidy configuration error!\n ); @@ -160,16 +154,33 @@ * @return bool Whether the HTML is valid */ public static function checkErrors( $text, $errorStr = null ) { + $retval = 0; + $errorStr = self::clean( $text, true, $retval ); + return ( $retval 0 $errorStr == '' ) || $retval == 0; + } + + /** +* Perform a clean/repair operation +* @param string $text HTML to check +* @param bool $stderr Whether to read result from STDERR rather than STDOUT +* @param int $retval Exit code (-1 on internal error) +* @return string|null +*/ + private static function clean( $text, $stderr = false, $retval = null ) { global $wgTidyInternal; - $retval = 0; if ( $wgTidyInternal ) { - $errorStr = self::execInternalTidy( $text, true, $retval ); + if ( wfIsHHVM() ) { + if ( $stderr ) { + throw new MWException( __METHOD__.: error text return from HHVM tidy is not supported ); + } + return self::hhvmClean( $text, $retval ); + } else { + return self::phpClean( $text, $stderr, $retval ); + } } else { - $errorStr = self::execExternalTidy( $text, true, $retval ); + return self::externalClean( $text, $stderr, $retval ); } - - return ( $retval 0 $errorStr == '' ) || $retval == 0; } /** @@ -181,7 +192,7 @@ * @param int $retval Exit code (-1 on internal error) * @return string|null */ - private static function execExternalTidy( $text, $stderr = false, $retval = null ) { + private static function externalClean( $text, $stderr = false, $retval = null ) { global $wgTidyConf, $wgTidyBin, $wgTidyOpts; wfProfileIn( __METHOD__ ); @@ -248,7 +259,7 @@ * @param int $retval Exit code (-1 on internal error) * @return string|null */ - private static function execInternalTidy( $text, $stderr = false, $retval = null ) { + private static function phpClean( $text, $stderr = false, $retval = null ) { global $wgTidyConf, $wgDebugTidy; wfProfileIn( __METHOD__ ); @@ -288,4 +299,29 @@ wfProfileOut( __METHOD__ ); return $cleansource; } + + /** +* Use the tidy extension for HHVM from +* https://github.com/wikimedia/mediawiki-php-tidy +* +