[MediaWiki-commits] [Gerrit] mediawiki/core[master]: action=history should return 404 if no such page
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/312561 Change subject: action=history should return 404 if no such page .. action=history should return 404 if no such page Bug: T146496 Change-Id: I158aae3633db56d432f772ee0aa22c39fd6dc7e5 --- M includes/actions/HistoryAction.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/61/312561/1 diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index f3ef3b3..50415b2 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -139,6 +139,7 @@ // Fail nicely if article doesn't exist. if ( !$this->page->exists() ) { + $out->setStatusCode( 404 ); $out->addWikiMsg( 'nohistory' ); # show deletion/move log if there is an entry LogEventsList::showLogExtract( -- To view, visit https://gerrit.wikimedia.org/r/312561 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I158aae3633db56d432f772ee0aa22c39fd6dc7e5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Graph[master]: Restore wordcloud vega plugin
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/311363 Change subject: Restore wordcloud vega plugin .. Restore wordcloud vega plugin wordcloud support has been restored in vega by https://github.com/vega/vega/pull/317 Fixes https://phabricator.wikimedia.org/T16 Fixes https://phabricator.wikimedia.org/T100642 Change-Id: Iffdf231e4bb82b12691d72a7bb1e819767959547 --- M extension.json A lib/d3.layout.cloud.js 2 files changed, 506 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Graph refs/changes/63/311363/1 diff --git a/extension.json b/extension.json index 028bfee..336b229 100644 --- a/extension.json +++ b/extension.json @@ -70,6 +70,7 @@ "scripts": [ "lib/d3.js", "lib/d3-global.js", + "lib/d3.layout.cloud.js", "lib/vega2/vega.js", "lib/graph2.compiled.js" ], diff --git a/lib/d3.layout.cloud.js b/lib/d3.layout.cloud.js new file mode 100644 index 000..8165a41 --- /dev/null +++ b/lib/d3.layout.cloud.js @@ -0,0 +1,505 @@ +(function(f){if(typeof exports==="object"& module!=="undefined"){module.exports=f()}else if(typeof define==="function"&){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g=(g.d3||(g.d3 = {}));g=(g.layout||(g.layout = {}));g.cloud = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&if(!u&)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&for(var o=0;o> 5, +ch = 1 << 11; + +module.exports = function() { + var size = [256, 256], + text = cloudText, + font = cloudFont, + fontSize = cloudFontSize, + fontStyle = cloudFontNormal, + fontWeight = cloudFontNormal, + rotate = cloudRotate, + padding = cloudPadding, + spiral = archimedeanSpiral, + words = [], + timeInterval = Infinity, + event = dispatch("word", "end"), + timer = null, + random = Math.random, + cloud = {}, + canvas = cloudCanvas; + + cloud.canvas = function(_) { +return arguments.length ? (canvas = functor(_), cloud) : canvas; + }; + + cloud.start = function() { +var contextAndRatio = getContext(canvas()), +board = zeroArray((size[0] >> 5) * size[1]), +bounds = null, +n = words.length, +i = -1, +tags = [], +data = words.map(function(d, i) { + d.text = text.call(this, d, i); + d.font = font.call(this, d, i); + d.style = fontStyle.call(this, d, i); + d.weight = fontWeight.call(this, d, i); + d.rotate = rotate.call(this, d, i); + d.size = ~~fontSize.call(this, d, i); + d.padding = padding.call(this, d, i); + return d; +}).sort(function(a, b) { return b.size - a.size; }); + +if (timer) clearInterval(timer); +timer = setInterval(step, 0); +step(); + +return cloud; + +function step() { + var start = Date.now(); + while (Date.now() - start < timeInterval && ++i < n && timer) { +var d = data[i]; +d.x = (size[0] * (random() + .5)) >> 1; +d.y = (size[1] * (random() + .5)) >> 1; +cloudSprite(contextAndRatio, d, data, i); +if (d.hasText && place(board, d, bounds)) { + tags.push(d); + event.word(d); + if (bounds) cloudBounds(bounds, d); + else bounds = [{x: d.x + d.x0, y: d.y + d.y0}, {x: d.x + d.x1, y: d.y + d.y1}]; + // Temporary hack + d.x -= size[0] >> 1; + d.y -= size[1] >> 1; +} + } + if (i >= n) { +cloud.stop(); +event.end(tags, bounds); + } +} + } + + cloud.stop = function() { +if (timer) { + clearInterval(timer); + timer = null; +} +return cloud; + }; + + function getContext(canvas) { +canvas.width = canvas.height = 1; +var ratio = Math.sqrt(canvas.getContext("2d").getImageData(0, 0, 1, 1).data.length >> 2); +canvas.width = (cw << 5) / ratio; +canvas.height = ch / ratio; + +
[MediaWiki-commits] [Gerrit] Add SQLite Support to LDAP Authentication extension - change (mediawiki...LdapAuthentication)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/262707 Change subject: Add SQLite Support to LDAP Authentication extension .. Add SQLite Support to LDAP Authentication extension Bug: T108355 Change-Id: Ie142ae60637d85e3829f3f7e189388be23e4c4ca --- M LdapAuthentication.php A schema/ldap-sqlite.sql 2 files changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LdapAuthentication refs/changes/07/262707/1 diff --git a/LdapAuthentication.php b/LdapAuthentication.php index 44e47d4..f306138 100644 --- a/LdapAuthentication.php +++ b/LdapAuthentication.php @@ -107,6 +107,9 @@ case 'postgres': $updater->addExtensionTable( 'ldap_domains', "$base/schema/ldap-postgres.sql" ); break; + case 'sqlite': + $updater->addExtensionTable( 'ldap_domains', "$base/schema/ldap-sqlite.sql" ); + break; } return true; } diff --git a/schema/ldap-sqlite.sql b/schema/ldap-sqlite.sql new file mode 100644 index 000..0193935 --- /dev/null +++ b/schema/ldap-sqlite.sql @@ -0,0 +1,13 @@ +CREATE TABLE /*_*/ldap_domains ( + -- IF for domain + domain_id INTEGER PRIMARY KEY AUTOINCREMENT, + + -- domain itself + domain TEXT, + + -- User to which this domain belongs + user_id TEXT + +) /*$wgDBTableOptions*/; + +CREATE INDEX /*i*/user_id on /*_*/ldap_domains (user_id); -- To view, visit https://gerrit.wikimedia.org/r/262707 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie142ae60637d85e3829f3f7e189388be23e4c4ca Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LdapAuthentication Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Non-destructive migration, allow update on 1.24. - change (mediawiki...HitCounters)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/260173 Change subject: Non-destructive migration, allow update on 1.24. .. Non-destructive migration, allow update on 1.24. Allow old-style registration and update on 1.24 - just run the updater, anticipating 1.25+ core upgrade. Change-Id: I17cc6fa601d2921d539303a06ea90b7c294c690c --- M HCUpdater.php M HitCounters.hooks.php M HitCounters.php M README.md R create_hit_counter.sql R create_hit_counter_extension.sql D drop_field.sql M extension.json A migrate_hitcounter.sql A migrate_page_counter.sql D rename_table.sql 11 files changed, 47 insertions(+), 32 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/HitCounters refs/changes/73/260173/1 diff --git a/HCUpdater.php b/HCUpdater.php index 331f2fa..f2cf3ac 100644 --- a/HCUpdater.php +++ b/HCUpdater.php @@ -6,19 +6,21 @@ use Installer; use MWException; -/* hack to get at protected member */ +// hack to get at protected member class HCUpdater extends DatabaseUpdater { public static function getDBUpdates ( DatabaseUpdater $updater ) { - /* This is an ugly abuse to rename a table. */ + // This is an ugly abuse to rename a table. $updater->modifyExtensionField( 'hitcounter', 'hc_id', - __DIR__ . '/rename_table.sql' ); - $updater->addExtensionTable( 'hit_counter_extension', - __DIR__ . '/hit_counter_extension.sql', true ); + __DIR__ . '/migrate_hitcounter.sql' ); $updater->addExtensionTable( 'hit_counter', - __DIR__ . '/page_counter.sql', true ); - $updater->dropExtensionField( 'page', 'page_counter', - __DIR__ . '/drop_field.sql' ); + __DIR__ . '/migrate_page_counter.sql' ); + +# If we couldn't migrate, try to create + $updater->addExtensionTable( 'hit_counter_extension', + __DIR__ . '/create_hit_counter_extension.sql', true ); + $updater->addExtensionTable( 'hit_counter', + __DIR__ . '/create_hit_counter.sql', true ); } public function clearExtensionUpdates() { @@ -44,4 +46,9 @@ } } + public static function onLoadExtensionSchemaUpdates( + DatabaseUpdater $updater + ) { + HCUpdater::getDBUpdates( $updater ); + } } diff --git a/HitCounters.hooks.php b/HitCounters.hooks.php index f38e388..7af3294 100644 --- a/HitCounters.hooks.php +++ b/HitCounters.hooks.php @@ -29,12 +29,6 @@ $specialPages['PopularPages'] = 'HitCounters\SpecialPopularPages'; } - public static function onLoadExtensionSchemaUpdates( - DatabaseUpdater $updater - ) { - HCUpdater::getDBUpdates( $updater ); - } - public static function onSpecialStatsAddExtra( array &$extraStats, RequestContext $statsPage ) { diff --git a/HitCounters.php b/HitCounters.php index 706aab4..ae05e40 100644 --- a/HitCounters.php +++ b/HitCounters.php @@ -11,7 +11,7 @@ * @copyright 2015 Mark A. Hershberger * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 *(or later) - * @version GIT: 0.3 + * @version GIT: 0.4 * @link https://www.mediawiki.org/wiki/Extension:HitCounters */ @@ -35,9 +35,10 @@ * @file */ -call_user_func( - function () { - if ( function_exists( 'wfLoadExtension' ) ) { + +if ( function_exists( 'wfLoadExtension' ) ) { +call_user_func( +function () { wfLoadExtension( 'HitCounters' ); wfWarn( 'Deprecated PHP entry point used for HitCounters extension. ' . @@ -46,8 +47,9 @@ 'for more details.' ); return; - } else { - die( 'This extension requires MediaWiki 1.25+' ); - } - } -); +}); +} else { +global $wgAutoloadClasses, $wgHooks; +$wgAutoloadClasses['HitCounters\\HCUpdater'] = __DIR__ . '/HCUpdater.php'; +$wgHooks['LoadExtensionSchemaUpdates'][] = 'HitCounters\\HCUpdater::onLoadExtensionSchemaUpdates'; +} diff --git a/README.md b/README.md index 61337bb..047dade 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,19 @@ If you wish to continue using the HitCounter's despite the flawed implementation, this extension should help. -Note that some steps will be needed to maintain you current hit -count. When those steps are understood, they'll be documented. +== Migrating page counters == +This extension can be installed first on the 1.24 (or older) +in order to migrate
[MediaWiki-commits] [Gerrit] We are Metrolook, not metrolook. - change (mediawiki...Metrolook)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/259465 Change subject: We are Metrolook, not metrolook. .. We are Metrolook, not metrolook. Bug: T117856 Change-Id: I912f03e2a700cfaee9c51a0b272d918c6d8c6ae4 --- M composer.json 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Metrolook refs/changes/65/259465/1 diff --git a/composer.json b/composer.json index 48b2701..24f7aae 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,9 @@ "source": "https://git.wikimedia.org/summary/mediawiki%2Fskins%2FMetrolook;, "irc": "irc://irc.freenode.org/mediawiki" }, + "extra": { + "installer-name": "Metrolook" + }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.*", "mediawiki/mediawiki-codesniffer": "0.5.0" -- To view, visit https://gerrit.wikimedia.org/r/259465 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I912f03e2a700cfaee9c51a0b272d918c6d8c6ae4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Metrolook Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] We are Vector, not vector - change (mediawiki...Vector)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/259462 Change subject: We are Vector, not vector .. We are Vector, not vector Bug: T121490 Bug: T117856 Change-Id: Icfcefa5b460119963aebbbe980f31fce3c95a6a0 --- M composer.json 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector refs/changes/62/259462/1 diff --git a/composer.json b/composer.json index e7df596..9d17a40 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,8 @@ "extra": { "branch-alias": { "dev-master": "1.x-dev" - } + }, + "installer-name": "Vector" }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.*", -- To view, visit https://gerrit.wikimedia.org/r/259462 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icfcefa5b460119963aebbbe980f31fce3c95a6a0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Vector Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] We are Slate, not slate. - change (mediawiki...Slate)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/259463 Change subject: We are Slate, not slate. .. We are Slate, not slate. Bug: T117856 Change-Id: I4db443e52c3e8bfe199e0115209ab2aff5bdda24 --- M composer.json 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Slate refs/changes/63/259463/1 diff --git a/composer.json b/composer.json index 311e335..d5b5e8e 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,9 @@ "extra" : { "branch-alias": { "dev-master": "1.x-dev" - } + }, + "installer-name": "Slate" + }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.*", -- To view, visit https://gerrit.wikimedia.org/r/259463 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4db443e52c3e8bfe199e0115209ab2aff5bdda24 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Slate Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Load ext.semanticforms.wikieditor using the bottom queue - change (mediawiki...SemanticForms)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/259270 Change subject: Load ext.semanticforms.wikieditor using the bottom queue .. Load ext.semanticforms.wikieditor using the bottom queue The module will be loaded after the page content. Change-Id: I6449e47b0f88bcebdca09a061dce7c9b2eb33b5a --- M includes/SF_Utils.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms refs/changes/70/259270/1 diff --git a/includes/SF_Utils.php b/includes/SF_Utils.php index c06e9a7..3685ffb 100644 --- a/includes/SF_Utils.php +++ b/includes/SF_Utils.php @@ -1310,6 +1310,7 @@ 'remoteExtPath' => 'SemanticForms', 'scripts' => 'libs/SF_wikieditor.js', 'styles' => 'skins/SF_wikieditor.css', + 'position' => 'bottom', 'dependencies' => array( 'ext.semanticforms.main', 'jquery.wikiEditor', -- To view, visit https://gerrit.wikimedia.org/r/259270 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6449e47b0f88bcebdca09a061dce7c9b2eb33b5a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticForms Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Redefine HitCounters magic words - change (mediawiki...HitCounters)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/254646 Change subject: Redefine HitCounters magic words .. Redefine HitCounters magic words {{NUMBEROFVIEWS}} is now the total number of visits to the site, as it was before this extensions got extracted from the MediaWiki core {{NUMBEROFPAGEVIEWS}} is a new magic words that provides number of visits to the page, as presented in the page's footer. This is what {{NUMBEROFVIEWS}} presented in the earlier versions of this extension. Bump extension version to 0.3 Bug: T105862 Change-Id: Ie2ce867643a465b58272a09bf3abedc3b5947e34 --- M HitCounters.body.php M HitCounters.hooks.php M HitCounters.i18n.magic.php M HitCounters.php M extension.json 5 files changed, 39 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/HitCounters refs/changes/46/254646/1 diff --git a/HitCounters.body.php b/HitCounters.body.php index cba4fc7..f938f67 100644 --- a/HitCounters.body.php +++ b/HitCounters.body.php @@ -88,6 +88,9 @@ } /** +* +* {{NUMBEROFVIEWS}} - number of total views of the site +* * We can't choose our parameters since this is a hook and we * don't really need to use the $parser and $cache parameters. * @@ -96,6 +99,17 @@ public static function numberOfViews( Parser &$parser, PPFrame $frame, $args ) { + return self::views( ); + } + + /* +* {{NUMBEROFPAGEVIEWS}} - number of total views of the page +* +* @SuppressWarnings(PHPMD.UnusedFormalParameter) +*/ + public static function numberOfPageViews( + Parser &$parser, PPFrame $frame, $args + ) { return self::getCount( $frame->title ); } diff --git a/HitCounters.hooks.php b/HitCounters.hooks.php index bf0d594..f38e388 100644 --- a/HitCounters.hooks.php +++ b/HitCounters.hooks.php @@ -79,13 +79,21 @@ return $ret; } + protected static function getMagicWords() { + return array( + 'numberofviews' => array( 'HitCounters\HitCounters', 'numberOfViews' ), + 'numberofpageviews' => array( 'HitCounters\HitCounters', 'numberOfPageViews' ) + ); + } + public static function onMagicWordwgVariableIDs( array &$variableIDs ) { - $variableIDs[] = 'numberofviews'; + $variableIDs = array_merge( $variableIDs, array_keys( self::getMagicWords() ) ); } public static function onParserFirstCallInit( Parser $parser ) { - $parser->setFunctionHook( 'numberofviews', 'HitCounters:numberOfViews', - Parser::SFH_OBJECT_ARGS ); + foreach( self::getMagicWords() as $magicWord => $processingFunction ) + $parser->setFunctionHook( $magicWord, $processingFunction, + Parser::SFH_OBJECT_ARGS ); return true; } @@ -93,11 +101,16 @@ array $cache, &$magicWordId, &$ret, PPFrame &$frame ) { global $wgDisableCounters; - if ( !$wgDisableCounters && $magicWordId === 'numberofviews' ) { - $ret = CoreParserFunctions::formatRaw( - HitCounters::numberOfViews( $parser, $frame, null ), null ); - } elseif ( $wgDisableCounters && $magicWordId === 'numberofviews' ) { - wfDebugLog( 'HitCounters', 'Counters are disabled!' ); + foreach( self::getMagicWords() as $magicWord => $processingFunction ) { + if ( $magicWord === $magicWordId ) { + if ( !$wgDisableCounters ) { + $ret = CoreParserFunctions::formatRaw( + call_user_func( $processingFunction, $parser, $frame, null ), null ); + return true; + } else { + wfDebugLog( 'HitCounters', 'Counters are disabled!' ); + } + } } return true; } diff --git a/HitCounters.i18n.magic.php b/HitCounters.i18n.magic.php index 3180fbc..dde1174 100644 --- a/HitCounters.i18n.magic.php +++ b/HitCounters.i18n.magic.php @@ -8,6 +8,7 @@ /** English (English) */ $magicWords['en'] = array( 'numberofviews' => array( 0, 'NUMBEROFVIEWS' ), + 'numberofpageviews' => array( 0, 'NUMBEROFPAGEVIEWS' ), ); /** Egyptian Arabic (مصرى) */ @@ -163,4 +164,4 @@ /** Vietnamese (Tiếng Việt) */ $magicWords['vi'] = array( 'numberofviews' => array( 0, 'SỐ_LẦN_XEM', 'SỐLẦNXEM' ), -); \ No newline at end of file +); diff --git
[MediaWiki-commits] [Gerrit] $wgUsersNotifiedOnAllChanges should not send mail twice - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/250435 Change subject: $wgUsersNotifiedOnAllChanges should not send mail twice .. $wgUsersNotifiedOnAllChanges should not send mail twice Bug: T69041 Change-Id: I9b4902a4b9965933203de01ec93d67bfcece7759 --- M includes/mail/EmailNotification.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/35/250435/1 diff --git a/includes/mail/EmailNotification.php b/includes/mail/EmailNotification.php index 044bb53..5665f4d 100644 --- a/includes/mail/EmailNotification.php +++ b/includes/mail/EmailNotification.php @@ -218,6 +218,7 @@ # we use $wgPasswordSender as sender's address global $wgEnotifWatchlist, $wgBlockDisablesLogin; global $wgEnotifMinorEdits, $wgEnotifUserTalk; + global $wgUsersNotifiedOnAllChanges; # The following code is only run, if several conditions are met: # 1. EmailNotification for pages (other than user_talk pages) must be enabled @@ -262,6 +263,7 @@ && ( !$minorEdit || $watchingUser->getOption( 'enotifminoredits' ) ) && $watchingUser->isEmailConfirmed() && $watchingUser->getID() != $userTalkId + && !in_array( $watchingUser->getName(), $wgUsersNotifiedOnAllChanges ) && !( $wgBlockDisablesLogin && $watchingUser->isBlocked() ) ) { if ( Hooks::run( 'SendWatchlistEmailNotification', array( $watchingUser, $title, $this ) ) ) { @@ -272,7 +274,6 @@ } } - global $wgUsersNotifiedOnAllChanges; foreach ( $wgUsersNotifiedOnAllChanges as $name ) { if ( $editor->getName() == $name ) { // No point notifying the user that actually made the change! -- To view, visit https://gerrit.wikimedia.org/r/250435 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b4902a4b9965933203de01ec93d67bfcece7759 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove search preferences from Special:Preferences JavaScript - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/250271 Change subject: Remove search preferences from Special:Preferences JavaScript .. Remove search preferences from Special:Preferences JavaScript Search preferences are now handled by Special:Search, not by Special:Preferences Bug: T54817 Change-Id: I8faabbed190a46397b35f630c031fc1b4bb6e3e1 --- M resources/src/mediawiki.special/mediawiki.special.preferences.js 1 file changed, 0 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/71/250271/1 diff --git a/resources/src/mediawiki.special/mediawiki.special.preferences.js b/resources/src/mediawiki.special/mediawiki.special.preferences.js index 0fda3dc..c8fbb2b 100644 --- a/resources/src/mediawiki.special/mediawiki.special.preferences.js +++ b/resources/src/mediawiki.special/mediawiki.special.preferences.js @@ -281,16 +281,6 @@ } ); } - // To disable all 'namespace' checkboxes in Search preferences - // when 'Search in all namespaces' checkbox is ticked. - $checkBoxes = $( '#mw-htmlform-advancedsearchoptions input[id^=mw-input-wpsearchnamespaces]' ); - if ( $( '#mw-input-wpsearcheverything' ).prop( 'checked' ) ) { - $checkBoxes.prop( 'disabled', true ); - } - $( '#mw-input-wpsearcheverything' ).change( function () { - $checkBoxes.prop( 'disabled', $( this ).prop( 'checked' ) ); - } ); - // Set up a message to notify users if they try to leave the page without // saving. $( '#mw-prefs-form' ).data( 'origdata', $( '#mw-prefs-form' ).serialize() ); -- To view, visit https://gerrit.wikimedia.org/r/250271 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8faabbed190a46397b35f630c031fc1b4bb6e3e1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Expose links to prefernces sections - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/249565 Change subject: Expose links to prefernces sections .. Expose links to prefernces sections Convert legends of various preferences sections to clickable links, thus exposing element IDs for linking. This is very helpful in pointing other users down to the very preference they need. Bug: T78232 Change-Id: I3fb33070255e3697883af460f3457ad1957d61e1 --- M includes/Preferences.php M includes/Xml.php M includes/htmlform/HTMLForm.php 3 files changed, 21 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/65/249565/1 diff --git a/includes/Preferences.php b/includes/Preferences.php index 0f8dcc3..1a49028 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1641,7 +1641,8 @@ * @return string */ function getBody() { - return $this->displaySection( $this->mFieldTree, '', 'mw-prefsection-' ); + $subsectionHasVisibleFields = false; + return $this->displaySection( $this->mFieldTree, '', 'mw-prefsection-', $subsectionHasVisibleFields, true ); } /** diff --git a/includes/Xml.php b/includes/Xml.php index 11f14db..e6d1b19 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -572,14 +572,25 @@ * @param string $content Pre-escaped content for the fieldset. If false, * only open fieldset is returned. * @param array $attribs Any attributes to fieldset-element. +* @param bool $linkLegend True if the legend tag should link to the fieldset id * * @return string */ - public static function fieldset( $legend = false, $content = false, $attribs = array() ) { + public static function fieldset( $legend = false, $content = false, $attribs = array(), $linkLegend = false ) { $s = Xml::openElement( 'fieldset', $attribs ) . "\n"; if ( $legend ) { - $s .= Xml::element( 'legend', null, $legend ) . "\n"; + if ( $linkLegend && $attribs[ 'id' ] ) { + $legend = Xml::element( 'a', + array( 'href' => '#' . $attribs[ 'id' ], 'class' => 'mw-legend-link' ), + $legend + ); + $s .= Xml::tags( 'legend', null, $legend ); + } else { + $s .= Xml::element( 'legend', null, $legend ); + } + + $s .= "\n"; } if ( $content !== false ) { diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index e51620f..a963317 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -1369,13 +1369,15 @@ * @param string $fieldsetIDPrefix ID prefix for the "" tag of * each subsection, ignored if empty. * @param bool &$hasUserVisibleFields Whether the section had user-visible fields. +* @param bool $linkLegend Whether section legends should be linked to the form element IDs * * @return string */ public function displaySection( $fields, $sectionName = '', $fieldsetIDPrefix = '', - &$hasUserVisibleFields = false ) { + &$hasUserVisibleFields = false, + $linkLegend = false ) { $displayFormat = $this->getDisplayFormat(); $html = array(); @@ -1408,7 +1410,8 @@ $this->displaySection( $value, "mw-htmlform-$key", "$fieldsetIDPrefix$key-", - $subsectionHasVisibleFields ); + $subsectionHasVisibleFields, + $linkLegend ); $legend = null; if ( $subsectionHasVisibleFields === true ) { @@ -1425,7 +1428,7 @@ if ( $fieldsetIDPrefix ) { $attributes['id'] = Sanitizer::escapeId( "$fieldsetIDPrefix$key" ); } - $subsectionHtml .= Xml::fieldset( $legend, $section, $attributes ) . "\n"; + $subsectionHtml .= Xml::fieldset( $legend, $section, $attributes, $linkLegend ) . "\n"; } else { // Just return the inputs, nothing fancy. $subsectionHtml .= $section; -- To view,
[MediaWiki-commits] [Gerrit] Link data points in action=info to themselves - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/249578 Change subject: Link data points in action=info to themselves .. Link data points in action=info to themselves Bug: T78233 Change-Id: I45f26159164a8d3c3b5b4b4696420d1c09e370c2 --- M includes/actions/InfoAction.php 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/78/249578/1 diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 7389ae2..2b3683c 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -167,9 +167,11 @@ return $table . Html::rawElement( 'tr', - $id === null ? array() : array( 'id' => 'mw-' . $id ), - Html::rawElement( 'td', array( 'style' => 'vertical-align: top;' ), $name ) . - Html::rawElement( 'td', array(), $value ) + $id === null ? array() : array( 'id' => 'mw-'. $id ), + Html::rawElement( 'td', array( 'style' => 'vertical-align: top;' ), + $id === null ? $name : + Html::rawElement( 'a', array( 'href' => '#mw-' . $id ), $name ) ) . + Html::rawElement( 'td', array(), $value ) ); } -- To view, visit https://gerrit.wikimedia.org/r/249578 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I45f26159164a8d3c3b5b4b4696420d1c09e370c2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] set serialize_precision to 17, current PHP default - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/249183 Change subject: set serialize_precision to 17, current PHP default .. set serialize_precision to 17, current PHP default Follow up to: https://gerrit.wikimedia.org/r/#/c/249018/ Bug: T116683 Change-Id: I6e8dfab473ae2c18e68c8e4360159c9cc0e09758 --- M tests/phpunit/phpunit.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/83/249183/1 diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index fab6dfb..aaa7751 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -117,7 +117,7 @@ // Bug T116683 serialize_precision of 100 // may break testing against floating point values // treated with PHP's serialize() - ini_set( 'serialize_precision', 14 ); + ini_set( 'serialize_precision', 17 ); } public function execute() { -- To view, visit https://gerrit.wikimedia.org/r/249183 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e8dfab473ae2c18e68c8e4360159c9cc0e09758 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] JavaScriptContentTest: $wgScript != $wgScriptPath - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/249004 Change subject: JavaScriptContentTest: $wgScript != $wgScriptPath .. JavaScriptContentTest: $wgScript != $wgScriptPath Set $wgScript, $wgScriptPath and $wgResourceBasePath to avoid failures when running on a wiki with a non-standard $wgScriptPath. Reported-on: https://lists.wikimedia.org/pipermail/wikitech-l/2015-October/083675.html Change-Id: I8acbcca5449060ff5604bf275f690b53343e706e --- M tests/phpunit/includes/content/JavaScriptContentTest.php 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/04/249004/1 diff --git a/tests/phpunit/includes/content/JavaScriptContentTest.php b/tests/phpunit/includes/content/JavaScriptContentTest.php index b97842c..a636e56 100644 --- a/tests/phpunit/includes/content/JavaScriptContentTest.php +++ b/tests/phpunit/includes/content/JavaScriptContentTest.php @@ -258,7 +258,9 @@ public function testUpdateRedirect( $oldText, $expectedText ) { $this->setMwGlobals( array( 'wgServer' => '//example.org', - 'wgScriptPath' => '/w/index.php', + 'wgScriptPath' => '/w', + 'wgScript' => '/w/index.php', + 'wgResourceBasePath' => '/w', ) ); $target = Title::newFromText( "testUpdateRedirect_target" ); @@ -317,7 +319,9 @@ public function testGetRedirectTarget( $title, $text ) { $this->setMwGlobals( array( 'wgServer' => '//example.org', - 'wgScriptPath' => '/w/index.php', + 'wgScriptPath' => '/w', + 'wgScript' => '/w/index.php', + 'wgResourceBasePath' => '/w', ) ); $content = new JavaScriptContent( $text ); $target = $content->getRedirectTarget(); -- To view, visit https://gerrit.wikimedia.org/r/249004 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8acbcca5449060ff5604bf275f690b53343e706e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Reset serialize_precision to stabilize tests - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/249018 Change subject: Reset serialize_precision to stabilize tests .. Reset serialize_precision to stabilize tests With serialize_precision = 100 the following failures were generated: 1) ApiFormatPhpTest::testGeneralEncoding with data set #7 (array(1.0E+42), 'a:1:{i:0;d:1.0E+42;}', array(1)) Failed asserting that two strings are identical. --- Expected +++ Actual @@ @@ -a:1:{i:0;d:1.0E+42;} +a:1:{i:0;d:144885712678075916785549312;} /usr/home/saper/public_html/ybabel/tests/phpunit/includes/api/format/ApiFormatTestBase.php:61 /usr/home/saper/public_html/ybabel/tests/phpunit/MediaWikiTestCase.php:137 2) ApiFormatPhpTest::testGeneralEncoding with data set #30 (array(1.0E+42), 'a:1:{i:0;d:1.0E+42;}', array(2)) Failed asserting that two strings are identical. --- Expected +++ Actual @@ @@ -a:1:{i:0;d:1.0E+42;} +a:1:{i:0;d:144885712678075916785549312;} /usr/home/saper/public_html/ybabel/tests/phpunit/includes/api/format/ApiFormatTestBase.php:61 /usr/home/saper/public_html/ybabel/tests/phpunit/MediaWikiTestCase.php:137 Bug: T116683 Change-Id: I5e760b4632d2ab326954fe5769476e143c376d7c --- M tests/phpunit/phpunit.php 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/18/249018/1 diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 49b91c3..fab6dfb 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -113,6 +113,11 @@ ); // xdebug's default of 100 is too low for MediaWiki ini_set( 'xdebug.max_nesting_level', 1000 ); + + // Bug T116683 serialize_precision of 100 + // may break testing against floating point values + // treated with PHP's serialize() + ini_set( 'serialize_precision', 14 ); } public function execute() { -- To view, visit https://gerrit.wikimedia.org/r/249018 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5e760b4632d2ab326954fe5769476e143c376d7c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert removal of $wgDebugDBTransactions - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/248340 Change subject: Revert removal of $wgDebugDBTransactions .. Revert removal of $wgDebugDBTransactions This reverts partially commit a88df43d3f068b75f4d50c3c599ad2ccaf589f94. Change-Id: I639f65767f102d71d6a5a9a6134f51e1aad326b3 --- M RELEASE-NOTES-1.27 M autoload.php M includes/DefaultSettings.php M includes/db/Database.php M includes/db/DatabasePostgres.php M includes/objectcache/SqlBagOStuff.php 6 files changed, 140 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/40/248340/1 diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27 index f8293b9..f12bb0b 100644 --- a/RELEASE-NOTES-1.27 +++ b/RELEASE-NOTES-1.27 @@ -15,7 +15,6 @@ making the behavior configurable. The default values (`false` for the former, 1000 for the latter) are now hard-coded. * $wgDebugDumpSqlLength was removed (deprecated in 1.24). -* $wgDebugDBTransactions was removed (deprecated in 1.20). * $wgUseXVO has been removed, as it provides functionality only used by custom Wikimedia patches against Squid 2.x that probably noone uses in production anymore. There is now $wgUseKeyHeader that provides similar diff --git a/autoload.php b/autoload.php index 8720f33..187e791 100644 --- a/autoload.php +++ b/autoload.php @@ -937,6 +937,7 @@ 'PostgresBlob' => __DIR__ . '/includes/db/DatabasePostgres.php', 'PostgresField' => __DIR__ . '/includes/db/DatabasePostgres.php', 'PostgresInstaller' => __DIR__ . '/includes/installer/PostgresInstaller.php', + 'PostgresTransactionState' => __DIR__ . '/includes/db/DatabasePostgres.php', 'PostgresUpdater' => __DIR__ . '/includes/installer/PostgresUpdater.php', 'Preferences' => __DIR__ . '/includes/Preferences.php', 'PreferencesForm' => __DIR__ . '/includes/Preferences.php', diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 189ce42..a31f39d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -5477,6 +5477,13 @@ $wgDebugComments = false; /** + * Extensive database transaction state debugging + * + * @since 1.20 + */ +$wgDebugDBTransactions = false; + +/** * Write SQL queries to the debug log. * * This setting is only used $wgLBFactoryConf['class'] is set to @@ -5487,6 +5494,13 @@ $wgDebugDumpSql = false; /** + * Trim logged SQL queries to this many bytes. Set 0/false/null to do no + * trimming. + * @since 1.24 + */ +$wgDebugDumpSqlLength = 500; + +/** * Performance expectations for DB usage * * @since 1.26 diff --git a/includes/db/Database.php b/includes/db/Database.php index 2f135a4..48f4f3a 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -485,7 +485,11 @@ * - DBO_PERSISTENT: use persistant database connection */ public function setFlag( $flag ) { + global $wgDebugDBTransactions; $this->mFlags |= $flag; + if ( ( $flag & DBO_TRX ) && $wgDebugDBTransactions ) { + wfDebug( "Implicit transactions are now enabled.\n" ); + } } /** @@ -500,7 +504,11 @@ * - DBO_PERSISTENT: use persistant database connection */ public function clearFlag( $flag ) { + global $wgDebugDBTransactions; $this->mFlags &= ~$flag; + if ( ( $flag & DBO_TRX ) && $wgDebugDBTransactions ) { + wfDebug( "Implicit transactions are now disabled.\n" ); + } } /** @@ -605,7 +613,7 @@ * @param array $params Parameters passed from DatabaseBase::factory() */ function __construct( array $params ) { - global $wgDBprefix, $wgDBmwschema, $wgCommandLineMode; + global $wgDBprefix, $wgDBmwschema, $wgCommandLineMode, $wgDebugDBTransactions; $this->mTrxAtomicLevels = new SplStack; $this->srvCache = ObjectCache::newAccelerator( 'hash' ); @@ -623,8 +631,14 @@ if ( $this->mFlags & DBO_DEFAULT ) { if ( $wgCommandLineMode ) { $this->mFlags &= ~DBO_TRX; + if ( $wgDebugDBTransactions ) { + wfDebug( "Implicit transaction open disabled.\n" ); + } } else { $this->mFlags |= DBO_TRX; + if ( $wgDebugDBTransactions ) { + wfDebug( "Implicit transaction open enabled.\n" ); + } } } @@ -921,7 +935,7 @@ * for a successful read query, or false on failure if $tempIgnore set */ public function
[MediaWiki-commits] [Gerrit] Define $wgResourceBasePath in LocalSettings.php - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/248321 Change subject: Define $wgResourceBasePath in LocalSettings.php .. Define $wgResourceBasePath in LocalSettings.php Bug: T116374 Change-Id: I459c1097ed7048c3fe24e636e9ea22ec2e3b2675 --- M includes/installer/LocalSettingsGenerator.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/21/248321/1 diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 5a2dd1a..9b03260 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -334,6 +334,9 @@ \$wgScriptPath = \"{$this->values['wgScriptPath']}\"; ${serverSetting} +## The relative URL path to downloadable resources (images, scripts, etc.) +\$wgResourceBasePath = \"\$wgScriptPath\"; + ## The relative URL path to the logo. Make sure you change this from the default, ## or else you'll overwrite your logo when you upgrade! \$wgLogo = \"{$this->values['wgLogo']}\"; -- To view, visit https://gerrit.wikimedia.org/r/248321 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I459c1097ed7048c3fe24e636e9ea22ec2e3b2675 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove additional newline in LocalSettings.php - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/248476 Change subject: Remove additional newline in LocalSettings.php .. Remove additional newline in LocalSettings.php Change-Id: I6a0630d109c0ab4299507d125e4e1748055bcd58 --- M includes/installer/LocalSettingsGenerator.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/76/248476/1 diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 5a2dd1a..f8b46db 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -287,7 +287,7 @@ $serverSetting = ""; if ( array_key_exists( 'wgServer', $this->values ) && $this->values['wgServer'] !== null ) { $serverSetting = "\n## The protocol and server name to use in fully-qualified URLs\n"; - $serverSetting .= "\$wgServer = \"{$this->values['wgServer']}\";\n"; + $serverSetting .= "\$wgServer = \"{$this->values['wgServer']}\";"; } switch ( $this->values['wgMainCacheType'] ) { -- To view, visit https://gerrit.wikimedia.org/r/248476 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6a0630d109c0ab4299507d125e4e1748055bcd58 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Installer: check for available databases - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/248585 Change subject: Installer: check for available databases .. Installer: check for available databases - CLI installer should not stop if a prerequisite of some other database is not met - Web installer should not offer databases failing prerequisite check. Bug: T46511 Change-Id: I91ab978f9e7060f2942d72cce2c24564fe66f701 --- M includes/installer/CliInstaller.php M includes/installer/Installer.php M includes/installer/WebInstaller.php M includes/installer/WebInstallerPage.php 4 files changed, 58 insertions(+), 36 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/85/248585/1 diff --git a/includes/installer/CliInstaller.php b/includes/installer/CliInstaller.php index 7290740..2cb6165 100644 --- a/includes/installer/CliInstaller.php +++ b/includes/installer/CliInstaller.php @@ -188,7 +188,7 @@ public function showHelpBox( $msg /*, ... */ ) { } - public function showStatusMessage( Status $status ) { + public function displayStatusMessage( Status $status ) { $warnings = array_merge( $status->getWarningsArray(), $status->getErrorsArray() ); @@ -197,6 +197,10 @@ call_user_func_array( array( $this, 'showMessage' ), $w ); } } + } + + public function showStatusMessage( Status $status ) { + $this->displayStatusMessage( $status ); if ( !$status->isOk() ) { echo "\n"; diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 064bd6d..0b0f728 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -201,6 +201,7 @@ '_UpgradeDone' => false, '_InstallDone' => false, '_Caches' => array(), + '_AvailableDBs' => array(), '_InstallPassword' => '', '_SameAccount' => true, '_CreateDBAccount' => false, @@ -350,6 +351,14 @@ /** * Show a message to the installing user by using a Status object +* Does not exit on fatal error +* @param Status $status +*/ + abstract public function displayStatusMessage( Status $status ); + + /** +* Show a message to the installing user by using a Status object +* May exit on fatal error * @param Status $status */ abstract public function showStatusMessage( Status $status ); @@ -520,7 +529,6 @@ $class = ucfirst( $type ) . 'Installer'; $this->dbInstallers[$type] = new $class( $this ); } - return $this->dbInstallers[$type]; } @@ -724,17 +732,18 @@ $installer = $this->getDBInstaller( $db ); $status = $installer->checkPrerequisites(); if ( !$status->isGood() ) { - $this->showStatusMessage( $status ); + $this->displayStatusMessage( $status ); } if ( !$status->isOK() ) { unset( $databases[$db] ); } } $databases = array_flip( $databases ); + $this->setVar( '_AvailableDBs', $databases ); + if ( !$databases ) { $this->showError( 'config-no-db', $wgLang->commaList( $allNames ), count( $allNames ) ); - // @todo FIXME: This only works for the web installer! return false; } diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 67a4def..1614f3c 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -733,12 +733,18 @@ /** * @param Status $status */ - public function showStatusMessage( Status $status ) { + public function displayStatusMessage( Status $status ) { $errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() ); foreach ( $errors as $error ) { call_user_func_array( array( $this, 'showMessage' ), $error ); } } + /** +* @param Status $status +*/ + public function showStatusMessage( Status $status ) { + $this->displayStatusMessage( $status ); + } /** * Label a control by wrapping a config-input div around it and putting a diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 0d11463..c05bc7f 100644 ---
[MediaWiki-commits] [Gerrit] Install link to Manual:Combating_spam on the home page - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/248568 Change subject: Install link to Manual:Combating_spam on the home page .. Install link to Manual:Combating_spam on the home page Bug: T85327 Change-Id: I2bfe8b1489f748df2d24946d7c49b97d5cbf921e --- M includes/installer/i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/68/248568/1 diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json index 1eb8e03..ac3178f 100644 --- a/includes/installer/i18n/en.json +++ b/includes/installer/i18n/en.json @@ -319,5 +319,5 @@ "config-nofile": "File \"$1\" could not be found. Has it been deleted?", "config-extension-link": "Did you know that your wiki supports [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Extensions extensions]?\n\nYou can browse [//www.mediawiki.org/wiki/Special:MyLanguage/Category:Extensions_by_category extensions by category] or the [//www.mediawiki.org/wiki/Extension_Matrix Extension Matrix] to see the full list of extensions.", "mainpagetext": "MediaWiki has been successfully installed.", - "mainpagedocfooter": "Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.\n\n== Getting started ==\n* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]\n* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]\n* [//www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]" + "mainpagedocfooter": "Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.\n\n== Getting started ==\n* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]\n* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]\n* [//www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]\n* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]" } -- To view, visit https://gerrit.wikimedia.org/r/248568 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2bfe8b1489f748df2d24946d7c49b97d5cbf921e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't pollute global namespace with session variables - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/248485 Change subject: Don't pollute global namespace with session variables .. Don't pollute global namespace with session variables There is no need to store session variables (that also include user-supplied arguments) as $wgXXX global variables. Bug: T116375 Change-Id: I880d4299566beaf99ed1fc21c690cdda64149b0e --- M includes/installer/Installer.php M includes/installer/WebInstaller.php 2 files changed, 2 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/85/248485/1 diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 064bd6d..91589e1 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -692,17 +692,6 @@ } /** -* Exports all wg* variables stored by the installer into global scope. -*/ - public function exportVars() { - foreach ( $this->settings as $name => $value ) { - if ( substr( $name, 0, 2 ) == 'wg' ) { - $GLOBALS[$name] = $value; - } - } - } - - /** * Environment check for DB types. * @return bool */ diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 67a4def..8d7b2ea 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -159,7 +159,6 @@ $this->settings = $session['settings'] + $this->settings; } - $this->exportVars(); $this->setupLanguage(); if ( ( $this->getVar( '_InstallDone' ) || $this->getVar( '_UpgradeDone' ) ) @@ -277,6 +276,8 @@ $this->disableTimeLimit(); } + global $wgMainCacheType; + error_log( $pageName . ': $wgMainCacheType = ' . $wgMainCacheType ); $result = $page->execute(); $this->endPageWrapper(); -- To view, visit https://gerrit.wikimedia.org/r/248485 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I880d4299566beaf99ed1fc21c690cdda64149b0e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] $wgRightsIcon: Link 4.0 family of CC licenses - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/248541 Change subject: $wgRightsIcon: Link 4.0 family of CC licenses .. $wgRightsIcon: Link 4.0 family of CC licenses Bug: T96077 Change-Id: I86efa1dae64967d36f3a1afa79bf3637f43297dd --- M includes/installer/Installer.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/41/248541/1 diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 064bd6d..1841670 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -282,15 +282,15 @@ */ public $licenses = array( 'cc-by' => array( - 'url' => 'https://creativecommons.org/licenses/by/3.0/', + 'url' => 'https://creativecommons.org/licenses/by/4.0/', 'icon' => '$wgResourceBasePath/resources/assets/licenses/cc-by.png', ), 'cc-by-sa' => array( - 'url' => 'https://creativecommons.org/licenses/by-sa/3.0/', + 'url' => 'https://creativecommons.org/licenses/by-sa/4.0/', 'icon' => '$wgResourceBasePath/resources/assets/licenses/cc-by-sa.png', ), 'cc-by-nc-sa' => array( - 'url' => 'https://creativecommons.org/licenses/by-nc-sa/3.0/', + 'url' => 'https://creativecommons.org/licenses/by-nc-sa/4.0/', 'icon' => '$wgResourceBasePath/resources/assets/licenses/cc-by-nc-sa.png', ), 'cc-0' => array( -- To view, visit https://gerrit.wikimedia.org/r/248541 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I86efa1dae64967d36f3a1afa79bf3637f43297dd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] installer should set CACHE_ACCEL as the default if available - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/248560 Change subject: installer should set CACHE_ACCEL as the default if available .. installer should set CACHE_ACCEL as the default if available Bug: T49162 Change-Id: I57c8887c00cb3b73367e6733af1bf93dbab0c639 --- M includes/installer/WebInstallerPage.php 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/60/248560/1 diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 0d11463..6c8b164 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -1125,8 +1125,11 @@ ); $caches = array( 'none' ); + $cacheval_default = 'none'; + if ( count( $this->getVar( '_Caches' ) ) ) { $caches[] = 'accel'; + $cacheval_default = 'accel'; } $caches[] = 'memcached'; @@ -1136,7 +1139,7 @@ // We need to set a default here; but don't hardcode it // or we lose it every time we reload the page for validation // or going back! - $cacheval = 'none'; + $cacheval = $cacheval_default; } $hidden = ( $cacheval == 'memcached' ) ? '' : 'display: none'; $this->addHTML( -- To view, visit https://gerrit.wikimedia.org/r/248560 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I57c8887c00cb3b73367e6733af1bf93dbab0c639 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Installer: use _MainCacheType form variable - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/248493 Change subject: Installer: use _MainCacheType form variable .. Installer: use _MainCacheType form variable Do not use "wgMainCacheType" form variable name that containst values that cannot be assigned to $wgMainCacheType Bug: T116375 Change-Id: I83459c8006cc4c1bcdeaa0d78a1230687c95db46 --- M includes/installer/Installer.php M includes/installer/LocalSettingsGenerator.php M includes/installer/WebInstallerPage.php M mw-config/config.js 4 files changed, 9 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/93/248493/1 diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 064bd6d..c46b3c2 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -164,7 +164,6 @@ 'wgRightsIcon', 'wgRightsText', 'wgRightsUrl', - 'wgMainCacheType', 'wgEnableEmail', 'wgEnableUserEmail', 'wgEnotifUserTalk', diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 5a2dd1a..a1cd3c4 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -62,7 +62,7 @@ 'wgLanguageCode', 'wgEnableEmail', 'wgEnableUserEmail', 'wgDiff3', 'wgEnotifUserTalk', 'wgEnotifWatchlist', 'wgEmailAuthentication', 'wgDBtype', 'wgSecretKey', 'wgRightsUrl', 'wgSitename', 'wgRightsIcon', - 'wgRightsText', 'wgMainCacheType', 'wgEnableUploads', + 'wgRightsText', '_MainCacheType', 'wgEnableUploads', 'wgMainCacheType', '_MemCachedServers', 'wgDBserver', 'wgDBuser', 'wgDBpassword', 'wgUseInstantCommons', 'wgUpgradeKey', 'wgDefaultSkin', 'wgMetaNamespace', 'wgLogo', @@ -290,12 +290,12 @@ $serverSetting .= "\$wgServer = \"{$this->values['wgServer']}\";\n"; } - switch ( $this->values['wgMainCacheType'] ) { + switch ( $this->values['_MainCacheType'] ) { case 'anything': case 'db': case 'memcached': case 'accel': - $cacheType = 'CACHE_' . strtoupper( $this->values['wgMainCacheType'] ); + $cacheType = 'CACHE_' . strtoupper( $this->values['_MainCacheType'] ); break; case 'none': default: diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 0d11463..191c752 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -1131,7 +1131,7 @@ $caches[] = 'memcached'; // We'll hide/show this on demand when the value changes, see config.js. - $cacheval = $this->getVar( 'wgMainCacheType' ); + $cacheval = $this->getVar( '_MainCacheType' ); if ( !$cacheval ) { // We need to set a default here; but don't hardcode it // or we lose it every time we reload the page for validation @@ -1147,7 +1147,7 @@ // For grep: The following messages are used as the item labels: // config-cache-none, config-cache-accel, config-cache-memcached $this->parent->getRadioSet( array( - 'var' => 'wgMainCacheType', + 'var' => '_MainCacheType', 'label' => 'config-cache-options', 'itemLabelPrefix' => 'config-cache-', 'values' => $caches, @@ -1285,7 +1285,7 @@ $this->parent->setVarsFromRequest( array( '_RightsProfile', '_LicenseCode', 'wgEnableEmail', 'wgPasswordSender', 'wgEnableUploads', 'wgLogo', 'wgEnableUserEmail', 'wgEnotifUserTalk', 'wgEnotifWatchlist', - 'wgEmailAuthentication', 'wgMainCacheType', '_MemCachedServers', + 'wgEmailAuthentication', '_MainCacheType', '_MemCachedServers', 'wgUseInstantCommons', 'wgDefaultSkin' ) ); $retVal = true; @@ -1351,7 +1351,7 @@ } $this->parent->setVar( '_Extensions', $extsToInstall ); - if ( $this->getVar( 'wgMainCacheType' ) == 'memcached' ) { + if ( $this->getVar(
[MediaWiki-commits] [Gerrit] Advertise feeds only if $wgFeed is enabled - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/247821 Change subject: Advertise feeds only if $wgFeed is enabled .. Advertise feeds only if $wgFeed is enabled Wikis with $wgFeed=false should not present an Atom icon on the RecentChanges/Watchlist. Additionally do not require $wgFeed=true in order to use $wgOverrideSiteFeed. Wikis that use an external feed (from some blog, news site, etc.) may want to completely disable MediaWiki built-in feed feature. Change-Id: Ic64f7f5115a77c42ed2b336f6996fe711b3822ba --- M RELEASE-NOTES-1.27 M includes/OutputPage.php 2 files changed, 57 insertions(+), 42 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/21/247821/1 diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27 index 7d4ac3d..bbb067d 100644 --- a/RELEASE-NOTES-1.27 +++ b/RELEASE-NOTES-1.27 @@ -45,6 +45,7 @@ creation of passwordless "system" users for logged actions. * $wgMaxSquidPurgeTitles was removed. * $wgAjaxWatch was removed. This is now enabled by default. +* (T116145) Enabling $wgFeed is no longer required to use $wgOverrideSiteFeed feature. === New features in 1.27 === * $wgDataCenterId and $wgDataCenterRoles where added, which will serve as @@ -67,6 +68,7 @@ External libraries === Bug fixes in 1.27 === +* (T116145) RSS/Atom feeds are no longer advertised if $wgFeed is disabled. === Action API changes in 1.27 === * Added list=allrevisions. diff --git a/includes/OutputPage.php b/includes/OutputPage.php index d29ec54..00fc7b6 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1151,6 +1151,20 @@ } /** +* Return effective list of advertised feed types +* @see addFeedLink() +* +* @return array Array of feed type names ( 'rss', 'atom' ) +*/ + protected function getAdvertisedFeedTypes() { + if ( $this->getConfig()->get( 'Feed' ) ) { + return $this->getConfig()->get( 'AdvertisedFeedTypes' ); + } else { + return array(); + } + } + + /** * Add or remove feed links in the page header * This is mainly kept for backward compatibility, see OutputPage::addFeedLink() * for the new version @@ -1178,7 +1192,7 @@ public function setFeedAppendQuery( $val ) { $this->mFeedLinks = array(); - foreach ( $this->getConfig()->get( 'AdvertisedFeedTypes' ) as $type ) { + foreach ( $this->getAdvertisedFeedTypes() as $type ) { $query = "feed=$type"; if ( is_string( $val ) ) { $query .= '&' . $val; @@ -1194,7 +1208,7 @@ * @param string $href URL */ public function addFeedLink( $format, $href ) { - if ( in_array( $format, $this->getConfig()->get( 'AdvertisedFeedTypes' ) ) ) { + if ( in_array( $format, $this->getAdvertisedFeedTypes() ) ) { $this->mFeedLinks[$format] = $href; } } @@ -3512,50 +3526,49 @@ } # Feeds - if ( $config->get( 'Feed' ) ) { - foreach ( $this->getSyndicationLinks() as $format => $link ) { - # Use the page name for the title. In principle, this could - # lead to issues with having the same name for different feeds - # corresponding to the same page, but we can't avoid that at - # this low a level. + foreach ( $this->getSyndicationLinks() as $format => $link ) { + # Use the page name for the title. In principle, this could + # lead to issues with having the same name for different feeds + # corresponding to the same page, but we can't avoid that at + # this low a level. + # Empty if $wgFeed is false. + $tags[] = $this->feedLink( + $format, + $link, + # Used messages: 'page-rss-feed' and 'page-atom-feed' (for an easier grep) + $this->msg( + "page-{$format}-feed", $this->getTitle()->getPrefixedText() + )->text() + ); + } + + # Recent changes feed should appear on every page (except recentchanges, + # that would be redundant). Put it after the per-page feed to avoid + # changing existing behavior. It's still available, probably via a + # menu in your browser. Some sites might have a different
[MediaWiki-commits] [Gerrit] Let CSS load before top JS queue starts - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/247624 Change subject: Let CSS load before top JS queue starts .. Let CSS load before top JS queue starts Only execute minimal, inline JavaScript before loading "top" CSS modules. Seems to fix the flash of unstyled content on the Special:UserLogin page. Bug: T115692 Change-Id: I292d2999fa496079a3b8e03a76c63f1661c80614 --- M includes/OutputPage.php 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/24/247624/1 diff --git a/includes/OutputPage.php b/includes/OutputPage.php index d29ec54..ac22a02 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2705,6 +2705,7 @@ $ret .= Html::element( 'title', null, $this->getHTMLTitle() ) . "\n"; $ret .= $this->getInlineHeadScripts() . "\n"; $ret .= $this->buildCssLinks() . "\n"; + $ret .= $this->getScriptsForTopQueue() . "\n"; $ret .= $this->getExternalHeadScripts() . "\n"; foreach ( $this->getHeadLinksArray() as $item ) { @@ -3014,11 +3015,18 @@ // The "rest" includes browsers that support JavaScript but not supported by our runtime. // For the performance benefit of the majority, this is added unconditionally here and is // then fixed up by the startup module for unsupported browsers. - $links[] = Html::inlineScript( + return Html::inlineScript( 'document.documentElement.className = document.documentElement.className' . '.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );' ); - + } + /** +* JS stuff to put at the 'top', which goes in the +* These are modules marked with position 'top' +* +* @return string HTML fragment + */ + function getScriptsForTopQueue() { // Load config before anything else $links[] = ResourceLoader::makeInlineScript( ResourceLoader::makeConfigSetScript( $this->getJSVars() ) -- To view, visit https://gerrit.wikimedia.org/r/247624 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I292d2999fa496079a3b8e03a76c63f1661c80614 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Split mediawiki.special.preferences - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/247728 Change subject: Split mediawiki.special.preferences .. Split mediawiki.special.preferences - mediawiki.special.preferences.tab.js generates table of contents and needs to be loaded early - mediawiki.special.preferences.js additional scripts that can be loaded at the bottom - mediawiki.special.preferences.timezone.js timezone functions to be loaded late Change-Id: Ib58d2bf9fb4dbb32412adc29cd2384e106b2119a --- M includes/specials/SpecialPreferences.php M resources/Resources.php M resources/src/mediawiki.special/mediawiki.special.preferences.js A resources/src/mediawiki.special/mediawiki.special.preferences.tab.js A resources/src/mediawiki.special/mediawiki.special.preferences.timezone.js 5 files changed, 311 insertions(+), 285 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/28/247728/1 diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index 4b75e5f..3c96c6d 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -46,7 +46,9 @@ return; } + $out->addModules( 'mediawiki.special.preferences.tab' ); $out->addModules( 'mediawiki.special.preferences' ); + $out->addModules( 'mediawiki.special.preferences.timezone' ); if ( $this->getRequest()->getCheck( 'success' ) ) { $out->wrapWikiMsg( diff --git a/resources/Resources.php b/resources/Resources.php index fee1e7c..91236dd 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1707,22 +1707,35 @@ 'position' => 'top', 'styles' => 'resources/src/mediawiki.special/mediawiki.special.pagesWithProp.css', ), - 'mediawiki.special.preferences' => array( - 'scripts' => 'resources/src/mediawiki.special/mediawiki.special.preferences.js', + 'mediawiki.special.preferences.tab' => array( + 'scripts' => 'resources/src/mediawiki.special/mediawiki.special.preferences.tab.js', 'styles' => 'resources/src/mediawiki.special/mediawiki.special.preferences.css', 'position' => 'top', 'messages' => array( 'prefs-tabs-navigation-hint', - 'prefswarning-warning', - 'saveprefs', 'savedprefs', ), 'dependencies' => array( - 'mediawiki.language', - 'mediawiki.confirmCloseWindow', 'mediawiki.notification', ), ), + 'mediawiki.special.preferences' => array( + 'scripts' => 'resources/src/mediawiki.special/mediawiki.special.preferences.js', + 'messages' => array( + 'prefswarning-warning', + 'saveprefs', + ), + 'dependencies' => array( + 'mediawiki.special.preferences.tab', + 'mediawiki.confirmCloseWindow', + ), + ), + 'mediawiki.special.preferences.timezone' => array( + 'scripts' => 'resources/src/mediawiki.special/mediawiki.special.preferences.timezone.js', + 'dependencies' => array( + 'mediawiki.language', + ), + ), 'mediawiki.special.recentchanges' => array( 'scripts' => 'resources/src/mediawiki.special/mediawiki.special.recentchanges.js', 'dependencies' => 'mediawiki.special', diff --git a/resources/src/mediawiki.special/mediawiki.special.preferences.js b/resources/src/mediawiki.special/mediawiki.special.preferences.js index 0fda3dc..30d29f5 100644 --- a/resources/src/mediawiki.special/mediawiki.special.preferences.js +++ b/resources/src/mediawiki.special/mediawiki.special.preferences.js @@ -3,287 +3,10 @@ */ ( function ( mw, $ ) { $( function () { - var $preftoc, $preferences, $fieldsets, $legends, - hash, labelFunc, - $tzSelect, $tzTextbox, $localtimeHolder, servertime, - $checkBoxes, allowCloseWindow, - notif; - - labelFunc = function () { - return this.id.replace( /^mw-prefsection/g, 'preftab' ); - }; - - $( '#prefsubmit' ).attr( 'id', 'prefcontrol' ); - $preftoc = $( '' ) - .attr( { - id: 'preftoc', - role: 'tablist' - } ); - $preferences = $( '#preferences' ) - .addClass(
[MediaWiki-commits] [Gerrit] Remove wgAlwaysUseTidy from ExpandTemplates - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/246476 Change subject: Remove wgAlwaysUseTidy from ExpandTemplates .. Remove wgAlwaysUseTidy from ExpandTemplates Fixes ConfigException: Exception encountered, of type "ConfigException" [1235d69e] index.php/Special:ExpandTemplates ConfigException from line 53 of includes/config/GlobalVarConfig.php: GlobalVarConfig::get: undefined option: 'AlwaysUseTidy' Backtrace: includes/specials/SpecialExpandTemplates.php(117): GlobalVarConfig->get(string) i includes/specialpage/SpecialPage.php(384): SpecialExpandTemplates->execute(NULL) Change-Id: Iba16f12f50f7427533f89817eb40f46a2ab58ec4 --- M includes/specials/SpecialExpandTemplates.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/76/246476/1 diff --git a/includes/specials/SpecialExpandTemplates.php b/includes/specials/SpecialExpandTemplates.php index b7582e6..06eb276 100644 --- a/includes/specials/SpecialExpandTemplates.php +++ b/includes/specials/SpecialExpandTemplates.php @@ -114,7 +114,7 @@ } $config = $this->getConfig(); - if ( ( $config->get( 'UseTidy' ) && $options->getTidy() ) || $config->get( 'AlwaysUseTidy' ) ) { + if ( $config->get( 'UseTidy' ) && $options->getTidy() ) { $tmp = MWTidy::tidy( $tmp ); } -- To view, visit https://gerrit.wikimedia.org/r/246476 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba16f12f50f7427533f89817eb40f46a2ab58ec4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Functions results cannot be =& - change (mediawiki...DynamicPageList)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/246162 Change subject: Functions results cannot be =& .. Functions results cannot be =& Bug: https://phabricator.wikimedia.org/T115376 Change-Id: I5042946294492bf34f58d013d3c546f21af8807f --- M DPLMain.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DynamicPageList refs/changes/62/246162/1 diff --git a/DPLMain.php b/DPLMain.php index d234e97..43c21c9 100644 --- a/DPLMain.php +++ b/DPLMain.php @@ -51,7 +51,7 @@ } // get database access -$dbr =& wfGetDB( DB_SLAVE ); +$dbr = wfGetDB( DB_SLAVE ); $sPageTable = $dbr->tableName( 'page' ); $sCategorylinksTable = $dbr->tableName( 'categorylinks' ); @@ -2546,7 +2546,7 @@ return $output; } -$sk =& $wgUser->getSkin(); +$sk = $wgUser->getSkin(); // generate title for Special:Contributions (used if adduser=true) $sSpecContribs = '[[:Special:Contributions|Contributions]]'; -- To view, visit https://gerrit.wikimedia.org/r/246162 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5042946294492bf34f58d013d3c546f21af8807f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DynamicPageList Gerrit-Branch: master Gerrit-Owner: saper___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Covert Polish listinfo template back to ISO 8859-2 - change (operations/puppet)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/235911 Change subject: Covert Polish listinfo template back to ISO 8859-2 .. Covert Polish listinfo template back to ISO 8859-2 Mailman messages are being output in ISO 8859-2, which got mixed with the UTF-8 text in this file. Currently the list description is in ISO-8859-2 as well. English page is still badly broken (due to inclusion of a pure ISO 8859-2 description on the UTF-8 page. Change-Id: I66518ee8fbc1173aa8ef75b9d0a1c382d6e8cc6f --- M modules/mailman/files/templates/pl/listinfo.html 1 file changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/11/235911/1 diff --git a/modules/mailman/files/templates/pl/listinfo.html b/modules/mailman/files/templates/pl/listinfo.html index 296b62e..9bc9004 100644 --- a/modules/mailman/files/templates/pl/listinfo.html +++ b/modules/mailman/files/templates/pl/listinfo.html @@ -1,7 +1,7 @@ - + Lista dyskusyjna - Wikimedia
[MediaWiki-commits] [Gerrit] (bug T63231) use OSError as WindowsError does not exist on u... - change (pywikibot/compat)
saper has submitted this change and it was merged. Change subject: (bug T63231) use OSError as WindowsError does not exist on unix hosts .. (bug T63231) use OSError as WindowsError does not exist on unix hosts Change-Id: I17d0352a221e68df5b64b324a48bd82e1d76fb65 --- M pywikibot/version.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: saper: Verified; Looks good to me, approved diff --git a/pywikibot/version.py b/pywikibot/version.py index ee49fe7..55a2ee0 100644 --- a/pywikibot/version.py +++ b/pywikibot/version.py @@ -178,7 +178,7 @@ date = None try: subprocess.Popen([cmd], stdout=subprocess.PIPE).communicate() -except WindowsError: +except OSError: # some windows git versions provide git.cmd instead of git.exe cmd = 'git.cmd' try: -- To view, visit https://gerrit.wikimedia.org/r/208839 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I17d0352a221e68df5b64b324a48bd82e1d76fb65 Gerrit-PatchSet: 1 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: 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] (bug T63231) use OSError as WindowsError does not exist on u... - change (pywikibot/compat)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/208839 Change subject: (bug T63231) use OSError as WindowsError does not exist on unix hosts .. (bug T63231) use OSError as WindowsError does not exist on unix hosts Change-Id: I17d0352a221e68df5b64b324a48bd82e1d76fb65 --- M pywikibot/version.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/39/208839/1 diff --git a/pywikibot/version.py b/pywikibot/version.py index ee49fe7..55a2ee0 100644 --- a/pywikibot/version.py +++ b/pywikibot/version.py @@ -178,7 +178,7 @@ date = None try: subprocess.Popen([cmd], stdout=subprocess.PIPE).communicate() -except WindowsError: +except OSError: # some windows git versions provide git.cmd instead of git.exe cmd = 'git.cmd' try: -- To view, visit https://gerrit.wikimedia.org/r/208839 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I17d0352a221e68df5b64b324a48bd82e1d76fb65 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow user to customize User-Agent - change (pywikibot/compat)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/208842 Change subject: Allow user to customize User-Agent .. Allow user to customize User-Agent Due to problems with automatic version detection (WindowsError, not working without $PATH under cron, etc.) allow the user to override default user agent. Change-Id: I47a8f135336f3dec4cea46f846e2db1567868d24 --- M config.py M wikipedia.py 2 files changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/42/208842/1 diff --git a/config.py b/config.py index 19f8369..84968b9 100644 --- a/config.py +++ b/config.py @@ -435,6 +435,7 @@ ## HTTP SETTINGS ## # Default socket timeout. Set to None to disable timeouts. socket_timeout = 120 # set a pretty long timeout just in case... +useragent = None ## COSMETIC CHANGES SETTINGS ## diff --git a/wikipedia.py b/wikipedia.py index 3f3496a..9873e40 100644 --- a/wikipedia.py +++ b/wikipedia.py @@ -6057,10 +6057,13 @@ useragent = s # Default User-agent -setUserAgent(USER_AGENT_FORMAT % dict( -script=('-'.join(version.get_executing_script())), -versionrev=(version.getversiondict()[rev]) -)) +if config.useragent: +useragent = config.useragent +else: +setUserAgent(USER_AGENT_FORMAT % dict( +script=('-'.join(version.get_executing_script())), +versionrev=(version.getversiondict()[rev]) +)) def url2link(percentname, insite, site): -- To view, visit https://gerrit.wikimedia.org/r/208842 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I47a8f135336f3dec4cea46f846e2db1567868d24 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Globalrenamequeue-email-body-rejected: add $3 - change (mediawiki...WikimediaMessages)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/208123 Change subject: Globalrenamequeue-email-body-rejected: add $3 .. Globalrenamequeue-email-body-rejected: add $3 Pointed-out-by: Glaisher on #wikimedia-stewards Change-Id: Ie0e1f4c7c9687fdc8c0d9ee2f3aebee5e6179208 --- M i18n/wikimedia/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages refs/changes/23/208123/1 diff --git a/i18n/wikimedia/en.json b/i18n/wikimedia/en.json index ca6a9b6..f78fb5d 100644 --- a/i18n/wikimedia/en.json +++ b/i18n/wikimedia/en.json @@ -239,7 +239,7 @@ restriction-level-editeditorprotected: editor protected, wikimedia-feedback-termsofuse: I agree to provide feedback in accordance with the a href=\https://wikimediafoundation.org/wiki/Terms_of_Use\; target=\_blank\Terms of Use/a., wikimedia-globalrenamequeue-email-body-approved: The request to rename \$1\ to \$2\ has been approved. Once completed, you will be able to log in using your new username with your old password. Thank you for participating on Wikimedia projects.\n\n, - wikimedia-globalrenamequeue-email-body-rejected: The request to rename \$1\ to \$2\ could not be completed.\n\nFor more information, please visit this help page: https://meta.wikimedia.org/wiki/Help:Unified_login#Frequently_asked_questions. To discuss your rename request, you can post on this page: https://meta.wikimedia.org/wiki/Talk:Steward_requests/Username_changes. You must still log in to your current account name first., + wikimedia-globalrenamequeue-email-body-rejected: The request to rename \$1\ to \$2\ could not be completed.\n\nNote: $3\n\nFor more information, please visit this help page: https://meta.wikimedia.org/wiki/Help:Unified_login#Frequently_asked_questions. To discuss your rename request, you can post on this page: https://meta.wikimedia.org/wiki/Talk:Steward_requests/Username_changes. You must still log in to your current account name first., wikimedia-sulrenamewarning-usenew: From now on you need to log in using your new username strong$1/strong. Your new username is unique to you across every Wikimedia project, and if you are logged in to one project and visit another, your account will carry over with you. The [[:m:Special:MyLanguage/Help:Unified_login|Unified login help page]] has more information about single-user login, as well as a list of frequently asked questions. If you need to update your email address or to change your password in your [[Special:Preferences|preferences]], now might be a good time to do so.\n\nTo request a different account name, visit [[Special:GlobalRenameRequest]]. Thank you for participating on Wikimedia projects., wikimedia-centralauth-contribs-locked: This account is globally locked.\nSee [[m:Special:CentralAuth/$1|global account details]] for more information., wikimedia-centralauth-uwbr-intro: This page lists users registered with this wiki who will be renamed due to [[m:Single User Login finalisation announcement|single-user login finalization]]. More information on [[m:Help:Unified login|unified login]]. Users can request a rename at any time using [[Special:GlobalRenameRequest]]., -- To view, visit https://gerrit.wikimedia.org/r/208123 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0e1f4c7c9687fdc8c0d9ee2f3aebee5e6179208 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMessages Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use monospaced font for the debug panel - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/203777 Change subject: Use monospaced font for the debug panel .. Use monospaced font for the debug panel Debug output seems to be much more readable with the monospaced font. Change-Id: I3e3a7c110d4ceae8c1b65b35bf17b34fed7f68f8 --- M resources/src/mediawiki/mediawiki.debug.less 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/77/203777/1 diff --git a/resources/src/mediawiki/mediawiki.debug.less b/resources/src/mediawiki/mediawiki.debug.less index 949c558..2eda689 100644 --- a/resources/src/mediawiki/mediawiki.debug.less +++ b/resources/src/mediawiki/mediawiki.debug.less @@ -95,6 +95,7 @@ height: 300px; overflow: scroll; display: none; + font-family: monospaced; font-size: 11px; background-color: #e1eff2; box-sizing: border-box; -- To view, visit https://gerrit.wikimedia.org/r/203777 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e3a7c110d4ceae8c1b65b35bf17b34fed7f68f8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Detect when invoked via maintenance/update.php - change (mediawiki...ProofreadPage)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/203776 Change subject: Detect when invoked via maintenance/update.php .. Detect when invoked via maintenance/update.php In case of the non-standard extension location (different than $IP/extensions/) this script causes maintenance/update.php to bail while trying to require Maintenance classes. At this stage those classes are available via the autoloader, therefore try searching for them via various paths only when autoloading fails (e.g. when invoked directly.) Change-Id: I97b1c50bca47e338d32812d7a4dfcddcda8fb0fe --- M maintenance/fixProofreadPagePagesContentModel.php 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage refs/changes/76/203776/1 diff --git a/maintenance/fixProofreadPagePagesContentModel.php b/maintenance/fixProofreadPagePagesContentModel.php index 3054bf0..0924542 100644 --- a/maintenance/fixProofreadPagePagesContentModel.php +++ b/maintenance/fixProofreadPagePagesContentModel.php @@ -19,9 +19,10 @@ * @ingroup ProofreadPage */ -$basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' ) : __DIR__ . '/../../..'; - -require_once $basePath . '/maintenance/Maintenance.php'; +if (!class_exists('LoggedUpdateMaintenance')) { + $basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' ) : __DIR__ . '/../../..'; + require_once $basePath . '/maintenance/Maintenance.php'; +} /** * Set the content model type for Page: pages @@ -71,4 +72,4 @@ } $maintClass = 'FixProofreadPagePagesContentModel'; -require_once( RUN_MAINTENANCE_IF_MAIN ); \ No newline at end of file +require_once( RUN_MAINTENANCE_IF_MAIN ); -- To view, visit https://gerrit.wikimedia.org/r/203776 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I97b1c50bca47e338d32812d7a4dfcddcda8fb0fe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ProofreadPage Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow CheckUser for IPv6 ranges up to /32 - change (mediawiki...CheckUser)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/203679 Change subject: Allow CheckUser for IPv6 ranges up to /32 .. Allow CheckUser for IPv6 ranges up to /32 Bug: https://phabricator.wikimedia.org/T35734 Change-Id: I1dd55122c4542c5a2d4c739981854c31f285511d --- M CheckUser.php M extension.json M i18n/qqq.json M specials/SpecialCheckUser.php 4 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser refs/changes/79/203679/1 diff --git a/CheckUser.php b/CheckUser.php index 5fbc47b..81d35ca 100644 --- a/CheckUser.php +++ b/CheckUser.php @@ -61,7 +61,7 @@ //Shortest CIDR limits that can be checked in any individual range check $wgCheckUserCIDRLimit = array( 'IPv4'=16, - 'IPv6'=48, + 'IPv6'=32, ); // Public key to encrypt private data that may need to be read later diff --git a/extension.json b/extension.json index 9e62d31..92a9629 100644 --- a/extension.json +++ b/extension.json @@ -15,7 +15,7 @@ config: { CheckUserCIDRLimit: { IPv4: 16, - IPv6: 48 + IPv6: 32 }, CheckUserMaxBlocks: 200, CheckUserLog: /home/wikipedia/logs/checkuser.log, diff --git a/i18n/qqq.json b/i18n/qqq.json index 33bf928..d0c5230 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -23,7 +23,7 @@ Liuxinyu970226 ] }, - checkuser-summary: Explanation of CheckUser tool. See [[mw:Extension:CheckUser#Basic_interface|screenshot titled 'Basic CheckUser interface']].\n\nParameters:\n* $1 - an integer. default value: 16\n* $2 - an integer. default value: 48, + checkuser-summary: Explanation of CheckUser tool. See [[mw:Extension:CheckUser#Basic_interface|screenshot titled 'Basic CheckUser interface']].\n\nParameters:\n* $1 - an integer. default value: 16\n* $2 - an integer. default value: 32, checkuser-desc: {{desc|name=Check User|url=https://www.mediawiki.org/wiki/Extension:CheckUser}};, checkuser-logcase: Unused at this time., checkuser: Check user extension.\n{{doc-special|CheckUser}}\nIn the special page, checkusers can check the IP addresses of users.\n{{Identical|Check user}}, diff --git a/specials/SpecialCheckUser.php b/specials/SpecialCheckUser.php index eaa3eb5..0c612c1 100644 --- a/specials/SpecialCheckUser.php +++ b/specials/SpecialCheckUser.php @@ -1377,7 +1377,7 @@ list( $start, $end ) = IP::parseRange( $ip ); return array( 'cuc_' . $type . '_hex BETWEEN ' . $db-addQuotes( $start ) . ' AND ' . $db-addQuotes( $end ) ); } elseif ( preg_match( '#^\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}/(\d+)$#', $ip, $matches ) ) { - // IPv6 CIDR, 48-128 bits + // IPv6 CIDR, 32-128 bits if ( $matches[1] $wgCheckUserCIDRLimit['IPv6'] || $matches[1] 128 ) { return false; // invalid } -- To view, visit https://gerrit.wikimedia.org/r/203679 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1dd55122c4542c5a2d4c739981854c31f285511d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CheckUser Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Introduce config.days_dead insted of global day - change (pywikibot/compat)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/175610 Change subject: Introduce config.days_dead insted of global day .. Introduce config.days_dead insted 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, 10 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/10/175610/1 diff --git a/config.py b/config.py index 50fafa2..3d53166 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 +days_dead = 7 + ## DATABASE SETTINGS ## db_hostname = 'localhost' db_username = 'wikiuser' diff --git a/weblinkchecker.py b/weblinkchecker.py index e7f2a90..cc36b81 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. @@ -500,7 +501,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.days_dead) class History: @@ -570,7 +571,7 @@ self.reportThread.report(url, errorReport, containingPage, archiveURL) -def setLinkDead(self, url, error, page, day): +def setLinkDead(self, url, error, page, days_dead): Adds the fact that the link was found dead to the .dat file. @@ -586,7 +587,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 * days_dead: # search for archived page archiveURL = pywikibot.weblib.getInternetArchiveURL(self.site, url) if archiveURL is None: @@ -806,8 +807,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 +822,7 @@ elif arg.startswith('-ignore:'): HTTPignore.append(int(arg[8:])) elif arg.startswith('-day:'): -day = int(arg[5:]) +config.days_dead = 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: newchange Gerrit-Change-Id: Ic95c31ecc7dbb557db8319b5857a4e94e4347db6 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Introduce weblinkchecker-badurl_msg - change (pywikibot/i18n)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/175632 Change subject: Introduce weblinkchecker-badurl_msg .. Introduce weblinkchecker-badurl_msg We need this message to tell the users the URL could not be checked at all due to its incorrect format - as opposed to 404 or some other error condition Change-Id: I33c04301685050bc3daced8d6e7599b21e33f7fe --- M weblinkchecker.py M weblinkchecker/en.json 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/i18n refs/changes/32/175632/1 diff --git a/weblinkchecker.py b/weblinkchecker.py index 6b02833..b818d0a 100644 --- a/weblinkchecker.py +++ b/weblinkchecker.py @@ -2,6 +2,7 @@ msg = { 'en': { 'weblinkchecker-archive_msg': u'The web page has been saved by the Internet Archive. Please consider linking to an appropriate archived version: [%(URL)s].', +'weblinkchecker-badurl_msg': u'The address [$(URL)s] does not appear to be a valid URL.', 'weblinkchecker-caption': u'Dead link', 'weblinkchecker-summary': u'Bot: Reporting unavailable external link', 'weblinkchecker-report': u'During several automated bot runs the following external link was found to be unavailable. Please check if the link is in fact down and fix or remove it in that case!', diff --git a/weblinkchecker/en.json b/weblinkchecker/en.json index b2b9d36..46725bc 100644 --- a/weblinkchecker/en.json +++ b/weblinkchecker/en.json @@ -1,5 +1,6 @@ { weblinkchecker-archive_msg: The web page has been saved by the Internet Archive. Please consider linking to an appropriate archived version: [%(URL)s]., + weblinkchecker-badurl: The address [%(URL)s] does not seem to be a valid URL., weblinkchecker-caption: Dead link, weblinkchecker-summary: Bot: Reporting unavailable external link, weblinkchecker-report: During several automated bot runs the following external link was found to be unavailable. Please check if the link is in fact down and fix or remove it in that case! -- To view, visit https://gerrit.wikimedia.org/r/175632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I33c04301685050bc3daced8d6e7599b21e33f7fe Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/i18n Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Report malformed URLs - change (pywikibot/compat)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/175638 Change subject: Report malformed URLs .. Report malformed URLs Don't throw URL exception in the checker thread if the URL cannot be parsed. Introduce NotAnURLError exception to allow information about malformed URLs to be passed to the reporting facility. Change-Id: I93d45db6dec10210ff760154111853f53a042755 --- M weblinkchecker.py 1 file changed, 17 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/38/175638/1 diff --git a/weblinkchecker.py b/weblinkchecker.py index e7f2a90..e48491f 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. @@ -217,6 +218,9 @@ except NameError: pass +class NotAnURLError(BaseException): +pass + class LinkChecker(object): @@ -259,6 +263,8 @@ return httplib.HTTPConnection(self.host) elif self.scheme == 'https': return httplib.HTTPSConnection(self.host) + else: + raise NotAnURLError(self.url) def getEncodingUsedByServer(self): if not self.serverEncoding: @@ -489,6 +495,11 @@ linkChecker = LinkChecker(self.url, HTTPignore=self.HTTPignore) try: ok, message = linkChecker.check() + except NotAnURLError as e: + ok, message = False, i18n.twtranslate(pywikibot.getSite(), + 'weblinkchecker-badurl_msg', + {'URL': self.url}) + except: pywikibot.output('Exception while processing URL %s in page %s' % (self.url, self.page.title())) @@ -500,7 +511,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.days_dead) class History: @@ -570,7 +581,7 @@ self.reportThread.report(url, errorReport, containingPage, archiveURL) -def setLinkDead(self, url, error, page, day): +def setLinkDead(self, url, error, page, days_dead): Adds the fact that the link was found dead to the .dat file. @@ -586,7 +597,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 * days_dead: # search for archived page archiveURL = pywikibot.weblib.getInternetArchiveURL(self.site, url) if archiveURL is None: @@ -806,8 +817,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 +832,7 @@ elif arg.startswith('-ignore:'): HTTPignore.append(int(arg[8:])) elif arg.startswith('-day:'): -day = int(arg[5:]) +config.days_dead = int(arg[5:]) elif arg.startswith('-xmlstart'): if len(arg) == 9: xmlStart = pywikibot.input( -- To view, visit https://gerrit.wikimedia.org/r/175638 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93d45db6dec10210ff760154111853f53a042755 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Pass $wgDebugTimestamp info to debug console - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/173667 Change subject: Pass $wgDebugTimestamp info to debug console .. Pass $wgDebugTimestamp info to debug console Bug: 73492 Change-Id: I2557601e85d1f4837c67621f2db27dae70b09880 --- M autoload.php M includes/GlobalFunctions.php M includes/debug/MWDebug.php M includes/debug/logger/legacy/Logger.php M resources/src/mediawiki/mediawiki.debug.js 5 files changed, 40 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/67/173667/1 diff --git a/autoload.php b/autoload.php index c5fc22c..24ed452 100644 --- a/autoload.php +++ b/autoload.php @@ -676,6 +676,7 @@ 'MWCryptHKDF' = __DIR__ . '/includes/utils/MWCryptHKDF.php', 'MWCryptRand' = __DIR__ . '/includes/utils/MWCryptRand.php', 'MWDebug' = __DIR__ . '/includes/debug/MWDebug.php', + 'MWDebugEntry' = __DIR__ . '/includes/debug/MWDebug.php', 'MWDocGen' = __DIR__ . '/maintenance/mwdocgen.php', 'MWException' = __DIR__ . '/includes/exception/MWException.php', 'MWExceptionHandler' = __DIR__ . '/includes/exception/MWExceptionHandler.php', diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 81f767d..d48367f 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -973,19 +973,16 @@ } $timer = wfDebugTimer(); - if ( $timer !== '' ) { - // Prepend elapsed request time and real memory usage to each line - $text = preg_replace( '/[^\n]/', $timer . '\0', $text, 1 ); - } if ( $dest === 'all' ) { - MWDebug::debugMsg( $text ); + MWDebug::debugMsg( $text, $timer ); } $ctx = array(); if ( $wgDebugLogPrefix !== '' ) { $ctx['prefix'] = $wgDebugLogPrefix; } + $ctx['debugtimestamps'] = $timer; $logger = MWLogger::getInstance( 'wfDebug' ); $logger-debug( rtrim( $text, \n ), $ctx ); @@ -1076,13 +1073,16 @@ $text = trim( $text ); + $timer = wfDebugTimer(); + if ( $dest === 'all' ) { - MWDebug::debugMsg( [{$logGroup}] {$text}\n ); + MWDebug::debugMsg( [{$logGroup}] {$text}\n, $timer ); } $logger = MWLogger::getInstance( $logGroup ); $logger-debug( $text, array( 'private' = ( $dest === 'private' ), + 'debugtimestamps' = $timer ) ); } diff --git a/includes/debug/MWDebug.php b/includes/debug/MWDebug.php index ffc6b3b..1b05670 100644 --- a/includes/debug/MWDebug.php +++ b/includes/debug/MWDebug.php @@ -312,11 +312,11 @@ * @since 1.19 * @param string $str */ - public static function debugMsg( $str ) { + public static function debugMsg( $str, $debugtimestamp = '' ) { global $wgDebugComments, $wgShowDebug; if ( self::$enabled || $wgDebugComments || $wgShowDebug ) { - self::$debug[] = rtrim( UtfNormal::cleanUp( $str ) ); + self::$debug[] = new MWDebugEntry( rtrim( UtfNormal::cleanUp( $str ) ), $debugtimestamp ); } } @@ -582,3 +582,24 @@ ); } } + +/* + * Single debugger log entry + * + * @since 1.25 + */ +class MWDebugEntry { + + function __construct( $text, $timer = '' ) { + $this-text = $text; + $this-timer = $timer; + } + + function __toString() { + if ( $this-timer) { + return {$this-timer} {$this-text}; + } else { + return $this-text; + } + } +} diff --git a/includes/debug/logger/legacy/Logger.php b/includes/debug/logger/legacy/Logger.php index daf3f51..6e93e59 100644 --- a/includes/debug/logger/legacy/Logger.php +++ b/includes/debug/logger/legacy/Logger.php @@ -166,6 +166,7 @@ $log = sprintf( %s\t%04.3f\t%s%s\n, gmdate( 'YmdHis' ), $context['elapsed'], $context['url'], $forward ); + unset( $context['debugtimestamps'] ); // redundant with profiling $text = self::formatAsWfDebugLog( $channel, $log . $context['output'], $context ); @@ -194,6 +195,9 @@ $text = preg_replace( '![\x00-\x08\x0b\x0c\x0e-\x1f]!', ' ', $message ); if ( isset( $context['prefix'] ) ) { $text = {$context['prefix']}{$text}; + } + if ( $context['debugtimestamps'] ) { + $text = {$context['debugtimestamps']} {$text}; } return {$text}\n; } @@ -241,6 +245,9 @@ */ protected static function formatAsWfDebugLog( $channel, $message, $context
[MediaWiki-commits] [Gerrit] ImportTest should not depend on allow_url_fopen=1 - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/173221 Change subject: ImportTest should not depend on allow_url_fopen=1 .. ImportTest should not depend on allow_url_fopen=1 Change-Id: I4f755effd5f7bbbd7c704fe3b37322b6c92fac9b --- M tests/phpunit/includes/ImportTest.php 1 file changed, 3 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/21/173221/1 diff --git a/tests/phpunit/includes/ImportTest.php b/tests/phpunit/includes/ImportTest.php index 678c89b..fc7a1ae 100644 --- a/tests/phpunit/includes/ImportTest.php +++ b/tests/phpunit/includes/ImportTest.php @@ -9,13 +9,8 @@ */ class ImportTest extends MediaWikiLangTestCase { - private function getInputStreamSource( $xml ) { - $file = 'data:application/xml,' . $xml; - $status = ImportStreamSource::newFromFile( $file ); - if ( !$status-isGood() ) { - throw new MWException( Cannot create InputStreamSource. ); - } - return $status-value; + private function getDataSource( $xml ) { + return new ImportStringSource( $xml ); } /** @@ -25,7 +20,7 @@ * @param string|null $redirectTitle */ public function testHandlePageContainsRedirect( $xml, $redirectTitle ) { - $source = $this-getInputStreamSource( $xml ); + $source = $this-getDataSource( $xml ); $redirect = null; $callback = function ( $title, $origTitle, $revCount, $sRevCount, $pageInfo ) use ( $redirect ) { -- To view, visit https://gerrit.wikimedia.org/r/173221 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f755effd5f7bbbd7c704fe3b37322b6c92fac9b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use ImportStringSource for simple import sources - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/173222 Change subject: Use ImportStringSource for simple import sources .. Use ImportStringSource for simple import sources Bug: 73283 Change-Id: I9e43d7ea0c1a4553d71bac29ca18285f3f028421 --- M includes/Import.php M tests/phpunit/includes/ImportTest.php 2 files changed, 28 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/22/173222/1 diff --git a/includes/Import.php b/includes/Import.php index 4eb8e97..9c33496 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -42,10 +42,10 @@ /** * Creates an ImportXMLReader drawing from the source provided -* @param ImportStreamSource $source +* @param WikiImportSource $source * @param Config $config */ - function __construct( ImportStreamSource $source, Config $config = null ) { + function __construct( WikiImportSource $source, Config $config = null ) { $this-reader = new XMLReader(); if ( !$config ) { wfDeprecated( __METHOD__ . ' without a Config instance', '1.25' ); @@ -62,6 +62,7 @@ } else { $this-reader-open( uploadsource://$id ); } + wfDebugLog( wikiimporter, Source $id registered ); // Default callbacks $this-setRevisionCallback( array( $this, importRevision ) ); @@ -913,7 +914,7 @@ * @param ImportStreamSource $source * @return string */ - static function registerSource( ImportStreamSource $source ) { + static function registerSource( WikiImportSource $source ) { $id = wfRandomString(); self::$sourceRegistrations[$id] = $source; @@ -1652,13 +1653,31 @@ } /** + * Generic interface for various import sources + */ +interface WikiImportSource { + /** +* Is import source fully consumed? +* @return bool +*/ + function atEnd(); + /** +* Get next chunk of data or false if already consumed +* @return bool|string +*/ + function readChunk(); +} + + +/** * @todo document (e.g. one-sentence class description). * @ingroup SpecialPage */ -class ImportStringSource { +class ImportStringSource implements WikiImportSource { function __construct( $string ) { $this-mString = $string; $this-mRead = false; + wfDebugLog( wikiimporter, ImportStringSource created ); } /** @@ -1673,6 +1692,7 @@ */ function readChunk() { if ( $this-atEnd() ) { + wfDebugLog( wikiimporter, attempt to read past string data ); return false; } $this-mRead = true; @@ -1684,7 +1704,7 @@ * @todo document (e.g. one-sentence class description). * @ingroup SpecialPage */ -class ImportStreamSource { +class ImportStreamSource implements WikiImportSource { function __construct( $handle ) { $this-mHandle = $handle; } @@ -1767,11 +1787,7 @@ # as the Wikimedia cluster, etc. $data = Http::request( $method, $url, array( 'followRedirects' = true ) ); if ( $data !== false ) { - $file = tmpfile(); - fwrite( $file, $data ); - fflush( $file ); - fseek( $file, 0 ); - return Status::newGood( new ImportStreamSource( $file ) ); + return Status::newGood( new ImportStringSource( $data ) ); } else { return Status::newFatal( 'importcantopen' ); } diff --git a/tests/phpunit/includes/ImportTest.php b/tests/phpunit/includes/ImportTest.php index fc7a1ae..4a3015b 100644 --- a/tests/phpunit/includes/ImportTest.php +++ b/tests/phpunit/includes/ImportTest.php @@ -21,6 +21,7 @@ */ public function testHandlePageContainsRedirect( $xml, $redirectTitle ) { $source = $this-getDataSource( $xml ); + wfDebugLog( wikiimportertest, Testing for . var_export( $redirectTitle, true) . ); $redirect = null; $callback = function ( $title, $origTitle, $revCount, $sRevCount, $pageInfo ) use ( $redirect ) { @@ -32,6 +33,7 @@ $importer = new WikiImporter( $source, ConfigFactory::getDefaultInstance()-makeConfig( 'main' ) ); $importer-setPageOutCallback( $callback ); $importer-doImport(); + wfDebugLog( wikiimportertest, Redirect value received is . var_export( $redirect, true ) . ); $this-assertEquals( $redirectTitle, $redirect ); } -- To view, visit
[MediaWiki-commits] [Gerrit] Use ImportStringSource for simple import sources - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/173223 Change subject: Use ImportStringSource for simple import sources .. Use ImportStringSource for simple import sources Bug: 73283 Change-Id: I61c94202467ae6729ae52684a6477f7cbd8e00b7 --- M includes/Import.php M tests/phpunit/includes/ImportTest.php 2 files changed, 31 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/23/173223/1 diff --git a/includes/Import.php b/includes/Import.php index 4eb8e97..9c33496 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -42,10 +42,10 @@ /** * Creates an ImportXMLReader drawing from the source provided -* @param ImportStreamSource $source +* @param WikiImportSource $source * @param Config $config */ - function __construct( ImportStreamSource $source, Config $config = null ) { + function __construct( WikiImportSource $source, Config $config = null ) { $this-reader = new XMLReader(); if ( !$config ) { wfDeprecated( __METHOD__ . ' without a Config instance', '1.25' ); @@ -62,6 +62,7 @@ } else { $this-reader-open( uploadsource://$id ); } + wfDebugLog( wikiimporter, Source $id registered ); // Default callbacks $this-setRevisionCallback( array( $this, importRevision ) ); @@ -913,7 +914,7 @@ * @param ImportStreamSource $source * @return string */ - static function registerSource( ImportStreamSource $source ) { + static function registerSource( WikiImportSource $source ) { $id = wfRandomString(); self::$sourceRegistrations[$id] = $source; @@ -1652,13 +1653,31 @@ } /** + * Generic interface for various import sources + */ +interface WikiImportSource { + /** +* Is import source fully consumed? +* @return bool +*/ + function atEnd(); + /** +* Get next chunk of data or false if already consumed +* @return bool|string +*/ + function readChunk(); +} + + +/** * @todo document (e.g. one-sentence class description). * @ingroup SpecialPage */ -class ImportStringSource { +class ImportStringSource implements WikiImportSource { function __construct( $string ) { $this-mString = $string; $this-mRead = false; + wfDebugLog( wikiimporter, ImportStringSource created ); } /** @@ -1673,6 +1692,7 @@ */ function readChunk() { if ( $this-atEnd() ) { + wfDebugLog( wikiimporter, attempt to read past string data ); return false; } $this-mRead = true; @@ -1684,7 +1704,7 @@ * @todo document (e.g. one-sentence class description). * @ingroup SpecialPage */ -class ImportStreamSource { +class ImportStreamSource implements WikiImportSource { function __construct( $handle ) { $this-mHandle = $handle; } @@ -1767,11 +1787,7 @@ # as the Wikimedia cluster, etc. $data = Http::request( $method, $url, array( 'followRedirects' = true ) ); if ( $data !== false ) { - $file = tmpfile(); - fwrite( $file, $data ); - fflush( $file ); - fseek( $file, 0 ); - return Status::newGood( new ImportStreamSource( $file ) ); + return Status::newGood( new ImportStringSource( $data ) ); } else { return Status::newFatal( 'importcantopen' ); } diff --git a/tests/phpunit/includes/ImportTest.php b/tests/phpunit/includes/ImportTest.php index 678c89b..4a3015b 100644 --- a/tests/phpunit/includes/ImportTest.php +++ b/tests/phpunit/includes/ImportTest.php @@ -9,13 +9,8 @@ */ class ImportTest extends MediaWikiLangTestCase { - private function getInputStreamSource( $xml ) { - $file = 'data:application/xml,' . $xml; - $status = ImportStreamSource::newFromFile( $file ); - if ( !$status-isGood() ) { - throw new MWException( Cannot create InputStreamSource. ); - } - return $status-value; + private function getDataSource( $xml ) { + return new ImportStringSource( $xml ); } /** @@ -25,7 +20,8 @@ * @param string|null $redirectTitle */ public function testHandlePageContainsRedirect( $xml, $redirectTitle ) { - $source = $this-getInputStreamSource( $xml ); + $source = $this-getDataSource( $xml ); +
[MediaWiki-commits] [Gerrit] Skip ImportTest if allow_url_fopen disabled - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/172657 Change subject: Skip ImportTest if allow_url_fopen disabled .. Skip ImportTest if allow_url_fopen disabled Workaround for: Bug: 73283 Change-Id: I7afbf4dba358c89f9ba78042d82c35df1d2258e8 --- M tests/phpunit/includes/ImportTest.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/57/172657/1 diff --git a/tests/phpunit/includes/ImportTest.php b/tests/phpunit/includes/ImportTest.php index 678c89b..d542e8e 100644 --- a/tests/phpunit/includes/ImportTest.php +++ b/tests/phpunit/includes/ImportTest.php @@ -10,6 +10,9 @@ class ImportTest extends MediaWikiLangTestCase { private function getInputStreamSource( $xml ) { + if ( ini_get( 'allow_url_fopen' ) != 1 ) { + $this-markTestSkipped( 'bug 73283: this test needs allow_url_fopen to be enabled' ); + } $file = 'data:application/xml,' . $xml; $status = ImportStreamSource::newFromFile( $file ); if ( !$status-isGood() ) { -- To view, visit https://gerrit.wikimedia.org/r/172657 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7afbf4dba358c89f9ba78042d82c35df1d2258e8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Mark TestORMRowTest as broken - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/172662 Change subject: Mark TestORMRowTest as broken .. Mark TestORMRowTest as broken This test succeeds when run standalone, but fails when a whole suite is run. Bug: 37601 Change-Id: I6208f4701b88594628fb4bac4b9aaaebdd5a7dc8 --- M tests/phpunit/includes/db/TestORMRowTest.php 1 file changed, 11 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/62/172662/1 diff --git a/tests/phpunit/includes/db/TestORMRowTest.php b/tests/phpunit/includes/db/TestORMRowTest.php index ca31cf9..6cbb162 100644 --- a/tests/phpunit/includes/db/TestORMRowTest.php +++ b/tests/phpunit/includes/db/TestORMRowTest.php @@ -24,6 +24,14 @@ * * @ingroup Test * + * @licence GNU GPL v2+ + * @author Jeroen De Dauw jeroended...@gmail.com + */ +require_once __DIR__ . /ORMRowTest.php; + +/** + * @covers TestORMRow + * * @group ORM * * The database group has as a side effect that temporal database tables are created. This makes @@ -35,13 +43,9 @@ * that hold the first tests in a pending state awaiting access to the database. * @group medium * - * @licence GNU GPL v2+ - * @author Jeroen De Dauw jeroended...@gmail.com - */ -require_once __DIR__ . /ORMRowTest.php; - -/** - * @covers TestORMRow + * @group Broken + * Bug 37601: This test cannot be run in isolation; it succeeds + * when run isolated and fails when a whole suite is run */ class TestORMRowTest extends ORMRowTest { -- To view, visit https://gerrit.wikimedia.org/r/172662 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6208f4701b88594628fb4bac4b9aaaebdd5a7dc8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] More debug diagnostics for upload by URL - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/172437 Change subject: More debug diagnostics for upload by URL .. More debug diagnostics for upload by URL Increased debug log verbosity to troubleshoot file upload by URL issues Bug: 73200 Change-Id: I530bd38b85911e0c153280b7d9a9da023f799b02 --- M includes/upload/UploadFromUrl.php 1 file changed, 17 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/37/172437/1 diff --git a/includes/upload/UploadFromUrl.php b/includes/upload/UploadFromUrl.php index b605640..8038d56 100644 --- a/includes/upload/UploadFromUrl.php +++ b/includes/upload/UploadFromUrl.php @@ -231,12 +231,16 @@ * @return int Number of bytes handled */ public function saveTempFileChunk( $req, $buffer ) { + wfDebugLog('fileupload', 'Received chunk of ' . strlen($buffer) . ' bytes'); $nbytes = fwrite( $this-mTmpHandle, $buffer ); if ( $nbytes == strlen( $buffer ) ) { $this-mFileSize += $nbytes; } else { // Well... that's not good! + wfDebugLog('fileupload', 'Short write ' . $this-nbytes . '/' . strlen($buffer) . + ' bytes, aborting with ' . $this-mFileSize . ' uploaded so far' + ); fclose( $this-mTmpHandle ); $this-mTmpHandle = false; } @@ -262,6 +266,7 @@ if ( !$this-mTmpHandle ) { return Status::newFatal( 'tmp-create-error' ); } + wfDebugLog('fileupload', 'Temporary file created ' . $this-mTempPath . ''); $this-mRemoveTempFile = true; $this-mFileSize = 0; @@ -275,6 +280,10 @@ if ( $wgCopyUploadTimeout !isset( $options['timeout'] ) ) { $options['timeout'] = $wgCopyUploadTimeout; } + wfDebugLog( 'fileupload', + 'Starting download from ' . $this-mUrl . ' ' . + '' . implode( ',', array_keys( array_filter( $options ) ) ) . '' + ); $req = MWHttpRequest::factory( $this-mUrl, $options ); $req-setCallback( array( $this, 'saveTempFileChunk' ) ); $status = $req-execute(); @@ -288,8 +297,14 @@ return Status::newFatal( 'tmp-write-error' ); } - if ( !$status-isOk() ) { - return $status; + wfDebugLog( 'fileupload', $status ); + if ( $status-isOk() ) { + wfDebugLog( 'fileupload', 'Download by URL completed successfuly.' ); + } else { + wfDebugLog( 'fileupload', + Download by URL completed mit HTTP status . $req-getStatus() . + \nServer returned: \n\n . file_get_contents( $this-mTempPath ) . + \n); } return $status; -- To view, visit https://gerrit.wikimedia.org/r/172437 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I530bd38b85911e0c153280b7d9a9da023f799b02 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Automatically join mw.api array params with | - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/164886 Change subject: Automatically join mw.api array params with | .. Automatically join mw.api array params with | Change-Id: Ie8ea48712dc7b726266e25080b2931aebe659f0d --- M resources/src/mediawiki.api/mediawiki.api.js 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/86/164886/1 diff --git a/resources/src/mediawiki.api/mediawiki.api.js b/resources/src/mediawiki.api/mediawiki.api.js index b85c8e8..592a37b 100644 --- a/resources/src/mediawiki.api/mediawiki.api.js +++ b/resources/src/mediawiki.api/mediawiki.api.js @@ -49,6 +49,16 @@ * console.log( data ); * } ); * +* Multiple values for the parameter can be specified using an array: +* +* var api = new mw.Api(); +* api.get( { +* action: 'query', +* meta: ['userinfo', 'siteinfo'] +* } ).done ( function ( data ) { +* console.log( data ); +* } ); +* * @class * * @constructor @@ -124,6 +134,12 @@ delete parameters.token; } + for ( key in parameters ) { + if ( parameters[key] instanceof Array ) { + parameters[key] = parameters[key].join( '|' ); + } + } + // If multipart/form-data has been requested and emulation is possible, emulate it if ( ajaxOptions.type === 'POST' -- To view, visit https://gerrit.wikimedia.org/r/164886 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie8ea48712dc7b726266e25080b2931aebe659f0d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] searchSuggest.js: Pass user ns preferences to API - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/164893 Change subject: searchSuggest.js: Pass user ns preferences to API .. searchSuggest.js: Pass user ns preferences to API Bug: 24214 Change-Id: I53ba99bbe9d445262804a8239ac85b48fef4d716 --- M includes/resourceloader/ResourceLoaderUserOptionsModule.php M resources/Resources.php M resources/src/mediawiki/mediawiki.searchSuggest.js 3 files changed, 23 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/93/164893/1 diff --git a/includes/resourceloader/ResourceLoaderUserOptionsModule.php b/includes/resourceloader/ResourceLoaderUserOptionsModule.php index bd97a8e..f9f5d72 100644 --- a/includes/resourceloader/ResourceLoaderUserOptionsModule.php +++ b/includes/resourceloader/ResourceLoaderUserOptionsModule.php @@ -58,12 +58,30 @@ public function getScript( ResourceLoaderContext $context ) { global $wgUser; return Xml::encodeJsCall( 'mw.user.options.set', - array( $wgUser-getOptions() ), + array( $wgUser-getOptions() + $this-getSearchNs( $wgUser-getOptions() ) ), ResourceLoader::inDebugMode() ); } /** +* Convert searchNsXXX into one array of namespaces to search +* +* @param array +* @return array +*/ + protected function getSearchNS( $options ) { + $namespaces = array(); + foreach( $options as $optname = $optval ) { + if ( strpos( $optname, 'searchNs' ) === 0 ) { + if ( $optval ) { + $namespaces[] = substr( $optname, 8 ); + } + } + } + return array( 'searchNS' = $namespaces ); + } + + /** * @return bool */ public function supportsURLLoading() { diff --git a/resources/Resources.php b/resources/Resources.php index 53759a6..bee745a 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -929,6 +929,7 @@ 'jquery.placeholder', 'jquery.suggestions', 'mediawiki.api', + 'user.options', ), ), 'mediawiki.Title' = array( @@ -966,7 +967,8 @@ 'scripts' = 'resources/src/mediawiki/mediawiki.userSuggest.js', 'dependencies' = array( 'jquery.suggestions', - 'mediawiki.api' + 'mediawiki.api', + 'user.options' ) ), 'mediawiki.util' = array( diff --git a/resources/src/mediawiki/mediawiki.searchSuggest.js b/resources/src/mediawiki/mediawiki.searchSuggest.js index a214cb3..7aa 100644 --- a/resources/src/mediawiki/mediawiki.searchSuggest.js +++ b/resources/src/mediawiki/mediawiki.searchSuggest.js @@ -130,7 +130,7 @@ $.data( node, 'request', api.get( { action: 'opensearch', search: query, - namespace: 0, + namespace: mw.user.options.get( 'searchNS' ), suggest: '' } ).done( function ( data ) { response( data[ 1 ] ); -- To view, visit https://gerrit.wikimedia.org/r/164893 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53ba99bbe9d445262804a8239ac85b48fef4d716 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Do not hide real DB error on first connect - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/157488 Change subject: Do not hide real DB error on first connect .. Do not hide real DB error on first connect LoadBalancer should not silence database exception. Bug: 70223 Change-Id: I0ded13f9f7a2ab93a070224e7448cda34ac83df1 --- M includes/db/LoadBalancer.php 1 file changed, 1 insertion(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/88/157488/1 diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index db4ed60..26ab05b 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -714,14 +714,7 @@ } # Create object - try { - $db = DatabaseBase::factory( $server['type'], $server ); - } catch ( DBConnectionError $e ) { - // FIXME: This is probably the ugliest thing I have ever done to - // PHP. I'm half-expecting it to segfault, just out of disgust. -- TS - $db = $e-db; - } - + $db = DatabaseBase::factory( $server['type'], $server ); $db-setLBInfo( $server ); if ( isset( $server['fakeSlaveLag'] ) ) { $db-setFakeSlaveLag( $server['fakeSlaveLag'] ); -- To view, visit https://gerrit.wikimedia.org/r/157488 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ded13f9f7a2ab93a070224e7448cda34ac83df1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Schema is not PostgreSQL connection parameter - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/156349 Change subject: Schema is not PostgreSQL connection parameter .. Schema is not PostgreSQL connection parameter Temporary fix for bug 70030. openConnectionWithParams() got a new schema parameter in 30a82aae9cf and therefore must not be used to probe some available databases when checking username/password, because schema is not at all a PostgreSQL connection parameter - it something similar to current directory in the database. PostgreSQL can additionally search additional schemas for objects in necessary. This whole openPgConnection logic needs some deeper repair; for now however, let's quickly fix bug 70030 which is caused by that fact that openConnectionWithParams returns magic Status object and no longer a DatabasePostgres instance we can directly talk to. As a result, openPgConnection( create-db ) was returning a Status object that had another Status object embedded in the value field. This reverts partially commit 30a82aae9cf7e5536eef761637a1277b7c18017e. Conflicts: includes/installer/Installer.php includes/installer/PostgresInstaller.php maintenance/install.php Bug: 70030 Change-Id: I61d5f262e60722bc08201b40b61a298d8af42223 --- M includes/installer/PostgresInstaller.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/49/156349/1 diff --git a/includes/installer/PostgresInstaller.php b/includes/installer/PostgresInstaller.php index 6dcce23..c30a989 100644 --- a/includes/installer/PostgresInstaller.php +++ b/includes/installer/PostgresInstaller.php @@ -262,11 +262,11 @@ $status = Status::newGood(); foreach ( $dbs as $db ) { try { - $conn = $this-openConnectionWithParams( + $conn = new DatabasePostgres( + $this-getVar( 'wgDBserver' ), $user, $password, - $db, - $this-getVar( 'wgDBmwschema' ) ); + $db ); } catch ( DBConnectionError $error ) { $conn = false; $status-fatal( 'config-pg-test-error', $db, -- To view, visit https://gerrit.wikimedia.org/r/156349 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61d5f262e60722bc08201b40b61a298d8af42223 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Installer: Do not use Vector skin if not installed - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/156440 Change subject: Installer: Do not use Vector skin if not installed .. Installer: Do not use Vector skin if not installed MediaWiki installer works fine in a bareskin mode without Vector features, so do not throw errors in the PHP error log just because we don't have skins project extracted. The message in the PHP error log: Warning: include_once(w/skins/Vector/Vector.php): failed to open stream: No such file or directory in w/includes/installer/WebInstallerOutput.php on line 135 Stack trace: 1. {main}() w/mw-config/index.php:0 2. wfInstallerMain() w/mw-config/index.php:38 3. WebInstaller-execute() w/mw-config/index.php:79 4. WebInstaller-outputCss() w/includes/installer/WebInstaller.php:185 5. WebInstallerOutput-getCSS() w/includes/installer/WebInstaller.php:1200 Warning: include_once(): Failed opening 'w/skins/Vector/Vector.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php') in w/includes/installer/WebInstallerOutput.php on line 135 Stack trace: 1. {main}() w/mw-config/index.php:0 2. wfInstallerMain() w/mw-config/index.php:38 3. WebInstaller-execute() w/mw-config/index.php:79 4. WebInstaller-outputCss() w/includes/installer/WebInstaller.php:185 5. WebInstallerOutput-getCSS() w/includes/installer/WebInstaller.php:1200 Change-Id: I7b8bd77f5868af2ccf464e48db771f2e8e0472ff --- M includes/installer/WebInstallerOutput.php 1 file changed, 38 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/40/156440/1 diff --git a/includes/installer/WebInstallerOutput.php b/includes/installer/WebInstallerOutput.php index f797ef9..0e48985 100644 --- a/includes/installer/WebInstallerOutput.php +++ b/includes/installer/WebInstallerOutput.php @@ -129,46 +129,50 @@ // We need the 'global' statement for $wgResourceModules because the Vector skin adds the // definitions for its RL modules there that we use implicitly below. // @codingStandardsIgnoreStart + global $wgResourceModules; // This is NOT UNUSED! // @codingStandardsIgnoreEnd global $wgStyleDirectory; - include_once $wgStyleDirectory/Vector/Vector.php; - - $moduleNames = array( - // See SkinTemplate::setupSkinUserCss - 'mediawiki.legacy.shared', - // See Vector::setupSkinUserCss - 'mediawiki.skinning.interface', - 'skins.vector.styles', - - 'mediawiki.legacy.config', - ); - $css = ''; - $resourceLoader = new ResourceLoader(); - $rlContext = new ResourceLoaderContext( $resourceLoader, new FauxRequest( array( - 'debug' = 'true', - 'lang' = $this-getLanguageCode(), - 'only' = 'styles', - 'skin' = 'vector', - ) ) ); - foreach ( $moduleNames as $moduleName ) { - /** @var ResourceLoaderFileModule $module */ - $module = $resourceLoader-getModule( $moduleName ); - // One of the modules will be missing if Vector is unavailable - if ( !$module ) { - continue; + if( file_exists( $wgStyleDirectory/Vector/Vector.php )) { + include_once $wgStyleDirectory/Vector/Vector.php; + + $moduleNames = array( + // See SkinTemplate::setupSkinUserCss + 'mediawiki.legacy.shared', + // See Vector::setupSkinUserCss + 'mediawiki.skinning.interface', + 'skins.vector.styles', + + 'mediawiki.legacy.config', + ); + + + $resourceLoader = new ResourceLoader(); + $rlContext = new ResourceLoaderContext( $resourceLoader, new FauxRequest( array( + 'debug' = 'true', + 'lang' = $this-getLanguageCode(), + 'only' = 'styles', + 'skin' = 'vector', + ) ) ); + foreach ( $moduleNames as $moduleName ) { + /** @var ResourceLoaderFileModule $module */ + $module = $resourceLoader-getModule( $moduleName ); + // One of the modules will be missing if Vector is unavailable + if ( !$module ) {
[MediaWiki-commits] [Gerrit] Provide rudimentary __toString() for Status - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/156446 Change subject: Provide rudimentary __toString() for Status .. Provide rudimentary __toString() for Status maintenance/eval.php is much easier to use now, you can just print $statusInstance; I specifically don't want to dig into proper formatting of error messages, as calling getMessage() in few places (from installer for example) gets me in trouble with database access and what not. Change-Id: I068b0f54b16d618a1f6115133632885e8e45e897 --- M includes/Status.php 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/46/156446/1 diff --git a/includes/Status.php b/includes/Status.php index 1a72968..ff89d62 100644 --- a/includes/Status.php +++ b/includes/Status.php @@ -453,4 +453,11 @@ public function getValue() { return $this-value; } + + /** +* @return string +*/ + public function __toString() { + return $this-isOK() ? (OK) : (Error); + } } -- To view, visit https://gerrit.wikimedia.org/r/156446 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I068b0f54b16d618a1f6115133632885e8e45e897 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove okawix/ZENO support - change (mediawiki...Collection)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/129929 Change subject: Remove okawix/ZENO support .. Remove okawix/ZENO support Okawix rendering server URLs do not work anymore. It seems that that project faded into oblivion. Bug: 64359 Change-Id: I7015add478ec2841c7c49b505991bef36dbcda5f --- M Collection.php M README.txt 2 files changed, 1 insertion(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection refs/changes/29/129929/1 diff --git a/Collection.php b/Collection.php index ee3abb3..aa82ba6 100644 --- a/Collection.php +++ b/Collection.php @@ -101,8 +101,6 @@ as mapping of mwlib writer to format name */ $wgCollectionFormats = array( 'rl' = 'PDF', - #'zeno' = 'ZENO', - #'okawix_zeno' = 'Okawix (ZENO + search engine)', ); /** Additional renderer options for collections. Format is as for @@ -138,10 +136,7 @@ /** For formats which rendering depends on an external server */ -$wgCollectionFormatToServeURL = array( - 'zeno' = 'http://www.okawix.com/collections/render.php', - 'okawix_zeno' = 'http://www.okawix.com/collections/render.php', -); +$wgCollectionFormatToServeURL = array(); $wgCollectionContentTypeToFilename = array( 'application/pdf' = 'collection.pdf', diff --git a/README.txt b/README.txt index 5cc8f3f..6b384a3 100644 --- a/README.txt +++ b/README.txt @@ -334,13 +334,6 @@ Coll-savedbook_template, i.e. by editing [[MediaWiki:Coll- savedbook_template]]. -* To enable ZENO and Okawix export, uncomment the corresponding lines - in $wgCollectionFormats (file Collection.php). These exports are - devoted to the Wikimedia projects and their mirrors. - - They cannot be used on other wikis since they get data and search - engine indexes from the cache of wikiwix.com. - Customization via System Messages = -- To view, visit https://gerrit.wikimedia.org/r/129929 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7015add478ec2841c7c49b505991bef36dbcda5f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Let BlockTest.php respect database constraints - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/100334 Change subject: Let BlockTest.php respect database constraints .. Let BlockTest.php respect database constraints This is an attempt to make BlockTest not to fail with database referential constraints enabled (from I326bb4a189bf881299b9fb678033a927b916efac) Bug: 58191 Change-Id: I45c2d466f77d4d0aa25e880b5bb7d1120c39a561 --- M tests/phpunit/includes/BlockTest.php 1 file changed, 7 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/34/100334/1 diff --git a/tests/phpunit/includes/BlockTest.php b/tests/phpunit/includes/BlockTest.php index f0049fe..dafdfdc 100644 --- a/tests/phpunit/includes/BlockTest.php +++ b/tests/phpunit/includes/BlockTest.php @@ -141,6 +141,7 @@ $username = 'BlockedUserToCreateAccountWith'; $u = User::newFromName( $username ); $u-setPassword( 'NotRandomPass' ); + $u-setId( 14146 ); $u-addToDatabase(); unset( $u ); @@ -208,6 +209,12 @@ $oldBlock-delete(); } + // Local perspective (blockee on current wiki)... + $user = User::newFromName( 'UserOnForeignWiki' ); + $user-addToDatabase(); + // Set user ID to match the test value + $this-db-update( 'user', array( 'user_id' = 14146 ), array( 'user_id' = $user-getId() ) ); + // Foreign perspective (blockee not on current wiki)... $block = new Block( /* $address */ 'UserOnForeignWiki', @@ -229,11 +236,6 @@ $res = $block-insert( $this-db ); $this-assertTrue( (bool)$res['id'], 'Block succeeded' ); - // Local perspective (blockee on current wiki)... - $user = User::newFromName( 'UserOnForeignWiki' ); - $user-addToDatabase(); - // Set user ID to match the test value - $this-db-update( 'user', array( 'user_id' = 14146 ), array( 'user_id' = $user-getId() ) ); $user = null; // clear $block = Block::newFromID( $res['id'] ); -- To view, visit https://gerrit.wikimedia.org/r/100334 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I45c2d466f77d4d0aa25e880b5bb7d1120c39a561 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Crude way to recreate PgSQL references in tables - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/100141 Change subject: Crude way to recreate PgSQL references in tables .. Crude way to recreate PgSQL references in tables This is a crude way to re-apply all reference checks (foreign key constraints) to see how that impacts unit testing code. This is work in progress, do not merge. Bug: 37702 Change-Id: I326bb4a189bf881299b9fb678033a927b916efac --- M includes/db/CloneDatabase.php M includes/db/Database.php M includes/db/DatabasePostgres.php A maintenance/postgres/archives/refs.sql 4 files changed, 240 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/41/100141/1 diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 1e01d29..5b0829c 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -109,6 +109,7 @@ wfDebug( __METHOD__ . duplicating $oldTableName to $newTableName\n, true ); $this-db-duplicateTableStructure( $oldTableName, $newTableName, $this-useTemporaryTables ); } + $this-db-recreateReferences(); } /** diff --git a/includes/db/Database.php b/includes/db/Database.php index fa12595..164cd2e 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -3525,6 +3525,9 @@ 'DatabaseBase::duplicateTableStructure is not implemented in descendant class' ); } + public function recreateReferences( ) { + } + /** * List all tables on the database * diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index cfa2074..30d87a7 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -1039,7 +1039,11 @@ $oldName = $this-addIdentifierQuotes( $oldName ); return $this-query( 'CREATE ' . ( $temporary ? 'TEMPORARY ' : '' ) . TABLE $newName . - (LIKE $oldName INCLUDING DEFAULTS), $fname ); + (LIKE $oldName INCLUDING ALL), $fname ); + } + + public function recreateReferences( ) { + $this-sourceFile( $this-patchPath( refs.sql ) ); } function listTables( $prefix = null, $fname = __METHOD__ ) { diff --git a/maintenance/postgres/archives/refs.sql b/maintenance/postgres/archives/refs.sql new file mode 100644 index 000..a6bff17 --- /dev/null +++ b/maintenance/postgres/archives/refs.sql @@ -0,0 +1,231 @@ +-- Name: archive_ar_user_fkey; Type: FK CONSTRAINT; Schema: mediawiki; Owner: wikiuser +-- + +INSERT INTO unittest_mwuser SELECT * FROM mwuser; + +ALTER TABLE ONLY unittest_archive +ADD CONSTRAINT ut_archive_ar_user_fkey FOREIGN KEY (ar_user) REFERENCES unittest_mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED; + + +-- +-- Name: categorylinks_cl_from_fkey; Type: FK CONSTRAINT; Schema: mediawiki; Owner: wikiuser +-- + +ALTER TABLE ONLY unittest_categorylinks +ADD CONSTRAINT ut_categorylinks_cl_from_fkey FOREIGN KEY (cl_from) REFERENCES unittest_page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED; + + +-- +-- Name: externallinks_el_from_fkey; Type: FK CONSTRAINT; Schema: mediawiki; Owner: wikiuser +-- + +ALTER TABLE ONLY unittest_externallinks +ADD CONSTRAINT ut_externallinks_el_from_fkey FOREIGN KEY (el_from) REFERENCES unittest_page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED; + + +-- +-- Name: filearchive_fa_deleted_user_fkey; Type: FK CONSTRAINT; Schema: mediawiki; Owner: wikiuser +-- + +ALTER TABLE ONLY unittest_filearchive +ADD CONSTRAINT ut_filearchive_fa_deleted_user_fkey FOREIGN KEY (fa_deleted_user) REFERENCES unittest_mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED; + + +-- +-- Name: filearchive_fa_user_fkey; Type: FK CONSTRAINT; Schema: mediawiki; Owner: wikiuser +-- + +ALTER TABLE ONLY unittest_filearchive +ADD CONSTRAINT ut_filearchive_fa_user_fkey FOREIGN KEY (fa_user) REFERENCES unittest_mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED; + + +-- +-- Name: image_img_user_fkey; Type: FK CONSTRAINT; Schema: mediawiki; Owner: wikiuser +-- + +ALTER TABLE ONLY unittest_image +ADD CONSTRAINT ut_image_img_user_fkey FOREIGN KEY (img_user) REFERENCES unittest_mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED; + + +-- +-- Name: imagelinks_il_from_fkey; Type: FK CONSTRAINT; Schema: mediawiki; Owner: wikiuser +-- + +ALTER TABLE ONLY unittest_imagelinks +ADD CONSTRAINT ut_imagelinks_il_from_fkey FOREIGN KEY (il_from) REFERENCES unittest_page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED; + + +-- +-- Name: ipblocks_ipb_by_fkey; Type: FK CONSTRAINT; Schema: mediawiki; Owner: wikiuser +-- + +ALTER TABLE ONLY unittest_ipblocks +ADD CONSTRAINT
[MediaWiki-commits] [Gerrit] Insert test page into DB not to violate constraint - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/100154 Change subject: Insert test page into DB not to violate constraint .. Insert test page into DB not to violate constraint Page with id 0 does not exist at the time transaction is committed to the database. Unit tests with table constraints enabled fail with: 1) RevisionStorageTest::testUserWasLastToEdit with data set #0 (3, true) DBQueryError: A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script Query: INSERT INTO unittest_revision (rev_id,rev_page,rev_text_id /* more fields */ ) VALUES ('461','0','460' /* more fields */ Function: Revision::insertOn Error: 23503 ERROR: insert or update on table unittest_revision violates foreign key constraint ut_revision_rev_page_fkey DETAIL: Key (rev_page)=(0) is not present in table unittest_page. /usr/home/saper/test/mytest/includes/db/Database.php: /usr/home/saper/test/mytest/includes/db/DatabasePostgres.php:511 /usr/home/saper/test/mytest/includes/db/Database.php:1077 /usr/home/saper/test/mytest/includes/db/DatabasePostgres.php:871 /usr/home/saper/test/mytest/includes/Revision.php:1422 /usr/home/saper/test/mytest/tests/phpunit/includes/RevisionStorageTest.php:488 /usr/home/saper/test/mytest/tests/phpunit/MediaWikiTestCase.php:123 /usr/home/saper/test/mytest/tests/phpunit/MediaWikiPHPUnitCommand.php:80 /usr/home/saper/test/mytest/tests/phpunit/MediaWikiPHPUnitCommand.php:64 /usr/home/saper/test/mytest/tests/phpunit/phpunit.php:115 Change-Id: I653a8bccdaa748a9bea453cd1dbf609a30e1ff6f --- M tests/phpunit/includes/RevisionStorageTest.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/54/100154/1 diff --git a/tests/phpunit/includes/RevisionStorageTest.php b/tests/phpunit/includes/RevisionStorageTest.php index 7e275a5..cd2a23a 100644 --- a/tests/phpunit/includes/RevisionStorageTest.php +++ b/tests/phpunit/includes/RevisionStorageTest.php @@ -474,6 +474,7 @@ // create revisions - $page = WikiPage::factory( Title::newFromText( 'RevisionStorageTest_testUserWasLastToEdit', $ns ) ); + $page-insertOn( $dbw ); # zero $revisions[0] = new Revision( array( -- To view, visit https://gerrit.wikimedia.org/r/100154 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I653a8bccdaa748a9bea453cd1dbf609a30e1ff6f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Database independent test for bug 37601 - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/100180 Change subject: Database independent test for bug 37601 .. Database independent test for bug 37601 ORMTable/ORMRow should not attempt to write NULL primary key during INSERT, this only works for MySQL AUTO_INCREMENT. Break encapsulation a bit and get into testing of the most important method of ORMTable, getWriteValues(). Bug: 37601 Change-Id: Iebe9d6ff73fac930b456b24b6317cafb56d0163f --- M tests/phpunit/includes/db/ORMRowTest.php M tests/phpunit/includes/db/TestORMRowTest.php 2 files changed, 71 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/80/100180/1 diff --git a/tests/phpunit/includes/db/ORMRowTest.php b/tests/phpunit/includes/db/ORMRowTest.php index 27d4d0e..8c32405 100644 --- a/tests/phpunit/includes/db/ORMRowTest.php +++ b/tests/phpunit/includes/db/ORMRowTest.php @@ -135,6 +135,28 @@ } /** +* Test for bug 37601: +* +* ID values should not be written to the database with INSERTs and UPDATEs +* +* @dataProvider constructorTestProvider +*/ + public function testPrimaryKeyNotWritten( array $data, $loadDefaults ) { + $rowundertest = $this-getRowInstance( $data, $loadDefaults ); + + $real_id_name = $rowundertest-exposeTablePrefixedField( id ); + /* $real_id_field_name should return something like page_id */ + + /* +* As ORMTable::getWriteValues() determines what actually +* ends up in INSERTs and UPDATEs, we make sure primary key +* is not there +*/ + $this-assertArrayNotHasKey( $real_id_name, + $rowundertest-exposeTableWriteValues() ); + } + + /** * @dataProvider constructorTestProvider */ public function testSaveAndRemove( array $data, $loadDefaults ) { diff --git a/tests/phpunit/includes/db/TestORMRowTest.php b/tests/phpunit/includes/db/TestORMRowTest.php index c9459c9..cc804ba 100644 --- a/tests/phpunit/includes/db/TestORMRowTest.php +++ b/tests/phpunit/includes/db/TestORMRowTest.php @@ -146,6 +146,40 @@ } class TestORMRow extends ORMRow { + /** +* Testing for bug 37601: +* +* Expose protected ORMTable::getWritableValues() +* We are NOT interested in ORMRow::getWritableValues(), +* since it is apparently not used. +* +* We need this to successfully test that method. +* @since 1.22 +* +* @return string +*/ + public function exposeTableWriteValues() { + return $this-table-exposeWriteValues( $this ); + } + + /** +* Testing for bug 37601: +* +* Expose ORMTable::getPrefixedField() +* ORMRow does not have this information and should not +* have it since prefix is table-dependent +* +* We need this to successfully test ORMTable::getWritableValues() +* @since 1.22 +* +* @param string $field_name virtual (i.e. ORM'd) name of the field +* for example: id should yield page_id +* for table page +* @return string +*/ + public function exposeTablePrefixedField( $field_name ) { + return $this-table-getPrefixedField( $field_name ); + } } class TestORMTable extends ORMTable { @@ -215,4 +249,19 @@ protected function getFieldPrefix() { return 'test_'; } + + /** +* Testing for bug 37601: +* +* Expose protected ORMTable::getWritableValues() +* since it is apparently not used. +* +* We need this to successfully test that method. +* @since 1.22 +* +* @return string +*/ + public function exposeWriteValues( $row ) { + return $this-getWriteValues( $row ); + } } -- To view, visit https://gerrit.wikimedia.org/r/100180 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iebe9d6ff73fac930b456b24b6317cafb56d0163f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Teach ORMTable to use sequences - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/100183 Change subject: Teach ORMTable to use sequences .. Teach ORMTable to use sequences ORMTable should not depend on Database::insertId() without using Database::nextSequenceValue() for portability. This is probably a partial fix (beginning of the way, really) and does not solve fully all issues related to this bug, I suppose. Plus it's MySQL/PostgreSQL only - ORMTable needs to figure out how to treat Oracle anyway. Bug: 37601 Change-Id: I5d68ce327261f897a774993c165e8161e654b2c6 --- M includes/db/ORMTable.php 1 file changed, 27 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/83/100183/1 diff --git a/includes/db/ORMTable.php b/includes/db/ORMTable.php index e47bc67..9276955 100644 --- a/includes/db/ORMTable.php +++ b/includes/db/ORMTable.php @@ -955,6 +955,20 @@ } /** +* Return the names of the primary key sequence +* Current implementation is PostgreSQL only +* +* @since 1.22 +* +* @return array +*/ + public function getPrimaryKeySequenceName() { + return sprintf( %s_%s_seq, + $this-getName(), + $this-getPrefixedField( id ) ); + } + + /** * Gets if the object can take a certain field. * * @since 1.20 @@ -1007,9 +1021,15 @@ public function insertRow( IORMRow $row, $functionName = null, array $options = null ) { $dbw = $this-getWriteDbConnection(); + // this is null for databases that do not have sequences (e.g. MySQL) + $idval = $dbw-nextSequenceValue( $this-getPrimaryKeySequenceName() ); + + $values = $this-getWriteValues( $row ); + $values[ $this-getPrefixedField( id )] = $idval; + $success = $dbw-insert( $this-getName(), - $this-getWriteValues( $row ), + $values, is_null( $functionName ) ? __METHOD__ : $functionName, $options ); @@ -1018,7 +1038,7 @@ $success = $success !== false; if ( $success ) { - $row-setField( 'id', $dbw-insertId() ); + $row-setField( 'id', (integer)$dbw-insertId() ); } $this-releaseConnection( $dbw ); @@ -1044,6 +1064,11 @@ if ( array_key_exists( $name, $rowFields ) ) { $value = $rowFields[$name]; + // Skip null id fields so that the DBMS can set the default. + if ( $name === 'id' is_null( $value ) ) { + continue; + } + switch ( $type ) { case 'array': $value = (array)$value; -- To view, visit https://gerrit.wikimedia.org/r/100183 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5d68ce327261f897a774993c165e8161e654b2c6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't assume test user has ID 1 in SpecialPageTest - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/99640 Change subject: Don't assume test user has ID 1 in SpecialPageTest .. Don't assume test user has ID 1 in SpecialPageTest SpecialPageTest seems to assume the first database user has ID number 1. In case of the current PostgreSQL test setup it does not have to be the case. This query: Query pgtest01 (101) (slave): SELECT /* User::loadFromDatabase 127.0.0.1 */ user_id /* more fields */ FROM unittest_mwuser WHERE user_id = '1' LIMIT 1 fails, because UTSysop has been added by the test setup before with some other ID: Query pgtest01 (65) (slave): INSERT /* User::addToDatabase 127.0.0.1 */ INTO unittest _mwuser (user_id,user_name /* more fields */ VALUES ('322','UTSysop' /* more values */ Change-Id: I7b0a6a9001765111669051d57e675e588b71ba17 --- M tests/phpunit/includes/SpecialPageTest.php 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/40/99640/1 diff --git a/tests/phpunit/includes/SpecialPageTest.php b/tests/phpunit/includes/SpecialPageTest.php index 65057a5..0ee335a 100644 --- a/tests/phpunit/includes/SpecialPageTest.php +++ b/tests/phpunit/includes/SpecialPageTest.php @@ -102,8 +102,7 @@ public function testRequireLoginNotAnon() { $specialPage = new SpecialPage( 'Watchlist', 'viewmywatchlist' ); - $user = User::newFromId( 0 ); - $user-setId( 1 ); + $user = User::newFromName( UTSysop ); $specialPage-getContext()-setUser( $user ); $specialPage-requireLogin(); -- To view, visit https://gerrit.wikimedia.org/r/99640 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7b0a6a9001765111669051d57e675e588b71ba17 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wfWarn() should NOT cause unit tests to fail - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/99648 Change subject: wfWarn() should NOT cause unit tests to fail .. wfWarn() should NOT cause unit tests to fail wfWarn is used in Database::rollback so whenever something goes wrong with no transaction open (easy in PostgreSQL) we get a useless No transaction to rollback, something got out of sync message instead of the real problem. This brings $wgDevelopmentWarnings back to its default false. This reverts commit 4b291909e0e91ad4e8ed98030c1312a872ca3bd4. Conflicts: tests/phpunit/phpunit.php Bug: 58095 Change-Id: I4ba7dac6e45db157ff1ca8807c5fd3f35a3b59f5 --- M tests/phpunit/phpunit.php 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/48/99648/1 diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 401b8a8..319b424 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -31,13 +31,9 @@ global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType; global $wgLanguageConverterCacheType, $wgUseDatabaseMessages; global $wgLocaltimezone, $wgLocalisationCacheConf; - global $wgDevelopmentWarnings; // Inject test autoloader require_once __DIR__ . '/../TestsAutoLoader.php'; - - // wfWarn should cause tests to fail - $wgDevelopmentWarnings = true; $wgMainCacheType = CACHE_NONE; $wgMessageCacheType = CACHE_NONE; -- To view, visit https://gerrit.wikimedia.org/r/99648 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ba7dac6e45db157ff1ca8807c5fd3f35a3b59f5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add missng uploadstash.us_props for PostgreSQL - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/99676 Change subject: Add missng uploadstash.us_props for PostgreSQL .. Add missng uploadstash.us_props for PostgreSQL This field was introduced in e5d41cca909a8ec1b19c6c080388c885854be3f7 but only for MySQL. Change-Id: I057b1dd845a5ab7ae05f5597454981a6e2c12698 --- M includes/installer/PostgresUpdater.php M maintenance/postgres/tables.sql 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/76/99676/1 diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index e8a1c80..dd07bc2 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -169,6 +169,7 @@ INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('archive_ar_id_seq') ), array( 'addPgField', 'externallinks', 'el_id', INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('externallinks_el_id_seq') ), + array( 'addPgField', 'uploadstash', 'us_props', BYTEA ), # type changes array( 'changeField', 'archive', 'ar_deleted', 'smallint', '' ), diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index d0d1e92..37c8cf6 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -376,6 +376,7 @@ us_key TEXT, us_orig_pathTEXT, us_path TEXT, + us_propsBYTEA, us_source_type TEXT, us_timestampTIMESTAMPTZ, us_status TEXT, -- To view, visit https://gerrit.wikimedia.org/r/99676 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I057b1dd845a5ab7ae05f5597454981a6e2c12698 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Installer reports undefined noFollow - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/99731 Change subject: Installer reports undefined noFollow .. Installer reports undefined noFollow Change-Id: I4c3dffa2ad7f4a23262a70e5f99acae6531ebf05 --- M includes/installer/LocalSettingsGenerator.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/31/99731/1 diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 2433fbd..131df68 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -209,6 +209,7 @@ $metaNamespace = \$wgMetaNamespace = \{$this-values['wgMetaNamespace']}\;\n; } + $noFollow = ''; $groupRights = ''; if ( $this-groupPermissions ) { $groupRights .= # The following permissions were set based on your choice in the installer\n; @@ -220,7 +221,6 @@ wfBoolToStr( $perm ) . ;\n; } } - $noFollow = ''; if ( $this-groupPermissions['*']['edit'] === false $this-groupPermissions['*']['createaccount'] === false $this-groupPermissions['*']['read'] !== false ) { -- To view, visit https://gerrit.wikimedia.org/r/99731 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4c3dffa2ad7f4a23262a70e5f99acae6531ebf05 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't testHumanTimestamp until expectations known - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/99349 Change subject: Don't testHumanTimestamp until expectations known .. Don't testHumanTimestamp until expectations known This test fails with extension clrd installed, because it is not clear what getHumanTimestamp() should return and how extension hooks should influence the test scenario Change-Id: I161256bb46f6821b2223eff7ac85b1c80660b0c0 Bug-Id: 55886 --- M tests/phpunit/includes/TimestampTest.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/49/99349/1 diff --git a/tests/phpunit/includes/TimestampTest.php b/tests/phpunit/includes/TimestampTest.php index 5338839..1343a9c 100644 --- a/tests/phpunit/includes/TimestampTest.php +++ b/tests/phpunit/includes/TimestampTest.php @@ -84,6 +84,7 @@ $expectedOutput, // The expected output $desc // Description ) { + $this-markTestSkipped(Bug 55886: It should perhaps be clarified what the getHumanTimestamp is expected to return.); $user = $this-getMock( 'User' ); $user-expects( $this-any() ) -method( 'getOption' ) -- To view, visit https://gerrit.wikimedia.org/r/99349 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I161256bb46f6821b2223eff7ac85b1c80660b0c0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Restore recentchanges.rc_cur_time (breaks psql) - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/99068 Change subject: Restore recentchanges.rc_cur_time (breaks psql) .. Restore recentchanges.rc_cur_time (breaks psql) This reverts commit 974562aee92a78be82cf8e1416ef44648bb7dbb7. Removing rc_cur_time from SQL statements causes this error when installing a new wiki on PostgreSQL: Query: INSERT INTO recentchanges (rc_timestamp,rc_namespace,rc_title,rc_type,rc_source,rc_minor,rc_cur_id,rc_user,rc_user_text,rc_comment,rc_this_oldid,rc_last_oldid,rc_bot,rc_ip,rc_patrolled,rc_new,rc_old_len,rc_new_len,rc_deleted,rc_logid,rc_log_type,rc_log_action,rc_params,rc_id) VALUES ('2013-12-04 10:54:26 GMT','0','Main_Page','1','mw.new','0','1','0','MediaWiki default',,'1','0','0','127.0.0.1','0','1','0','524','0','0',NULL,,,'1') Function: RecentChange::save Error: 23502 ERROR: null value in column rc_cur_time violates not-null constraint This is because rc_cur_time in NOT NULL with no default value on PostgreSQL. Conflicts: includes/changes/RecentChange.php Change-Id: I66034fad8a1cf5485b5daf0421378a28ca58beab Bug-Id: 40667 --- M includes/changes/RecentChange.php M maintenance/rebuildrecentchanges.php M maintenance/tables.sql 3 files changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/68/99068/1 diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 0ef71c4..315c47e 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -26,6 +26,7 @@ * mAttribs: * rc_id id of the row in the recentchanges table * rc_timestamptime the entry was made + * rc_cur_time timestamp on the cur row * rc_namespacenamespace # * rc_titlenon-prefixed db key * rc_type is new entry, used to determine whether updating is necessary @@ -158,6 +159,7 @@ return array( 'rc_id', 'rc_timestamp', + 'rc_cur_time', 'rc_user', 'rc_user_text', 'rc_namespace', @@ -258,6 +260,7 @@ # Fixup database timestamps $this-mAttribs['rc_timestamp'] = $dbw-timestamp( $this-mAttribs['rc_timestamp'] ); + $this-mAttribs['rc_cur_time'] = $dbw-timestamp( $this-mAttribs['rc_cur_time'] ); $this-mAttribs['rc_id'] = $dbw-nextSequenceValue( 'recentchanges_rc_id_seq' ); ## If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL @@ -507,6 +510,7 @@ $rc-mPerformer = $user; $rc-mAttribs = array( 'rc_timestamp' = $timestamp, + 'rc_cur_time' = $timestamp, 'rc_namespace' = $title-getNamespace(), 'rc_title' = $title-getDBkey(), 'rc_type' = RC_EDIT, @@ -567,6 +571,7 @@ $rc-mPerformer = $user; $rc-mAttribs = array( 'rc_timestamp' = $timestamp, + 'rc_cur_time' = $timestamp, 'rc_namespace' = $title-getNamespace(), 'rc_title' = $title-getDBkey(), 'rc_type' = RC_NEW, @@ -679,6 +684,7 @@ $rc-mPerformer = $user; $rc-mAttribs = array( 'rc_timestamp' = $timestamp, + 'rc_cur_time' = $timestamp, 'rc_namespace' = $target-getNamespace(), 'rc_title' = $target-getDBkey(), 'rc_type' = RC_LOG, @@ -735,6 +741,7 @@ wfDeprecated( __METHOD__, '1.22' ); $this-mAttribs = array( 'rc_timestamp' = wfTimestamp( TS_MW, $row-rev_timestamp ), + 'rc_cur_time' = $row-rev_timestamp, 'rc_user' = $row-rev_user, 'rc_user_text' = $row-rev_user_text, 'rc_namespace' = $row-page_namespace, diff --git a/maintenance/rebuildrecentchanges.php b/maintenance/rebuildrecentchanges.php index b9eb809..315176c 100644 --- a/maintenance/rebuildrecentchanges.php +++ b/maintenance/rebuildrecentchanges.php @@ -70,6 +70,7 @@ $dbw-insertSelect( 'recentchanges', array( 'page', 'revision' ), array( 'rc_timestamp' = 'rev_timestamp', + 'rc_cur_time' = 'rev_timestamp', 'rc_user' = 'rev_user', 'rc_user_text' = 'rev_user_text', 'rc_namespace' = 'page_namespace', @@ -184,6 +185,7 @@ $dbw-insertSelect( 'recentchanges', array( 'user',
[MediaWiki-commits] [Gerrit] Remove background-color statements from CSS - change (mediawiki...Collection)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/98549 Change subject: Remove background-color statements from CSS .. Remove background-color statements from CSS This ensures that the background-color behind the affected areas is preserved, meaning that the font color from behind is assured to be reasonable. It does therefore put more onus on the border to mark out the key areas. Change-Id: Id82d9a46bb4347441788042843dcee8200f76186 --- M js/bookcreator.css 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection refs/changes/49/98549/1 diff --git a/js/bookcreator.css b/js/bookcreator.css index ae0f770..f953f23 100644 --- a/js/bookcreator.css +++ b/js/bookcreator.css @@ -2,7 +2,6 @@ position: absolute; padding: 4px; border: 1px solid #000; - background-color: #fea; z-index: ; display: inline; font-size: 10pt; @@ -25,7 +24,6 @@ margin-bottom: 10px; padding: 10px; border: 1px solid #aaa; - background-color: #f9f9f9; } /* Input follows user direction */ @@ -39,7 +37,6 @@ margin-top: 20px; margin-bottom: 2px; border: 1px solid #aaa; - background-color: #f9f9f9; } .collection-create-chapter-links a { @@ -109,7 +106,6 @@ margin: 10px 0; padding: 5px 10px; border: 1px solid #aaa; - background-color: #f9f9ff; } .collection-creatorbox-row { -- To view, visit https://gerrit.wikimedia.org/r/98549 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id82d9a46bb4347441788042843dcee8200f76186 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info Gerrit-Reviewer: Njw nick.wh...@durham.ac.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Install simplejson workaround for 2.5 - change (pywikibot/compat)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/98394 Change subject: Install simplejson workaround for 2.5 .. Install simplejson workaround for 2.5 I am still using Python 2.5 on some machine and I need to use simplejson instead of built-in json. Change-Id: I270cc75fc0756a3810023b7022b6c517e39a97f9 --- M data_ingestion.py M generate_family_file.py M pagegenerators.py M panoramiopicker.py M query.py M wikipedia.py 6 files changed, 27 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/94/98394/1 diff --git a/data_ingestion.py b/data_ingestion.py index e1376b6..f5c8f3d 100644 --- a/data_ingestion.py +++ b/data_ingestion.py @@ -8,7 +8,11 @@ import posixpath, urlparse import urllib import hashlib, base64 -import StringIO, json +import StringIO +try: +import json +except ImportError: +import simplejson as json class Photo(object): ''' diff --git a/generate_family_file.py b/generate_family_file.py index cfba6f9..1607ead 100644 --- a/generate_family_file.py +++ b/generate_family_file.py @@ -50,7 +50,10 @@ # parsing response data from BeautifulSoup import BeautifulSoup -import json +try: +import json +except ImportError: +import simplejson as json class FamilyFileGenerator(object): def __init__(self, url=None, name=None, dointerwiki=None): diff --git a/pagegenerators.py b/pagegenerators.py index 79b38d6..2629068 100644 --- a/pagegenerators.py +++ b/pagegenerators.py @@ -940,7 +940,10 @@ #yield url def queryViaAPI(self, query): -import json +try: +import json +except ImportError: +import simplejson as json url = u'http://ajax.googleapis.com/ajax/services/search/web?' params = { 'key': config.google_key, diff --git a/panoramiopicker.py b/panoramiopicker.py index b75cada..be8376f 100644 --- a/panoramiopicker.py +++ b/panoramiopicker.py @@ -25,7 +25,11 @@ import imagerecat import upload import externals # check for and install needed -import json +try: +import json +except ImportError: +import simplejson as json + from Tkinter import * from PIL import Image, ImageTk # see: http://www.pythonware.com/products/pil/ from BeautifulSoup import BeautifulSoup diff --git a/query.py b/query.py index a249b83..8b36962 100644 --- a/query.py +++ b/query.py @@ -29,8 +29,10 @@ import wikipedia as pywikibot import config from pywikibot.support import deprecate_arg -import json - +try: +import json +except ImportError: +import simplejson as json @deprecate_arg(encodeTitle, None) def GetData(params, site=None, useAPI=True, retryCount=config.maxretries, diff --git a/wikipedia.py b/wikipedia.py index d0d8488..050e825 100644 --- a/wikipedia.py +++ b/wikipedia.py @@ -162,7 +162,11 @@ import weakref import logging import logging.handlers -import json +try: +import json +except ImportError: +import simplejson as json + # Splitting the bot into library parts from pywikibot.support import * import config -- To view, visit https://gerrit.wikimedia.org/r/98394 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I270cc75fc0756a3810023b7022b6c517e39a97f9 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use % substitution instead of str.format - change (pywikibot/compat)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/98395 Change subject: Use % substitution instead of str.format .. Use % substitution instead of str.format Python 2.5 does not have str.format() and it is not strictly necessary here. Change-Id: If23c8d2a42947381d25d26fced3437cbe35a900f --- M wikipedia.py 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/95/98395/1 diff --git a/wikipedia.py b/wikipedia.py index d0d8488..6d30811 100644 --- a/wikipedia.py +++ b/wikipedia.py @@ -185,7 +185,7 @@ # Format string for the default user agent. -USER_AGENT_FORMAT = '{script}/r{version[rev]} Pywikipediabot/1.0' +USER_AGENT_FORMAT = '%(script)s/r%(versionrev)s Pywikipediabot/1.0' SaxError = xml.sax._exceptions.SAXParseException @@ -5982,9 +5982,9 @@ useragent = s # Default User-agent -setUserAgent(USER_AGENT_FORMAT.format( +setUserAgent(USER_AGENT_FORMAT % dict( script=('-'.join(version.get_executing_script())), -version=version.getversiondict() +versionrev=(version.getversiondict()[rev]) )) -- To view, visit https://gerrit.wikimedia.org/r/98395 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If23c8d2a42947381d25d26fced3437cbe35a900f Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't use SSL if not available - change (pywikibot/compat)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/98396 Change subject: Don't use SSL if not available .. Don't use SSL if not available There might still be some installations with httplib without HTTPS for some reason. Don't try to use https on those (in case of Wikipedia, the use of SSL was actually forced). Change-Id: I5809364eb02d8669fc2b62734ca1e3e48824b129 --- M family.py 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/96/98396/1 diff --git a/family.py b/family.py index 30e2bed..c691a9f 100644 --- a/family.py +++ b/family.py @@ -4209,12 +4209,20 @@ return self.namespace(code, 14, all=True) # Methods +def ssl_available(self): +Check if SSL support is available +import httplib +return hasattr(httplib, HTTPS) + def protocol(self, code): Can be overridden to return 'https'. Other protocols are not supported. -return 'http%s' % ('', 's')[config.SSL_connection] +if self.ssl_available(): + return 'http%s' % ('', 's')[config.SSL_connection] +else: + return 'http' def hostname(self, code): The hostname to use for standard http connections. @@ -4867,4 +4875,7 @@ return ('commons', 'commons') def protocol(self, code): -return 'https' +if self.ssl_available(): +return 'https' +else: +return 'http' -- To view, visit https://gerrit.wikimedia.org/r/98396 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5809364eb02d8669fc2b62734ca1e3e48824b129 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Sample bot adding content from text file - change (pywikibot/compat)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/98457 Change subject: Sample bot adding content from text file .. Sample bot adding content from text file An example bot roughly based on basic.py to solve a problem posted on the mailing list: http://thread.gmane.org/gmane.science.linguistics.wikipedia.technical/74126 Change-Id: I325e10ae0d1ef42e9b999030404be99bf032791b --- A onelinecontent.py 1 file changed, 90 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/57/98457/1 diff --git a/onelinecontent.py b/onelinecontent.py new file mode 100644 index 000..9b9d657 --- /dev/null +++ b/onelinecontent.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +An example bot to fix the issue described in the + +http://thread.gmane.org/gmane.science.linguistics.wikipedia.technical/74126 + +The following parameters are supported: + +-summary:XYZ Set the summary message text for the edit to XYZ, bypassing + the predefined message texts with original and replacements + inserted. + +-contentfile:XYZ A name of a file containing pagename:content lines + +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. + +# +# (C) Pywikipedia bot team, 2006-2011 +# +# Distributed under the terms of the MIT license. +# +__version__ = '$Id$' +# + +import re + +import wikipedia as pywikibot +import pagegenerators +from pywikibot import i18n, Page +from basic import BasicBot + + +def FileContentGenerator(fp, sep=:, site=None): +Yield (pagename, text) pairs read from the file +if site is None: +site = pywikibot.getSite() +for line in fp.readlines(): +(pagename, text) = line.split(sep) +yield (Page(site, pagename), text) + + +class BasicContentBot(BasicBot): +def run(self): +for (page, text) in self.generator: +self.treatcontent(page, text) + +def treatcontent(self, page, text): + +Loads the given page, does some changes, and saves it. + +if not text: +return + + +# NOTE: Here you can modify the text in whatever way you want. # + + +# If you find out that you do not want to edit this page, just return. +# Example: This puts the text 'Test' at the beginning of the page. + +if not self.save(text, page, self.summary): +pywikibot.output(u'Page %s not saved.' % page.title(asLink=True)) + + +def main(): +editSummary = '' +contentfile = None + +# Parse command line arguments +for arg in pywikibot.handleArgs(): +if arg.startswith('-summary:'): +editSummary = arg[9:] +else: +if arg.startswith('-contentfile:'): +contentfile = arg[13:] + +if contentfile: +gen = FileContentGenerator(open(contentfile, r)) +bot = BasicContentBot(gen, editSummary) +bot.run() +else: +pywikibot.showHelp() + +if __name__ == __main__: +try: +main() +finally: +pywikibot.stopme() -- To view, visit https://gerrit.wikimedia.org/r/98457 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I325e10ae0d1ef42e9b999030404be99bf032791b Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] PostgreSQL support for VoteNY - change (mediawiki...VoteNY)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/98353 Change subject: PostgreSQL support for VoteNY .. PostgreSQL support for VoteNY Use integer value for votes to count averages. Initial contributor: Sebastian Fiedler ba...@unix-solution.de Bug: 51441 Change-Id: I9c09b84d3652449d3328586332c636a7a676273a --- M Vote.js M VoteClass.php M VoteHooks.php R vote.mysql A vote.postgres 5 files changed, 37 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VoteNY refs/changes/53/98353/1 diff --git a/Vote.js b/Vote.js index f1ca0bb..021e398 100644 --- a/Vote.js +++ b/Vote.js @@ -165,4 +165,4 @@ jQuery( this ).data( 'vote-id' ) ); } ); -} ); \ No newline at end of file +} ); diff --git a/VoteClass.php b/VoteClass.php index 60e4e7f..250c7c3 100644 --- a/VoteClass.php +++ b/VoteClass.php @@ -45,13 +45,13 @@ $vote_count = 0; $res = $dbr-select( 'Vote', - 'COUNT(*) AS VoteCount', + 'COUNT(*) AS votecount', array( 'vote_page_id' = $this-PageID ), __METHOD__ ); $row = $dbr-fetchObject( $res ); if( $row ) { - $vote_count = $row-VoteCount; + $vote_count = $row-votecount; } $wgMemc-set( $key, $vote_count ); } @@ -76,13 +76,13 @@ $dbr = wfGetDB( DB_SLAVE ); $res = $dbr-select( 'Vote', - 'AVG(vote_value) AS VoteAvg', + 'AVG(vote_value) AS voteavg', array( 'vote_page_id' = $this-PageID ), __METHOD__ ); $row = $dbr-fetchObject( $res ); if( $row ) { - $voteAvg = $row-VoteAvg; + $voteAvg = $row-voteavg; } $wgMemc-set( $key, $voteAvg ); } @@ -120,6 +120,7 @@ */ function delete() { $dbw = wfGetDB( DB_MASTER ); + $dbw-begin(); $dbw-delete( 'Vote', array( @@ -149,6 +150,7 @@ $voteDate = date( 'Y-m-d H:i:s' ); wfRestoreWarnings(); if( $this-UserAlreadyVoted() == false ) { + $dbw-begin(); $dbw-insert( 'Vote', array( @@ -276,7 +278,7 @@ $output .= 'div class=rating-section'; $output .= $this-displayStars( $id, $display_stars_rating, $voted ); $count = $this-count(); - if( $count ) { + if( isset( $count ) ) { $output .= ' span class=rating-total(' . wfMsgExt( 'voteny-votes', 'parsemag', $count ) . ')/span'; } diff --git a/VoteHooks.php b/VoteHooks.php index eb69ae6..f028b57 100644 --- a/VoteHooks.php +++ b/VoteHooks.php @@ -149,9 +149,13 @@ * @return Boolean: true */ public static function addTable( $updater ) { - $dir = dirname( __FILE__ ); - $file = $dir/vote.sql; - $updater-addExtensionUpdate( array( 'addTable', 'Vote', $file, true ) ); + $dbt = $updater-getDB()-getType(); + $file = dirname( __FILE__ ) . /vote.$dbt; + if ( file_exists( $file ) ) { + $updater-addExtensionUpdate( array( 'addTable', 'Vote', $file, true ) ); + } else { + throw new MWException(VoteNY does not support $dbt.); + } return true; } -} \ No newline at end of file +} diff --git a/vote.sql b/vote.mysql similarity index 100% rename from vote.sql rename to vote.mysql diff --git a/vote.postgres b/vote.postgres new file mode 100644 index 000..81f397f --- /dev/null +++ b/vote.postgres @@ -0,0 +1,21 @@ +CREATE TABLE Vote ( + -- Internal ID to identify between different vote tags on different pages + vote_id SERIAL NOT NULL PRIMARY KEY, + -- Username (if any) of the person who voted + username varchar(255) NOT NULL default '0', + -- User ID of the person who voted + vote_user_id integer NOT NULL default '0', + -- ID of the page where the vote tag is in + vote_page_id integer NOT NULL default '0', + -- Value of the vote (ranging from 1 to 5) + vote_value integer
[MediaWiki-commits] [Gerrit] Really populate ar_len this time - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/92443 Change subject: Really populate ar_len this time .. Really populate ar_len this time Change I0f685aa5ea48468279475b487a627ff73c70d5cd attempted to populate ar_len, but it fails with: SELECT rev_id, rev_page, rev_text_id, rev_timestamp, rev_comment, rev_user_text, rev_user, /* ... */ rev_len, rev_parent_id, rev_sha1, rev_content_format, rev_content_model FROM archive WHERE (= 200) AND (ar_len IS NULL) Change-Id: I18fab8012b9d59adde637607931c7a5ea6adf2a1 --- M includes/Revision.php M maintenance/populateRevisionLength.php 2 files changed, 38 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/43/92443/1 diff --git a/includes/Revision.php b/includes/Revision.php index 233eac0..c06cf5e 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -434,6 +434,40 @@ } /** +* Return the list of archive fields that should be selected to create +* a revision pulled from the archive attic (via newFromArchiveRow) +* @return array +*/ + public static function selectArchiveFields() { + global $wgContentHandlerUseDB; + + $fields = array( + 'ar_page_id', + 'ar_rev_id', + 'ar_comment', + 'ar_user', + 'ar_user_text', + 'ar_timestamp', + 'ar_minor_edit', + 'ar_text_id', + 'ar_text', + 'ar_deleted', + 'ar_len', + 'ar_sha1', + 'ar_namespace', + 'ar_title', + ); + + if ( $wgContentHandlerUseDB ) { + $fields[] = 'ar_content_format'; + $fields[] = 'ar_content_model'; + } + + return $fields; + } + + + /** * Return the list of text fields that should be selected to read the * revision text * @return array diff --git a/maintenance/populateRevisionLength.php b/maintenance/populateRevisionLength.php index 4acc579..769e1a7 100644 --- a/maintenance/populateRevisionLength.php +++ b/maintenance/populateRevisionLength.php @@ -53,10 +53,10 @@ } $this-output( Populating rev_len column\n ); - $rev = $this-doLenUpdates( 'revision', 'rev_id', 'rev' ); + $rev = $this-doLenUpdates( 'revision', 'rev_id', 'rev', Revision::selectFields() ); $this-output( Populating ar_len column\n ); - $ar = $this-doLenUpdates( 'archive', 'ar_id', 'ar' ); + $ar = $this-doLenUpdates( 'archive', 'ar_id', 'ar', Revision::selectArchiveFields() ); $this-output( rev_len and ar_len population complete [$rev revision rows, $ar archive rows].\n ); return true; @@ -68,7 +68,7 @@ * @param $prefix * @return int */ - protected function doLenUpdates( $table, $idCol, $prefix ) { + protected function doLenUpdates( $table, $idCol, $prefix, $fields ) { $db = $this-getDB( DB_MASTER ); $start = $db-selectField( $table, MIN($idCol), false, __METHOD__ ); $end = $db-selectField( $table, MAX($idCol), false, __METHOD__ ); @@ -81,9 +81,8 @@ $blockStart = intval( $start ); $blockEnd = intval( $start ) + $this-mBatchSize - 1; $count = 0; - $fields = Revision::selectFields(); while ( $blockStart = $end ) { - $this-output( ...doing rev_id from $blockStart to $blockEnd\n ); + $this-output( ...doing {$idCol} from $blockStart to $blockEnd\n ); $res = $db-select( $table, $fields, -- To view, visit https://gerrit.wikimedia.org/r/92443 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18fab8012b9d59adde637607931c7a5ea6adf2a1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add uoi_user_registration for PostgreSQL - change (mediawiki...OpenID)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/92466 Change subject: Add uoi_user_registration for PostgreSQL .. Add uoi_user_registration for PostgreSQL * Define separate hooks for MySQL and PostgreSQL, bail explicitly on other databases. * Use database-specific timestamp conversion Bug: 34844 Bug: 34846 Change-Id: I0c102e270e261c5da89247c6f43ee3b2bf3bb10d --- M OpenID.hooks.php M OpenID.php M SpecialOpenID.body.php M patches/openid_table.pg.sql 4 files changed, 25 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenID refs/changes/66/92466/1 diff --git a/OpenID.hooks.php b/OpenID.hooks.php index 87cb650..381fb2f 100644 --- a/OpenID.hooks.php +++ b/OpenID.hooks.php @@ -470,7 +470,7 @@ * @param $updater DatabaseUpdater * @return bool */ - public static function onLoadExtensionSchemaUpdates( $updater = null ) { + public static function MySQLSchemaUpdates( $updater = null ) { // = 1.17 support $updater-addExtensionTable( 'user_openid', dirname( __FILE__ ) . '/patches/openid_table.sql' ); @@ -495,6 +495,20 @@ } /** +* @param $updater PostgresUpdater +* @return bool +*/ + public static function PostgreSQLSchemaUpdates( $updater = null ) { + $base = dirname( __FILE__ ) . '/patches'; + foreach ( array ( + array( 'addTable', 'user_openid', $base . '/openid_table.pg.sql', true ), + array( 'addPgField', 'user_openid', 'uoi_user_registration', 'TIMESTAMPTZ'), + ) as $update ) { + $updater-addExtensionUpdate( $update ); + } + } + + /** * @return string */ private static function getOpenIDSmallLogoUrl() { diff --git a/OpenID.php b/OpenID.php index f6a9a08..366ae11 100644 --- a/OpenID.php +++ b/OpenID.php @@ -416,7 +416,13 @@ $wgHooks['BeforePageDisplay'][] = 'OpenIDHooks::onBeforePageDisplay'; $wgHooks['ArticleViewHeader'][] = 'OpenIDHooks::onArticleViewHeader'; $wgHooks['SpecialPage_initList'][] = 'OpenIDHooks::onSpecialPage_initList'; -$wgHooks['LoadExtensionSchemaUpdates'][] = 'OpenIDHooks::onLoadExtensionSchemaUpdates'; +if ( $wgDBtype === 'mysql' ) { + $wgHooks['LoadExtensionSchemaUpdates'][] = 'OpenIDHooks::MySQLSchemaUpdates'; +} elseif ($wgDBtype === 'postgres' ) { + $wgHooks['LoadExtensionSchemaUpdates'][] = 'OpenIDHooks::PostgreSQLSchemaUpdates'; +} else { + throw new MWException(OpenID does not support {$wgDBtype} yet.); +} $wgHooks['DeleteAccount'][] = 'OpenIDHooks::onDeleteAccount'; $wgHooks['MergeAccountFromTo'][] = 'OpenIDHooks::onMergeAccountFromTo'; diff --git a/SpecialOpenID.body.php b/SpecialOpenID.body.php index 3ab236d..3922978 100644 --- a/SpecialOpenID.body.php +++ b/SpecialOpenID.body.php @@ -475,7 +475,7 @@ array( 'uoi_user' = $user-getId(), 'uoi_openid' = $url, - 'uoi_user_registration' = wfTimestamp( TS_MW ) + 'uoi_user_registration' = $dbw-timestamp( wfTimestamp( TS_MW ) ) ), __METHOD__ ); diff --git a/patches/openid_table.pg.sql b/patches/openid_table.pg.sql index 0b59b54..7e6c600 100644 --- a/patches/openid_table.pg.sql +++ b/patches/openid_table.pg.sql @@ -3,7 +3,8 @@ CREATE TABLE /*_*/user_openid ( uoi_openid VARCHAR(255) NOT NULL PRIMARY KEY, - uoi_user INTEGER NOT NULL REFERENCES mwuser(user_id) + uoi_user INTEGER NOT NULL REFERENCES mwuser(user_id), + uoi_user_registration TIMESTAMPTZ ); CREATE INDEX /*i*/user_openid_user ON /*_*/user_openid(uoi_user); -- To view, visit https://gerrit.wikimedia.org/r/92466 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c102e270e261c5da89247c6f43ee3b2bf3bb10d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/OpenID Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow robotic Users to determine their IP address - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/92179 Change subject: Allow robotic Users to determine their IP address .. Allow robotic Users to determine their IP address If some robotic user is making a change (for example, AbuseFilter user), it is not always correct to use IP address coming from the request. Allow instances of User class to provide their own way to determine IP address for the recent changes logging. Bug: 42345 Change-Id: I272db0c07808cd20e07f4d017220817f6d878209 --- M includes/User.php M includes/changes/RecentChange.php 2 files changed, 31 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/79/92179/1 diff --git a/includes/User.php b/includes/User.php index 12912e1..818d9e8 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1297,7 +1297,7 @@ # user is not immune to autoblocks/hardblocks, and they are the current user so we # know which IP address they're actually coming from if ( !$this-isAllowed( 'ipblock-exempt' ) $this-getID() == $wgUser-getID() ) { - $ip = $this-getRequest()-getIP(); + $ip = $this-getUserIP(); } else { $ip = null; } @@ -1472,7 +1472,7 @@ */ public function isPingLimitable() { global $wgRateLimitsExcludedIPs; - if ( in_array( $this-getRequest()-getIP(), $wgRateLimitsExcludedIPs ) ) { + if ( in_array( $this-getUserIP(), $wgRateLimitsExcludedIPs ) ) { // No other good way currently to disable rate limits // for specific IPs. :P // But this is a crappy hack and should die. @@ -1529,11 +1529,11 @@ $keys[wfMemcKey( 'limiter', $action, 'user', $id )] = $limits['newbie']; } if ( isset( $limits['ip'] ) ) { - $ip = $this-getRequest()-getIP(); + $ip = $this-getUserIP(); $keys[mediawiki:limiter:$action:ip:$ip] = $limits['ip']; } if ( isset( $limits['subnet'] ) ) { - $ip = $this-getRequest()-getIP(); + $ip = $this-getUserIP(); $matches = array(); $subnet = false; if ( IP::isIPv6( $ip ) ) { @@ -1687,7 +1687,7 @@ if ( IP::isIPAddress( $this-getName() ) ) { $ip = $this-getName(); } elseif ( !$ip ) { - $ip = $this-getRequest()-getIP(); + $ip = $this-getUserIP(); } $blocked = false; wfRunHooks( 'UserIsBlockedGlobally', array( $this, $ip, $blocked ) ); @@ -1766,7 +1766,7 @@ $this-load(); if ( $this-mName === false ) { // Clean up IPs - $this-mName = IP::sanitizeIP( $this-getRequest()-getIP() ); + $this-mName = IP::sanitizeIP( $this-getUserIP() ); } return $this-mName; } @@ -2620,7 +2620,7 @@ $https = $this-getBoolOption( 'prefershttps' ); wfRunHooks( 'UserRequiresHTTPS', array( $this, $https ) ); if ( $https ) { - $https = wfCanIPUseHTTPS( $this-getRequest()-getIP() ); + $https = wfCanIPUseHTTPS( $this-getUserIP() ); } return $https; } @@ -3491,7 +3491,7 @@ return false; } - return (bool)$userblock-doAutoblock( $this-getRequest()-getIP() ); + return (bool)$userblock-doAutoblock( $this-getUserIP() ); } /** @@ -3558,7 +3558,7 @@ # blocked with createaccount disabled, prevent new account creation there even # when the user is logged in if ( $this-mBlockedFromCreateAccount === false !$this-isAllowed( 'ipblock-exempt' ) ) { - $this-mBlockedFromCreateAccount = Block::newFromTarget( null, $this-getRequest()-getIP() ); + $this-mBlockedFromCreateAccount = Block::newFromTarget( null, $this-getUserIP() ); } return $this-mBlockedFromCreateAccount instanceof Block $this-mBlockedFromCreateAccount-prevents( 'createaccount' ) ? $this-mBlockedFromCreateAccount @@ -3789,7 +3789,7 @@
[MediaWiki-commits] [Gerrit] Introduce AbuseFilterUser - change (mediawiki...AbuseFilter)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/92252 Change subject: Introduce AbuseFilterUser .. Introduce AbuseFilterUser Modify behaviour of Abuse Filter special user by extra Experimental, see: http://thread.gmane.org/gmane.science.linguistics.wikipedia.technical/73503 Bug: 42345 Change-Id: I0c1e34e95bfd41a8f7ace8b51937035bf574edf1 --- M AbuseFilter.class.php M AbuseFilter.hooks.php M AbuseFilter.php A AbuseFilterUser.class.php 4 files changed, 185 insertions(+), 64 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter refs/changes/52/92252/1 diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php index 61939ce..6673c75 100644 --- a/AbuseFilter.class.php +++ b/AbuseFilter.class.php @@ -1225,7 +1225,7 @@ case 'block': global $wgUser, $wgAbuseFilterBlockDuration, $wgAbuseFilterAnonBlockDuration; - $filterUser = AbuseFilter::getFilterUser(); + $filterUser = AbuseFilterUser::getInstance(); // Create a block. $block = new Block; @@ -1264,7 +1264,7 @@ $log-addEntry( 'block', Title::makeTitle( NS_USER, $wgUser-getName() ), wfMessage( 'abusefilter-blockreason', $rule_desc )-inContentLanguage()-text(), - $logParams, self::getFilterUser() + $logParams, AbuseFilterUser::getInstance() ); $message = array( @@ -1273,7 +1273,7 @@ ); break; case 'rangeblock': - $filterUser = AbuseFilter::getFilterUser(); + $filterUser = AbuseFilterUser::getInstance(); $range = IP::sanitizeRange( $wgRequest-getIP() . '/16' ); @@ -1301,7 +1301,7 @@ $log = new LogPage( 'block' ); $log-addEntry( 'block', Title::makeTitle( NS_USER, $range ), wfMessage( 'abusefilter-blockreason', $rule_desc )-inContentLanguage()-text(), - $logParams, self::getFilterUser() + $logParams, AbuseFilterUser::getInstance() ); $message = array( @@ -1339,7 +1339,7 @@ implode( ', ', $groups ), '' ), - self::getFilterUser() + AbuseFilterUser::getInstance() ); } @@ -1642,38 +1642,6 @@ */ public static function filterMatchesKey( $filter = null ) { return wfMemcKey( 'abusefilter', 'stats', 'matches', $filter ); - } - - /** -* @return User -*/ - public static function getFilterUser() { - $user = User::newFromName( wfMessage( 'abusefilter-blocker' )-inContentLanguage()-text() ); - $user-load(); - if ( $user-getId() $user-mPassword == '' ) { - // Already set up. - return $user; - } - - // Not set up. Create it. - if ( !$user-getId() ) { - print 'Trying to create account -- user id is ' . $user-getId(); - $user-addToDatabase(); - $user-saveSettings(); - // Increment site_stats.ss_users - $ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 ); - $ssu-doUpdate(); - } else { - // Take over the account - $user-setPassword( null ); - $user-setEmail( null ); - $user-saveSettings(); - } - - // Promote user so it doesn't look too crazy. - $user-addGroup( 'sysop' ); - - return $user; } /** diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php index 42c362d..ab5cd27 100644 --- a/AbuseFilter.hooks.php +++ b/AbuseFilter.hooks.php @@ -500,35 +500,9 @@ $updater-addExtensionUpdate( array( 'addPgExtIndex', 'abuse_filter_log', 'abuse_filter_log_wiki', (afl_wiki) ) ); } - $updater-addExtensionUpdate( array( array(
[MediaWiki-commits] [Gerrit] Don't expose blocked IP address in error message - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/92254 Change subject: Don't expose blocked IP address in error message .. Don't expose blocked IP address in error message Experimental patch to remove $3 parameter of blockedtext and autoblockedtext Bug: 53008 Change-Id: I4ad917075149616809f65726072f15cc3a5a7a70 --- M includes/Block.php M languages/messages/MessagesEn.php M languages/messages/MessagesQqq.php 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/54/92254/1 diff --git a/includes/Block.php b/includes/Block.php index 34b89e7..05eb509 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -1424,7 +1424,7 @@ $this-mAuto ? 'autoblockedtext' : 'blockedtext', $link, $reason, - $context-getRequest()-getIP(), + , $this-getByName(), $this-getId(), $lang-formatExpiry( $this-mExpiry ), diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 0c1b560..4a58312 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1402,7 +1402,7 @@ You can contact $1 or another [[{{MediaWiki:Grouppage-sysop}}|administrator]] to discuss the block. You cannot use the \email this user\ feature unless a valid email address is specified in your [[Special:Preferences|account preferences]] and you have not been blocked from using it. -Your current IP address is $3, and the block ID is #$5. +Block ID is #$5. Please include all above details in any queries you make., 'autoblockedtext' = Your IP address has been automatically blocked because it was used by another user, who was blocked by $1. The reason given is: @@ -1417,7 +1417,7 @@ Note that you may not use the \email this user\ feature unless you have a valid email address registered in your [[Special:Preferences|user preferences]] and you have not been blocked from using it. -Your current IP address is $3, and the block ID is #$5. +Block ID is #$5. Please include all above details in any queries you make., 'blockednoreason' = 'no reason given', 'whitelistedittext'= 'You have to $1 to edit pages.', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index a8b66b2..f7535ff 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -1816,7 +1816,7 @@ Parameters: * $1 - the blocking sysop (with a link to his/her userpage) * $2 - the reason for the block -* $3 - the current IP address of the blocked user +* $3 - empty, do not use * $4 - (Unused) the blocking sysop\'s username (plain text, without the link) * $5 - the unique numeric identifier of the applied autoblock * $6 - the expiry of the block @@ -1832,7 +1832,7 @@ Parameters: * $1 - the blocking sysop (with a link to his/her userpage) * $2 - the reason for the block (in case of autoblocks: {{msg-mw|autoblocker}}) -* $3 - the current IP address of the blocked user +* $3 - empty, do not use * $4 - (Unused) the blocking sysop\'s username (plain text, without the link). Use it for GENDER. * $5 - the unique numeric identifier of the applied autoblock * $6 - the expiry of the block -- To view, visit https://gerrit.wikimedia.org/r/92254 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ad917075149616809f65726072f15cc3a5a7a70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Display parent block target in autoblock errors - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/92257 Change subject: Display parent block target in autoblock errors .. Display parent block target in autoblock errors If the reason to block is autoblock, display original block target username and not an IP address of the current user. Bug: 56227 Change-Id: I7fad56d6537dcec3cb36aeba40e01daf215515bd --- M includes/Block.php 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/57/92257/1 diff --git a/includes/Block.php b/includes/Block.php index 34b89e7..f008939 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -1417,7 +1417,12 @@ /* $ip returns who *is* being blocked, $intended contains who was meant to be blocked. * This could be a username, an IP range, or a single IP. */ - $intended = $this-getTarget(); + if ( $this-mAuto ) { + $parent = $this-mParentBlockId; + $intended = self::newFromId( $parent )-getRedactedName(); + } else { + $intended = $this-getRedactedName(); + } $lang = $context-getLanguage(); return array( -- To view, visit https://gerrit.wikimedia.org/r/92257 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7fad56d6537dcec3cb36aeba40e01daf215515bd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Sort out index creation for PostgreSQL - change (mediawiki...SemanticMediaWiki)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/91375 Change subject: Sort out index creation for PostgreSQL .. Sort out index creation for PostgreSQL 1) Extract indexed fields out of pg_index, not from parsing CREATE INDEX SQL. 2) Allow UNIQUE indexes to be maintained by SMW SMW_setup.php still attempts to ALTER non-existent sequences. Bug: 42659 Change-Id: I2d2cb63331d5ed785295d973b7f3124e1c289b53 --- M includes/storage/SMW_SQLHelpers.php 1 file changed, 66 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki refs/changes/75/91375/1 diff --git a/includes/storage/SMW_SQLHelpers.php b/includes/storage/SMW_SQLHelpers.php index 18c7874..6f8ecbb 100644 --- a/includes/storage/SMW_SQLHelpers.php +++ b/includes/storage/SMW_SQLHelpers.php @@ -342,7 +342,11 @@ self::reportProgress( Checking index structures for table $tableName ...\n, $reportTo ); // First remove obsolete indexes. - $oldIndexes = self::getIndexInfo( $db, $tableName ); + if ( $wgDBtype == 'postgres' ) { + $oldIndexes = self::getIndexInfo( $db, $rawTableName ); + } else { + $oldIndexes = self::getIndexInfo( $db, $tableName ); + } if ( $wgDBtype == 'sqlite' ) { // SQLite /// TODO We do not currently get the right column definitions in /// SQLLite; hence we can only drop all indexes. Wasteful. @@ -373,7 +377,11 @@ $type = 'INDEX'; } - self::createIndex( $db, $type, {$tableName}_index{$key}, $tableName, $columns, $reportTo ); + $indexName = {$tableName}_index{$key}; + if ( $wgDBtype === 'postgres' ) { + $indexName = $db-tableName({$rawTableName}_index{$key}); + } + self::createIndex( $db, $type, $indexName, $tableName, $columns, $reportTo ); } self::reportProgress(... done.\n, $reportTo ); @@ -396,25 +404,63 @@ $indexes = array(); if ( $wgDBtype == 'postgres' ) { // postgresql - $sql = SELECT i.relname AS indexname, - . pg_get_indexdef(i.oid) AS indexdef, - . replace(substring(pg_get_indexdef(i.oid) from '((.*))'),' ','') AS indexcolumns - . FROM pg_index x - . JOIN pg_class c ON c.oid = x.indrelid - . JOIN pg_class i ON i.oid = x.indexrelid - . LEFT JOIN pg_namespace n ON n.oid = c.relnamespace - . LEFT JOIN pg_tablespace t ON t.oid = i.reltablespace - . WHERE c.relkind = 'r'::\char\ AND i.relkind = 'i'::\char\ - . AND c.relname = ' . $tableName . ' - . AND NOT pg_get_indexdef(i.oid) ~ '^CREATE UNIQUE INDEX'; - $res = $db-query( $sql, __METHOD__ ); + $schema = 'mediawiki'; + $indexNameSql = __INDEXNAME__ + SELECT i.relname AS indexname + FROM pg_index x + JOIN pg_class c ON c.oid = x.indrelid AND c.relkind = 'r'::char + AND c.relname = '$tableName' + JOIN pg_class i ON i.oid = x.indexrelid AND i.relkind = 'i'::char + JOIN pg_namespace n ON n.oid = c.relnamespace AND n.nspname = '$schema' + WHERE NOT x.indisprimary +__INDEXNAME__; - if ( !$res ) { + $indexNameRes = $db-query( $indexNameSql, __METHOD__ ); + if ( !$indexNameRes ) { return false; } - foreach ( $res as $row ) { - $indexes[$row-indexname] = $row-indexcolumns; + $atts = array(); + foreach ( $indexNameRes as $indexRow ) { + $index = $indexRow-indexname; + $indexAttSql = __INDEXATT__ + SELECT + attname + FROM + (SELECT generate_series(array_lower(isub.indkey,1), array_upper(isub.indkey,1)) AS g + FROM + pg_index isub +
[MediaWiki-commits] [Gerrit] Escape backslashes in image metadata - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/90057 Change subject: Escape backslashes in image metadata .. Escape backslashes in image metadata Uploading a file with backslashes in the metadata causes database exception on PostgreSQL, because backslashes are sent to the 'bytea' datatype unencoded. Bug: 52017 Change-Id: Ife56cffe3df83ec1a7bd39cdc4a0489f23354494 --- M includes/filerepo/file/LocalFile.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/57/90057/1 diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 627defd..0c34f3e 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -539,7 +539,7 @@ 'img_media_type' = $this-media_type, 'img_major_mime' = $major, 'img_minor_mime' = $minor, - 'img_metadata' = $this-metadata, + 'img_metadata' = $dbw-encodeBlob($this-metadata), 'img_sha1' = $this-sha1, ), array( 'img_name' = $this-getName() ), @@ -1225,7 +1225,7 @@ 'img_description' = $comment, 'img_user' = $user-getId(), 'img_user_text' = $user-getName(), - 'img_metadata' = $this-metadata, + 'img_metadata' = $dbw-encodeBlob($this-metadata), 'img_sha1' = $this-sha1 ), __METHOD__, @@ -1276,7 +1276,7 @@ 'img_description' = $comment, 'img_user'= $user-getId(), 'img_user_text' = $user-getName(), - 'img_metadata'= $this-metadata, + 'img_metadata'= $dbw-encodeBlob($this-metadata), 'img_sha1'= $this-sha1 ), array( 'img_name' = $this-getName() ), -- To view, visit https://gerrit.wikimedia.org/r/90057 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ife56cffe3df83ec1a7bd39cdc4a0489f23354494 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wfExpandUrl should expand relative URLs, too - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/87482 Change subject: wfExpandUrl should expand relative URLs, too .. wfExpandUrl should expand relative URLs, too Before this change: with $wgServer = http://tools.wikimedia.pl; var_dump(wfExpandUrl(/a, PROTO_CURRENT)); string(27) http://tools.wikimedia.pl/a; var_dump(wfExpandUrl(/, PROTO_CURRENT)); string(26) http://tools.wikimedia.pl/; var_dump(wfExpandUrl(z, PROTO_CURRENT)); string(1) z var_dump(wfExpandUrl(//a, PROTO_CURRENT)); string(8) http://a; var_dump(wfExpandUrl(//a, PROTO_CURRENT)); string(8) http://a; var_dump(wfExpandUrl(, PROTO_CURRENT)); string(0) After this change: var_dump(wfExpandUrl(z, PROTO_CURRENT)); string(27) http://tools.wikimedia.pl/z; var_dump(wfExpandUrl(, PROTO_CURRENT)); string(26) http://tools.wikimedia.pl/; Bug: 54950 Change-Id: Ia0397a0cfbd1d7c725864e12983c8edced261a25 --- M includes/GlobalFunctions.php 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/82/87482/1 diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index b11bce9b..fb9827a 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -523,10 +523,13 @@ if ( substr( $url, 0, 2 ) == '//' ) { $url = $defaultProtoWithoutSlashes . $url; - } elseif ( substr( $url, 0, 1 ) == '/' ) { + } else { + if ( substr( $url, 0, 1 ) != '/' ) { + $url = / . $url; + } // If $serverUrl is protocol-relative, prepend $defaultProtoWithoutSlashes, otherwise leave it alone $url = ( $serverHasProto ? '' : $defaultProtoWithoutSlashes ) . $serverUrl . $url; - } + } $bits = wfParseUrl( $url ); if ( $bits isset( $bits['path'] ) ) { -- To view, visit https://gerrit.wikimedia.org/r/87482 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia0397a0cfbd1d7c725864e12983c8edced261a25 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] bug 54179: Fix exception on collection save - change (mediawiki...Collection)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/84435 Change subject: bug 54179: Fix exception on collection save .. bug 54179: Fix exception on collection save Do page permissions and force overwrite checks before calling saveCollection. Additionally, do not offer collection save form if the user is blocked. i18n: coll-error-cannotcreate_title: new message i18n: coll-error-cannotcreate_text: new message i18n: coll-error-cannotoverwrite_title: new message i18n: coll-error-cannotoverwrite_text: new message Change-Id: Ic85566348460547c6d2efc5f62c7f15ca37be273 --- M Collection.body.php M Collection.i18n.php M Collection.templates.php 3 files changed, 43 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection refs/changes/35/84435/1 diff --git a/Collection.body.php b/Collection.body.php index 3769834..4daa1ad 100644 --- a/Collection.body.php +++ b/Collection.body.php @@ -237,16 +237,37 @@ if ( !$title ) { return; } - if ( $this-saveCollection( $title, $request-getBool( 'overwrite' ) ) ) { - $out-redirect( $title-getFullURL() ); - } else { - $this-renderSaveOverwritePage( - $colltype, - $title, - $request-getVal( 'pcollname' ), - $request-getVal( 'ccollname' ) - ); - } +$wikiPage = WikiPage::factory( $title ); +$canedit = $title-userCan( 'edit' ); +$cancreate = $title-userCan( 'create' ); +wfDebugLog('collection', saveCollection attempts to create [ . $title . ]. . +force overwrite is . ($request-getBool( 'overwrite' ) ? ON : off) . , . +user . ($canedit ? can : CANNOT) . edit, . +user . ($cancreate ? can : CANNOT) . create); +if ( $wikiPage-exists() ) { +if ( !$canedit) { + $out-showErrorPage( 'coll-error-cannotoverwrite_title', 'coll-error-cannotoverwrite_text' ); +return; +} +if ( $request-getBool( 'overwrite' ) ) { +$this-saveCollection( $title ); +} else { +$this-renderSaveOverwritePage( +$colltype, +$title, +$request-getVal( 'pcollname' ), +$request-getVal( 'ccollname' ) +); +} +} else { +if ( $cancreate ) { +$this-saveCollection( $title ); +} else { + $out-showErrorPage( 'coll-error-cannotcreate_title', 'coll-error-cannotcreate_text' ); +return; +} +} + $out-redirect( $title-getFullURL() ); return; case 'render': $this-renderCollection( @@ -912,14 +933,9 @@ /** * @param $title Title -* @param $forceOverwrite bool -* @return bool +* @throws UsageException */ - function saveCollection( $title, $forceOverwrite = false ) { - $wikiPage = WikiPage::factory( $title ); - if ( $wikiPage-exists() !$forceOverwrite ) { - return false; - } + function saveCollection( $title ) { $articleText = {{ . $this-msg( 'coll-savedbook_template' )-inContentLanguage()-text() . }}\n\n; $collection = CollectionSession::getCollection(); if ( $collection['title'] ) { @@ -971,7 +987,7 @@ ), true); $api = new ApiMain( $req, true ); $api-execute(); - return true; + return; } /** diff --git a/Collection.i18n.php b/Collection.i18n.php index 6cbebe8..5d9bf4b 100644 --- a/Collection.i18n.php +++ b/Collection.i18n.php @@ -170,6 +170,10 @@ 'right-collectionsaveasuserpage' = 'Save books as user page', 'right-collectionsaveascommunitypage' = 'Save books as community page', + 'coll-error-cannotcreate_title' = 'Cannot create book', + 'coll-error-cannotcreate_text' = 'Could not save book to this
[MediaWiki-commits] [Gerrit] Improve markdown and workaround bug 54050 - change (mediawiki...MassMessage)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/84142 Change subject: Improve markdown and workaround bug 54050 .. Improve markdown and workaround bug 54050 Original Markdown guide suggests using four spaces for standalone code blocks, not standalone quotes. Remove word tags in angle quotes, it does not play well with markdown - github renders it as the HTML tag and automatically closes it. Change-Id: I31058567cfe9d2cba412d6fc2795f8d7f7f56a0f --- M README.md 1 file changed, 6 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage refs/changes/42/84142/1 diff --git a/README.md b/README.md index a29a729..9c2ec44 100644 --- a/README.md +++ b/README.md @@ -4,21 +4,15 @@ ## Configuration -` -$wgNamespacesToPostIn = array( NS_PROJECT, NS_USER_TALK ); -` +$wgNamespacesToPostIn = array( NS_PROJECT, NS_USER_TALK ); This limits the bot to only posting in the Project: and User talk: namespaces. -` -$wgNamespacesToConvert = array( NS_USER = NS_USER_TALK ); -` +$wgNamespacesToConvert = array( NS_USER = NS_USER_TALK ); This allows a user to specify a page in the User: namespace, and the bot will automatically convert it to the User talk: namespace. -` -$wgMassMessageAccountUsername = 'MessengerBot'; -` +$wgMassMessageAccountUsername = 'MessengerBot'; The account name that the bot will post with. If this is an existing account, the extension will automatically take it over. @@ -38,15 +32,11 @@ The input list provided to the special page must be formatted using a custom parser function. -` -{{#target:Project:Noticeboard}} -` +{{#target:Project:Noticeboard}} In this example, the target page is `[[Project:Noticeboard]]` on your local site. -` -{{#target:User talk:Example|en.wikipedia.org}} -` +{{#target:User talk:Example|en.wikipedia.org}} In this one, the target is `[[User talk:Example]]` on the en.wikipedia.org domain. @@ -56,7 +46,7 @@ ### Body -The body is the main text of the message. You will be automatically warned if your message is detected to have unclosed tags, but it will not prevent message delivery. +The body is the main text of the message. You will be automatically warned if your message is detected to have unclosed tags, but it will not prevent message delivery. Wikis can choose to add an enforced footer by editing the `massmessage-message-footer` message. In addition to that, a hidden comment will be added containing the user who sent the message, what project it was sent from, and the input list that was used. That comment can be modified by editing the `massmessage-hidden-comment` on the target site. -- To view, visit https://gerrit.wikimedia.org/r/84142 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I31058567cfe9d2cba412d6fc2795f8d7f7f56a0f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MassMessage Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Install localized v3 logo for plwikivoyage - change (operations/mediawiki-config)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/83086 Change subject: Install localized v3 logo for plwikivoyage .. Install localized v3 logo for plwikivoyage Change-Id: I7f40d1726d7caa99cb1ccf6720c1bdc5cafac586 --- M wmf-config/InitialiseSettings.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/86/83086/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 18e5412..f42ee0e 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -937,6 +937,9 @@ 'ukwikimedia' = '$stdlogo', 'vewikimedia' = '$stdlogo', +// Wikivoyage +'plwikivoyage' = '//upload.wikimedia.org/wikipedia/commons/f/f2/Wikivoyage-Logo-v3-small-pl.png', + // Special wikis 'advisorywiki' = '//upload.wikimedia.org/wikipedia/meta/7/7d/Wikimediaboard-logo135px.png', 'arbcom_dewiki' = '$stdlogo', -- To view, visit https://gerrit.wikimedia.org/r/83086 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f40d1726d7caa99cb1ccf6720c1bdc5cafac586 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove docs for hook LoggableUserIPData - change (mediawiki/core)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/55282 Change subject: Remove docs for hook LoggableUserIPData .. Remove docs for hook LoggableUserIPData Hook does not exist (anymore). Some background in bug 32925. Change-Id: I830abd60f559cdd276458447f8f4c772b2d136b1 --- M docs/hooks.txt 1 file changed, 0 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/82/55282/1 diff --git a/docs/hooks.txt b/docs/hooks.txt index a4b4e57..799a208 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1391,17 +1391,6 @@ - wrap String Wrap the message in html (usually something like lt;div ...$1lt;/div). - flags Integer display flags (NO_ACTION_LINK,NO_EXTRA_USER_LINKS) -'LoggableUserIPData': called when IP data for a user action can be logged by extensions like CheckUser. -This is intended for when users do things that do not already create edits or log entries. -$context: The context the of the action, which includes the user and request -$data: Associative array of data for handlers to record. It must include values for: - - 'namespace' Integer namespace for target title (NS_SPECIAL is allowed) - - 'title' Database key string for target title (empty string if not applicable) - - 'pageid'Integer page ID for target title (zero if not applicable) - - 'action'Wikitext string in the same format as an edit summary - - 'comment' Wikitext string in the same format as an edit summary - - 'timestamp' Timestamp when the action occured - 'LoginAuthenticateAudit': a login attempt for a valid user account either succeeded or failed. No return data is accepted; this hook is for auditing only. $user: the User object being authenticated against -- To view, visit https://gerrit.wikimedia.org/r/55282 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I830abd60f559cdd276458447f8f4c772b2d136b1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wikidata-wmfphase1beta Gerrit-Owner: saper sa...@saper.info Gerrit-Reviewer: Siebrand siebr...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Refactor XFF processing into clientBehindProxy - change (mediawiki...CheckUser)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/53050 Change subject: Refactor XFF processing into clientBehindProxy .. Refactor XFF processing into clientBehindProxy Refactor getClientIPfromXFF() into clientBehindProxy() and remove copy+paste logic to fill in `cuc_xff` and `cuc_xff_hex` fields of the database. Introduce RL stylesheet to get rid of embedded background colors. Conflicts: CheckUser.hooks.php Change-Id: I6f655bade49887ad9941bde09911c42ada1c700b --- M CheckUser.hooks.php M CheckUser.php M CheckUser_body.php A checkuser.css 4 files changed, 75 insertions(+), 35 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser refs/changes/50/53050/1 diff --git a/CheckUser.hooks.php b/CheckUser.hooks.php index 50f3121..f9c7059 100644 --- a/CheckUser.hooks.php +++ b/CheckUser.hooks.php @@ -11,9 +11,10 @@ extract( $rc-mAttribs ); // Get IP $ip = $wgRequest-getIP(); - // Get XFF header - $xff = $wgRequest-getHeader( 'X-Forwarded-For' ); - list( $xff_ip, $isSquidOnly ) = self::getClientIPfromXFF( $xff ); + // Handle XFF header + list( $cuc_xff_chain, $cuc_xff_hex ) = self::clientBehindProxy( + $wgRequest-getHeader( 'X-Forwarded-For' ) + ); // Get agent $agent = $wgRequest-getHeader( 'User-Agent' ); // Store the log action text for log events @@ -48,8 +49,8 @@ 'cuc_timestamp' = $rc_timestamp, 'cuc_ip' = IP::sanitizeIP( $ip ), 'cuc_ip_hex' = $ip ? IP::toHex( $ip ) : null, - 'cuc_xff'= !$isSquidOnly ? $xff : '', - 'cuc_xff_hex'= ( $xff_ip !$isSquidOnly ) ? IP::toHex( $xff_ip ) : null, + 'cuc_xff'= $cuc_xff_chain, + 'cuc_xff_hex'= $cuc_xff_hex, 'cuc_agent' = $agent ); # On PG, MW unsets cur_id due to schema incompatibilites. So it may not be set! @@ -68,9 +69,10 @@ public static function updateCUPasswordResetData( User $user, $ip, $account ) { global $wgRequest; - // Get XFF header - $xff = $wgRequest-getHeader( 'X-Forwarded-For' ); - list( $xff_ip, $isSquidOnly ) = self::getClientIPfromXFF( $xff ); + // Handle XFF header + list( $cuc_xff_chain, $cuc_xff_hex ) = self::clientBehindProxy( + $wgRequest-getHeader( 'X-Forwarded-For' ) + ); // Get agent $agent = $wgRequest-getHeader( 'User-Agent' ); $dbw = wfGetDB( DB_MASTER ); @@ -90,8 +92,8 @@ 'cuc_timestamp' = $dbw-timestamp( wfTimestampNow() ), 'cuc_ip' = IP::sanitizeIP( $ip ), 'cuc_ip_hex' = $ip ? IP::toHex( $ip ) : null, - 'cuc_xff'= !$isSquidOnly ? $xff : '', - 'cuc_xff_hex'= ( $xff_ip !$isSquidOnly ) ? IP::toHex( $xff_ip ) : null, + 'cuc_xff'= $cuc_xff_chain, + 'cuc_xff_hex'= $cuc_xff_hex, 'cuc_agent' = $agent ); $dbw-insert( 'cu_changes', $rcRow, __METHOD__ ); @@ -113,9 +115,10 @@ $hash = md5( $userTo-getEmail() . $userTo-getId() . $wgSecretKey ); // Get IP $ip = $wgRequest-getIP(); - // Get XFF header - $xff = $wgRequest-getHeader( 'X-Forwarded-For' ); - list( $xff_ip, $isSquidOnly ) = self::getClientIPfromXFF( $xff ); + // Handle XFF header + list( $cuc_xff_chain, $cuc_xff_hex ) = self::clientBehindProxy( + $wgRequest-getHeader( 'X-Forwarded-For' ) + ); // Get agent $agent = $wgRequest-getHeader( 'User-Agent' ); $dbw = wfGetDB( DB_MASTER ); @@ -135,8 +138,8 @@ 'cuc_timestamp' = $dbw-timestamp( wfTimestampNow() ), 'cuc_ip' = IP::sanitizeIP( $ip ), 'cuc_ip_hex' = $ip ? IP::toHex( $ip ) : null, - 'cuc_xff'= !$isSquidOnly ? $xff : '', - 'cuc_xff_hex'= ( $xff_ip !$isSquidOnly ) ? IP::toHex( $xff_ip ) : null, + 'cuc_xff'= $cuc_xff_chain, + 'cuc_xff_hex'= $cuc_xff_hex, 'cuc_agent' = $agent ); if ( trim( $wgCUPublicKey ) != '' ) { @@ -184,9 +187,11 @@ //
[MediaWiki-commits] [Gerrit] bug 44901: Polish declesion for Wikipodróże - change (mediawiki...WikimediaMessages)
saper has uploaded a new change for review. https://gerrit.wikimedia.org/r/48617 Change subject: bug 44901: Polish declesion for Wikipodróże .. bug 44901: Polish declesion for Wikipodróże Declinate Wikiprodróże properly according to Polish grammar rules. This is the Polish name for the Wikiyoyage project. Change-Id: Iaaa6dd2d9827335986226a6e330669f9629df09e --- M WikimediaGrammarForms.php 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages refs/changes/17/48617/1 -- To view, visit https://gerrit.wikimedia.org/r/48617 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaaa6dd2d9827335986226a6e330669f9629df09e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMessages Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] bogus line 2 - change (mediawiki/core[master])
saper has uploaded a new change for review. Change subject: bogus line 2 .. bogus line 2 Change-Id: Ie2f78dc21d256334757b0b65c5eb19bd0da431aa --- M RELEASE-NOTES-1.20 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/42/47342/1 -- To view, visit https://gerrit.wikimedia.org/r/47342 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2f78dc21d256334757b0b65c5eb19bd0da431aa Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Dont add LF to Subject: in gerrit notifications - change (operations/puppet[production])
saper has uploaded a new change for review. Change subject: Dont add LF to Subject: in gerrit notifications .. Dont add LF to Subject: in gerrit notifications Workaround for Gerrit issue http://code.google.com/p/gerrit/issues/detail?id=1776 Our notification emails have subject line like this: Subject: =?UTF-8?Q?[Gerrit]_Update_pom_-_change_(mediawiki...mwdumper[master])=0A?= While it should be (in this case): Subject: [Gerrit] Update pom - change (mediawiki...mwdumper[master]) without extra LF at the end. Original (not customized) notification emails do not have this problem because the last token on the line is a macro call (#elipses). This is a Velocity Template Engine problem that should probably be worked around in Gerrit: https://issues.apache.org/jira/browse/VELOCITY-253 Change-Id: I893d8cfbd420888c346b3a305de0329f24e76ff4 --- M files/gerrit/mail/ChangeSubject.vm 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/43/47343/1 -- To view, visit https://gerrit.wikimedia.org/r/47343 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I893d8cfbd420888c346b3a305de0329f24e76ff4 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Refactor mail-instance-creator.py puppetsigner.py - change (operations/puppet[production])
saper has uploaded a new change for review. Change subject: Refactor mail-instance-creator.py puppetsigner.py .. Refactor mail-instance-creator.py puppetsigner.py This is a draft to improve code in those two scripts, removing some code duplication and typical pythonic idioms. And PEP#8 complaince by the way. Change-Id: I78b3b46b9943a76123b22bdcd7f212b226c53ce6 --- M files/ldap/scripts/mail-instance-creator.py M files/ldap/scripts/puppetsigner.py 2 files changed, 129 insertions(+), 93 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/85/47385/1 -- To view, visit https://gerrit.wikimedia.org/r/47385 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I78b3b46b9943a76123b22bdcd7f212b226c53ce6 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] bug 44136: Don't rollback after successful commit - change (mediawiki/core[master])
saper has uploaded a new change for review. Change subject: bug 44136: Don't rollback after successful commit .. bug 44136: Don't rollback after successful commit For PostgreSQL only: SavepointPostgres tries to rollback already committed/rolled back transactions, so after it got committed, don't try to rollback it again in SavepointPostgres::__destroy. This happens only when trying to INSERT IGNORE something without having a transaction open first (e.g. during unit testing). Thanks to: OverlordQ overlo...@gmail.com Change-Id: I40ff757a7e2c6ff21f73e1ecd35754e1981f1941 --- M includes/db/DatabasePostgres.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/31/45231/1 -- To view, visit https://gerrit.wikimedia.org/r/45231 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I40ff757a7e2c6ff21f73e1ecd35754e1981f1941 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] bug 32504: Import of MoreBugUrl extension - change (wikimedia...modifications[master])
saper has uploaded a new change for review. Change subject: bug 32504: Import of MoreBugUrl extension .. bug 32504: Import of MoreBugUrl extension Allow add bugs.php.net for See Also field. Imported Bzr revision r8558 from bzr://bzr.mozilla.org/bugzilla/trunk/ Change-Id: I3aa781ac5f9eb01c0fb4c5426aac2fbeb14fcec5 --- A bugzilla-4.2/extensions/MoreBugUrl/Config.pm A bugzilla-4.2/extensions/MoreBugUrl/Extension.pm A bugzilla-4.2/extensions/MoreBugUrl/disabled A bugzilla-4.2/extensions/MoreBugUrl/lib/GetSatisfaction.pm A bugzilla-4.2/extensions/MoreBugUrl/lib/PHP.pm A bugzilla-4.2/extensions/MoreBugUrl/lib/RT.pm A bugzilla-4.2/extensions/MoreBugUrl/lib/ReviewBoard.pm A bugzilla-4.2/extensions/MoreBugUrl/lib/Rietveld.pm A bugzilla-4.2/extensions/MoreBugUrl/template/en/default/hook/global/user-error-bug_url_invalid_tracker.html.tmpl 9 files changed, 293 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/bugzilla/modifications refs/changes/93/44393/1 -- To view, visit https://gerrit.wikimedia.org/r/44393 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3aa781ac5f9eb01c0fb4c5426aac2fbeb14fcec5 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/bugzilla/modifications Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add namespace aliases for Czech (cs) language - change (mediawiki...ProofreadPage[master])
saper has uploaded a new change for review. Change subject: Add namespace aliases for Czech (cs) language .. Add namespace aliases for Czech (cs) language Change-Id: Ic1da4e57f8077f1a42fa552f0c84473706a2125b --- M ProofreadPage.namespaces.php 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage refs/changes/65/42365/1 -- To view, visit https://gerrit.wikimedia.org/r/42365 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1da4e57f8077f1a42fa552f0c84473706a2125b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ProofreadPage Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info Gerrit-Reviewer: Danny B. wikimedia.dann...@email.cz ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add namespace aliases for Czech (cs) language - change (mediawiki...ProofreadPage[master])
saper has submitted this change and it was merged. Change subject: Add namespace aliases for Czech (cs) language .. Add namespace aliases for Czech (cs) language Change-Id: Ic1da4e57f8077f1a42fa552f0c84473706a2125b --- M ProofreadPage.namespaces.php 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: saper: Verified; Looks good to me, approved Dereckson: Looks good to me, but someone else must approve Danny B.: Looks good to me, but someone else must approve -- To view, visit https://gerrit.wikimedia.org/r/42365 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic1da4e57f8077f1a42fa552f0c84473706a2125b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ProofreadPage Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info Gerrit-Reviewer: Danny B. wikimedia.dann...@email.cz Gerrit-Reviewer: Dereckson dereck...@espace-win.org Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: Siebrand siebr...@wikimedia.org Gerrit-Reviewer: Tpt thoma...@hotmail.fr 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] (bug 37419) Rewriting of Index pages edit form in PHP - change (mediawiki...ProofreadPage[master])
saper has uploaded a new change for review. Change subject: (bug 37419) Rewriting of Index pages edit form in PHP .. (bug 37419) Rewriting of Index pages edit form in PHP Rewriting of the index form in PHP in order to improve performance (the edit toolbars were loaded and showed and then Prp created the form) and allow easy editing of index pages Creation of json configuration message proofreadpage_index_data_config that replace proofreadpage_index_attributes and proofreadpage_js_attributes. Wiki can keep using the two old messages. The description of the syntax is done in ProofreadIndexPage::getDataConfig() This creation allow to add new features in the form: - list of possible values for a field (show as a select html element) - help messages - type for each data - default values There is no validation in this form in order to support existant data. The names and id of field has change: a prefix wpprpindex- is added in order to avoid any id conflict Some generic classes where added: - ProofreadIndexPage that offer methods in order to get index page content. - ProofreadIndexEntry that manage an entry in the index page and is configuration. Use of these two classes inside of existing parts of the ProofreeadPage extension will be done in an other commit. History: gerrit change https://gerrit.wikimedia.org/r/#/c/10741/ Old-Id: Iaade8c7ee83035387be16e24d35e29c45a5717b2 Patch set 1-8: creation of a new form generator in Javascript Patch set 9: Rebase + change name of config message and various small improvements Patch set 10: Writing of PHP form generator. Patch set 11: Fix bug: The PHP form didn't works in preview mode + small improvements Patch set 12: Fix some bugs in cleanInputtedContent (see inline comments of Patch set 11 in EditProofreadIndexPage.php) Patch set 13: Rebase + some UI improvements Change-Id: I942304918b780ef97f516aef8cb9f962a44de627 --- M ProofreadPage.body.php M ProofreadPage.i18n.php M ProofreadPage.php A includes/index/EditProofreadIndexPage.php A includes/index/ProofreadIndexEntry.php A includes/index/ProofreadIndexPage.php A modules/ext.proofreadpage.index/ext.proofreadpage.index.css M modules/ext.proofreadpage.index/ext.proofreadpage.index.js 8 files changed, 605 insertions(+), 145 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage refs/changes/99/27199/1 -- To view, visit https://gerrit.wikimedia.org/r/27199 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I942304918b780ef97f516aef8cb9f962a44de627 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ProofreadPage Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info Gerrit-Reviewer: Tpt thoma...@hotmail.fr ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Need to add actual namespaces for the extension - change (mediawiki...Widgets[master])
saper has uploaded a new change for review. Change subject: Need to add actual namespaces for the extension .. Need to add actual namespaces for the extension Without this, nothing works :) Change-Id: I04b5c4b3b0e9898a6f597a65822071f530a94d30 --- M Widgets.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Widgets refs/changes/87/24387/1 -- To view, visit https://gerrit.wikimedia.org/r/24387 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04b5c4b3b0e9898a6f597a65822071f530a94d30 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Widgets Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (bug 36819) Lowercase ba,bat-smg,bxr,crh,krc,kv,mdf,myv,tyv,... - change (mediawiki/core[master])
saper has uploaded a new change for review. Change subject: (bug 36819) Lowercase ba,bat-smg,bxr,crh,krc,kv,mdf,myv,tyv,vep,xal .. (bug 36819) Lowercase ba,bat-smg,bxr,crh,krc,kv,mdf,myv,tyv,vep,xal Follow up to gerrit change 7306: https://gerrit.wikimedia.org/r/#/c/7306/ Lowercase some Eastern European and Central Asian language names. 'ba' = 'башҡортса',# Bashkir 'bat-smg' = 'žemaitėška', # Samogitian (deprecated code, 'sgs' in ISO 693-3 since 2010-06-30 ) 'bxr' = 'буряад', # Buryat (Russia) 'crh' = 'qırımtatarca', # Crimean Tatar (multiple scripts - defaults to Latin) 'crh-latn' = \xE2\x80\xAAqırımtatarca (Latin)\xE2\x80\xAC, # Crimean Tatar (Latin) 'crh-cyrl' = \xE2\x80\xAAкъырымтатарджа (Кирилл)\xE2\x80\xAC, # Crimean Tatar (Cyrillic) 'krc' = 'къарачай-малкъар', # Karachay-Balkar 'kv' = 'коми', # Komi-Zyrian (Cyrillic is common script but also written in Latin script) 'mdf' = 'мокшень', # Moksha 'myv' = 'эрзянь', # Erzya 'tyv' = 'тыва дыл',# Tyvan 'udm' = 'удмурт', # Udmurt 'vep' = 'vepsän kel’', # Veps 'xal' = 'хальмг', # Kalmyk-Oirat (Kalmuk, Kalmuck, Kalmack, Qalmaq, Kalmytskii Jazyk, Khal:mag, Oirat, Volga Oirat, European Oirat, Western Mongolian) Change-Id: I47ad9b05eca9f5c2fe69ef2e8f5325371b0f9e89 --- M languages/Names.php 1 file changed, 14 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/76/14676/1 -- To view, visit https://gerrit.wikimedia.org/r/14676 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I47ad9b05eca9f5c2fe69ef2e8f5325371b0f9e89 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (bug 36819) Lowercase Kazakh and Uzbek - change (mediawiki/core[master])
saper has uploaded a new change for review. Change subject: (bug 36819) Lowercase Kazakh and Uzbek .. (bug 36819) Lowercase Kazakh and Uzbek Follow up to gerrit change 7306: https://gerrit.wikimedia.org/r/#/c/7306/ Lowercase some Central Asian language names. 'kk' = 'қазақша', # Kazakh (multiple scripts - defaults to Cyrillic) 'kk-cyrl' = \xE2\x80\xAAқазақша (кирил)\xE2\x80\xAC, # Kazakh Cyrillic 'kk-latn' = \xE2\x80\xAAqazaqşa (latın)\xE2\x80\xAC, # Kazakh Latin 'kk-kz' = \xE2\x80\xAAқазақша (Қазақстан)\xE2\x80\xAC, # Kazakh (Kazakhstan) 'kk-tr' = \xE2\x80\xAAqazaqşa (Türkïya)\xE2\x80\xAC, # Kazakh (Turkey) 'uz' = 'oʻzbekcha',# Uzbek Change-Id: Ieb56ff2854464ea57169985b40fb7f6fdcfacc33 --- M languages/Names.php 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/77/14677/1 -- To view, visit https://gerrit.wikimedia.org/r/14677 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb56ff2854464ea57169985b40fb7f6fdcfacc33 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (bug 36819) Lowercase av,ce,lbe and lez - change (mediawiki/core[master])
saper has uploaded a new change for review. Change subject: (bug 36819) Lowercase av,ce,lbe and lez .. (bug 36819) Lowercase av,ce,lbe and lez Follow up to gerrit change 7306: https://gerrit.wikimedia.org/r/#/c/7306/ Lowercase some language names from Caucasus 'av' = 'авар', # Avar 'ce' = 'нохчийн', # Chechen 'lbe' = 'лакку', # Lak 'lez' = 'лезги', # Lezgi Change-Id: Ia5a8a28c6cc0159898469cc458dd366886916c86 --- M languages/Names.php 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/81/14681/1 -- To view, visit https://gerrit.wikimedia.org/r/14681 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia5a8a28c6cc0159898469cc458dd366886916c86 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: saper sa...@saper.info ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits