[MediaWiki-commits] [Gerrit] filebackend: throw exceptions during file iteration. - change (mediawiki/core)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/68940 Change subject: filebackend: throw exceptions during file iteration. .. filebackend: throw exceptions during file iteration. * This lets calling code be far more robust rather than just silently ignoring entries due to some temporary problem. Change-Id: I3ce2ae34f6cff5e40a80b8da5688503a387ce2a6 --- M includes/AutoLoader.php M includes/filebackend/FSFileBackend.php M includes/filebackend/FileBackend.php M includes/filebackend/SwiftFileBackend.php 4 files changed, 28 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/40/68940/1 diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 02c92df..38b27e6 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -551,6 +551,7 @@ # includes/filebackend 'FileBackendGroup' = 'includes/filebackend/FileBackendGroup.php', 'FileBackend' = 'includes/filebackend/FileBackend.php', + 'FileBackendError' = 'includes/filebackend/FileBackend.php', 'FileBackendStore' = 'includes/filebackend/FileBackendStore.php', 'FileBackendStoreShardListIterator' = 'includes/filebackend/FileBackendStore.php', 'FileBackendStoreShardDirIterator' = 'includes/filebackend/FileBackendStore.php', diff --git a/includes/filebackend/FSFileBackend.php b/includes/filebackend/FSFileBackend.php index dfc5192..6d64216 100644 --- a/includes/filebackend/FSFileBackend.php +++ b/includes/filebackend/FSFileBackend.php @@ -854,8 +854,8 @@ try { $this-iter-next(); $this-filterViaNext(); - } catch ( UnexpectedValueException $e ) { - $this-iter = null; + } catch ( UnexpectedValueException $e ) { // bad permissions? deleted? + throw new FileBackendError( File iterator gave UnexpectedValueException. ); } ++$this-pos; } @@ -869,8 +869,8 @@ try { $this-iter-rewind(); $this-filterViaNext(); - } catch ( UnexpectedValueException $e ) { - $this-iter = null; + } catch ( UnexpectedValueException $e ) { // bad permissions? deleted? + throw new FileBackendError( File iterator gave UnexpectedValueException. ); } } diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index 29af88d..9b4760a 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -1061,6 +1061,8 @@ * * Storage backends with eventual consistency might return stale data. * +* Failures during iteration can result in FileBackendError exceptions (since 1.22). +* * @param array $params * $params include: * - dir : storage directory @@ -1075,6 +1077,8 @@ * directories that are immediately under the given directory. * * Storage backends with eventual consistency might return stale data. +* +* Failures during iteration can result in FileBackendError exceptions (since 1.22). * * @param array $params * $params include: @@ -1096,6 +1100,8 @@ * * Storage backends with eventual consistency might return stale data. * +* Failures during iteration can result in FileBackendError exceptions (since 1.22). +* * @param array $params * $params include: * - dir: storage directory @@ -1110,6 +1116,8 @@ * files that are immediately under the given directory. * * Storage backends with eventual consistency might return stale data. +* +* Failures during iteration can result in FileBackendError exceptions (since 1.22). * * @param array $params * $params include: @@ -1379,3 +1387,9 @@ return $path; } } + +/** + * @ingroup FileBackend + * @since 1.22 + */ +class FileBackendError extends MWException {} diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index a57bf59..f3aa145 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -926,6 +926,7 @@ * @param integer $limit Max number of items to list * @param array $params Parameters for getDirectoryList() * @return Array List of resolved paths of directories directly under $dir +* @throws FileBackendError */ public function getDirListPageInternal( $fullCont, $dir, $after, $limit, array $params ) { $dirs = array(); @@ -933,7 +934,7 @@
[MediaWiki-commits] [Gerrit] Support inter-page JSON references - change (mediawiki...EventLogging)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/68941 Change subject: Support inter-page JSON references .. Support inter-page JSON references Doesn't quite adhere to the JSON Reference draft spec. WIP. Change-Id: I2b5aae432d8f8259d0bc170f69f363faa5dc27b1 --- M includes/JsonSchemaContent.php 1 file changed, 37 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging refs/changes/41/68941/1 diff --git a/includes/JsonSchemaContent.php b/includes/JsonSchemaContent.php index 1ba47d5..7c12f1b 100644 --- a/includes/JsonSchemaContent.php +++ b/includes/JsonSchemaContent.php @@ -15,8 +15,39 @@ */ class JsonSchemaContent extends TextContent { + const DEFAULT_RECURSION_LIMIT = 3; + function __construct( $text ) { parent::__construct( $text, 'JsonSchema' ); + } + + /** +* Resolve a JSON reference to a schema. +* @param string $ref Schema reference with format 'Title/Revision'. +*/ + static function resolve( $ref ) { + list( $title, $revId ) = explode( '/', $ref ); + $rs = new RemoteSchema( $title, $revId ); + return $rs-get(); + } + + /** +* Recursively resolve references in a schema. +* @param array $schema Schema object to expand. +* @param int $recursionLimit Maximum recursion limit. +* @return array: Expanded schema object. +*/ + static function expand( $schema, $recursionLimit = JsonSchemaContent::DEFAULT_RECURSION_LIMIT ) { + return array_map( function ( $value ) { + if ( is_array( $value ) $recursionLimit 0 ) { + if ( isset( $value['$ref'] ) ) { + $value = JsonSchemaContent::resolve( $value['$ref'] ); + } + return JsonSchemaContent::expand( $value, $recursionLimit - 1 ); + } else { + return $value; + } + }, $schema ); } /** @@ -87,6 +118,12 @@ $th = Xml::elementClean( 'th', array(), $key ); if ( is_array( $val ) ) { $td = Xml::tags( 'td', array(), self::objectTable( $val ) ); + } elseif ( $key === '$ref' ) { + list( , $revId ) = explode( '/', $val ); + $title = Revision::newFromId( $revId )-getTitle(); + $link = Linker::link( $title, htmlspecialchars( $val ), array(), + array( 'oldid' = $revId ) ); + $td = Xml::tags( 'td', array( 'class' = 'value' ), $link ); } else { if ( is_string( $val ) ) { $val = '' . $val . ''; -- To view, visit https://gerrit.wikimedia.org/r/68941 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b5aae432d8f8259d0bc170f69f363faa5dc27b1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EventLogging Gerrit-Branch: master Gerrit-Owner: Ori.livneh o...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adds signature to talk page messages - change (mediawiki...PageTriage)
Nischayn22 has uploaded a new change for review. https://gerrit.wikimedia.org/r/68942 Change subject: Adds signature to talk page messages .. Adds signature to talk page messages Bug: 49632 Change-Id: Icf5f7f7e813f6b4ba58c9ea8b5a79e9420198b61 --- M modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage refs/changes/42/68942/1 diff --git a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js index f247d10..724dffb 100644 --- a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js +++ b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js @@ -93,7 +93,7 @@ note = '{{subst:' + mw.config.get( 'wgTalkPageNoteTemplate' )['UnMark']['note'] + '|' + pageTitle + '|' + mw.config.get( 'wgUserName' ) - + '|' + note + '}}'; + + '|' + note + ' ' + '}}'; } else { note = '{{subst:' + mw.config.get( 'wgTalkPageNoteTemplate' )['UnMark']['nonote'] + '|' + mw.config.get( 'wgUserName' ) @@ -118,7 +118,7 @@ note = '{{subst:' + mw.config.get( 'wgTalkPageNoteTemplate' )['Mark'] + '|' + pageTitle + '|' + mw.config.get( 'wgUserName' ) - + '|' + note + '}}'; + + '|' + note + ' ' + '}}'; } $.ajax( { -- To view, visit https://gerrit.wikimedia.org/r/68942 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf5f7f7e813f6b4ba58c9ea8b5a79e9420198b61 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PageTriage Gerrit-Branch: master Gerrit-Owner: Nischayn22 nischay...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] API python framework - change (mediawiki...ZeroRatedMobileAccess)
Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/68943 Change subject: API python framework .. API python framework Change-Id: I87f2c2fa27357a57354b235f26c2350c38e37307 --- A maintenance/api.py 1 file changed, 177 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroRatedMobileAccess refs/changes/43/68943/1 diff --git a/maintenance/api.py b/maintenance/api.py new file mode 100644 index 000..ef78147 --- /dev/null +++ b/maintenance/api.py @@ -0,0 +1,177 @@ +from __future__ import print_function +import json +import requests +try: +import urllib.parse as urlparse +except ImportError: +import urlparse + + +class ConsoleLog(object): + +Basic console logger. Most frameworks would probably want to implement their own. + +def __init__(self, verbosity=5): +self.verbosity = verbosity + +def log(self, level, msg): +If level is less than or equal to verbosity, prints level and the msg +if self.isEnabled(level): +print(str(level) + ': ' + str(msg)) + +def isEnabled(self, level): +True if level is less than or equal to verbosity set for this instance +return level = self.verbosity + + +class ApiError(Exception): + +Any error reported by the API is included in this exception + +def __init__(self, data): +self.data = data + +def __str__(self): +return json.dumps(self.data) + +class Site(object): + +Public properties (member variables at the moment): +* url: Full url to site's api.php +* session: current request.session object +* log: an object that will be used for logging. ConsoleLog is created by default + + +def __init__(self, url, session=None, log=None): +self.session = session if session is not None else requests.session() +self.log = log if log is not None else ConsoleLog() +self.url = url + +def __call__(self, action, **kwargs): + +Make an API call with any arguments provided as named values: + +data = site('query', meta='siteinfo') + +By default uses GET request to the default URL set in the Site constructor. +In case of an error, ApiError exception will be raised + +Several special magic parameters could be used to customize api call. +Special parameters must be all CAPS to avoid collisions with the server API: +:param POST: Use POST method when calling server API. Value is ignored. +:param HTTPS: Force https (ssl) protocol for this request. Value is ignored. +:param HEADERS: Additional headers (dict) to include with request. Value is ignored. + +# Magic CAPS parameters +usePost = 'POST' in kwargs or action in ['login', 'edit'] +forceSSL = action == 'login' or 'SSL' in kwargs or 'HTTPS' in kwargs +headers = None if 'HEADERS' not in kwargs else kwargs['HEADERS'] + +# Clean up magic CAPS params as they shouldn't be passed to the server +for k in ['POST', 'SSL', 'HTTPS', 'HEADERS']: +if k in kwargs: +del kwargs[k] + +# Make server call +kwargs['action'] = action +kwargs['format'] = 'json' +data = self.request(kwargs, headers, usePost, forceSSL).json() + +# Handle success and failure +if 'error' in data: +raise ApiError(data['error']) +if 'warnings' in data: +self.log(2, data['warnings']) +return data + +def login(self, user, password): +res = self('login', lgname=user, lgpassword=password)['login'] +if res['result'] == 'NeedToken': +res = self('login', lgname=user, lgpassword=password, lgtoken=res['token'])['login'] +if res['result'] != 'Success': +raise ApiError(res) + +def query(self, **kwargs): +if 'continue' not in kwargs: +kwargs['continue'] = '' +req = kwargs +while True: +result = self('query', **req) +if 'query' in result: +yield result['query'] +if 'continue' not in result: +break +# re-send all continue values in the next call +req = dict(kwargs) +req.update(result['continue']) + +def __queryPages(self, **kwargs): + UNFINISHED!!! +incomplete={} +changed={} +for result in self.query(**kwargs): +for page in result['pages']: +id = page['id'] +if id in changed: +continue +if id in incomplete: +p = incomplete[id] +del incomplete[id] +if p['lastrevid'] != page['lastrevid']: +# someone else modified
[MediaWiki-commits] [Gerrit] Replace is_array/is_string with a more performant approach - change (mediawiki...SemanticMediaWiki)
Mwjames has uploaded a new change for review. https://gerrit.wikimedia.org/r/68944 Change subject: Replace is_array/is_string with a more performant approach .. Replace is_array/is_string with a more performant approach Instead of doing is_array( $msg ) use (array)$msg === $msg See also [1] ## Comparison based on available unit tests (array)$msg === $msg + (string)$msg === $msg - 1) SMW\Test\MessageFormatterTest::testNewFromArray with data set #1 (array('Foo', 'Bar', array('FooBar', array('barFoo', 'Foo'))), 4) This test printed output: double(3.0994415283203E-5) double(0.00034093856811523) double(0.00063109397888184) double(2.288818359375E-5) double(0.00026392936706543) double(0.00048208236694336) double(2.288818359375E-5) double(0.00026202201843262) double(0.00049209594726562) 23) SMW\Test\MessageFormatterTest::testEscapedUnescaped This test printed output: double(2.6941299438477E-5) double(2.5033950805664E-5) is_array( $msg ) + is_string( $msg ) - 1) SMW\Test\MessageFormatterTest::testNewFromArray with data set #1 (array('Foo', 'Bar', array('FooBar', array('barFoo', 'Foo'))), 4) This test printed output: double(6.0081481933594E-5) double(0.0003960132598877) double(0.00072503089904785) double(4.9114227294922E-5) double(0.00031900405883789) double(0.00063800811767578) double(4.8160552978516E-5) double(0.0003049373626709) double(0.00055289268493652) 23) SMW\Test\MessageFormatterTest::testEscapedUnescaped This test printed output: double(4.2915344238281E-5) double(3.8862228393555E-5) [1] https://drupal.org/node/1141770 Change-Id: I7ee8d7024f0ecf838d1a5b3f2d6ae0c063b20a50 --- M includes/formatters/MessageFormatter.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki refs/changes/44/68944/1 diff --git a/includes/formatters/MessageFormatter.php b/includes/formatters/MessageFormatter.php index 6ae41ff..d6a6b48 100644 --- a/includes/formatters/MessageFormatter.php +++ b/includes/formatters/MessageFormatter.php @@ -225,11 +225,11 @@ if ( $msg instanceof Message ) { $newArray[] = $msg-inLanguage( $this-language )-text(); - } else if ( is_array( $msg ) ) { + } else if ( (array)$msg === $msg ) { foreach ( $this-doFormat( $msg ) as $m ) { $newArray[] = $m; } - } else if ( is_string( $msg ) ) { + } else if ( (string)$msg === $msg ) { $newArray[] = $msg; } } -- To view, visit https://gerrit.wikimedia.org/r/68944 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ee8d7024f0ecf838d1a5b3f2d6ae0c063b20a50 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticMediaWiki Gerrit-Branch: master Gerrit-Owner: Mwjames jamesin.hongkon...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Preparation to support SMW\JsonParameterFormatter - change (mediawiki...SemanticMediaWiki)
Mwjames has uploaded a new change for review. https://gerrit.wikimedia.org/r/68945 Change subject: Preparation to support SMW\JsonParameterFormatter .. Preparation to support SMW\JsonParameterFormatter * Clean-up to enable to support to JsonParameterFormatter * Add SMW\ParameterFormatterFactory * Move $GLOBALS out of RecurringEventsParserFunction Change-Id: I6f5ff1b05d6b9c3b2ac5ea2dcbe391b768a66c3e --- M includes/Setup.php M includes/formatters/ArrayFormatter.php A includes/formatters/ParameterFormatterFactory.php M includes/formatters/ParserParameterFormatter.php M includes/parserhooks/RecurringEventsParserFunction.php M includes/parserhooks/SetParserFunction.php M includes/parserhooks/SubobjectParserFunction.php A tests/phpunit/includes/formatters/ParameterFormatterFactoryTest.php M tests/phpunit/includes/parserhooks/RecurringEventsParserFunctionTest.php M tests/phpunit/includes/parserhooks/SubobjectParserFunctionTest.php 10 files changed, 454 insertions(+), 167 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki refs/changes/45/68945/1 diff --git a/includes/Setup.php b/includes/Setup.php index 4e4b36b..895960a 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -151,10 +151,11 @@ $wgAutoloadClasses['SMW\CacheHandler'] = $incDir . '/handlers/CacheHandler.php'; // Formatters - $wgAutoloadClasses['SMW\ArrayFormatter'] = $incDir . 'formatters/ArrayFormatter.php'; - $wgAutoloadClasses['SMW\ParserParameterFormatter'] = $incDir . 'formatters/ParserParameterFormatter.php'; - $wgAutoloadClasses['SMW\MessageFormatter'] = $incDir . 'formatters/MessageFormatter.php'; - $wgAutoloadClasses['SMW\TableFormatter'] = $incDir . 'formatters/TableFormatter.php'; + $wgAutoloadClasses['SMW\ArrayFormatter'] = $incDir . 'formatters/ArrayFormatter.php'; + $wgAutoloadClasses['SMW\ParserParameterFormatter'] = $incDir . 'formatters/ParserParameterFormatter.php'; + $wgAutoloadClasses['SMW\MessageFormatter'] = $incDir . 'formatters/MessageFormatter.php'; + $wgAutoloadClasses['SMW\TableFormatter'] = $incDir . 'formatters/TableFormatter.php'; + $wgAutoloadClasses['SMW\ParameterFormatterFactory'] = $incDir . 'formatters/ParameterFormatterFactory.php'; // Exceptions $wgAutoloadClasses['SMW\StoreInstanceException'] = $incDir . '/exceptions/StoreInstanceException.php'; diff --git a/includes/formatters/ArrayFormatter.php b/includes/formatters/ArrayFormatter.php index d6a3471..108fd33 100644 --- a/includes/formatters/ArrayFormatter.php +++ b/includes/formatters/ArrayFormatter.php @@ -23,10 +23,50 @@ * @since 1.9 * * @file - * @ingroup Formatter - * @codeCoverageIgnore * - * @licence GNU GPL v2+ + * @license GNU GPL v2+ * @author mwjames */ -abstract class ArrayFormatter {} \ No newline at end of file + +/** + * Interface related to classes responsible for array formatting + * + * @ingroup Formatter + * @codeCoverageIgnore + */ +abstract class ArrayFormatter { + + /** @var array */ + protected $errors = array(); + + /** +* Returns collected errors +* +* @since 1.9 +* +* @return array +*/ + public function getErrors() { + return $this-errors; + } + + /** +* Adds an error +* +* @since 1.9 +* +* @param mixed $error +*/ + public function addError( $error ) { + $this-errors = array_merge( (array)$error === $error ? $error : array( $error ), $this-errors ); + } + + /** +* Returns a formatted array +* +* @since 1.9 +* +* Implementation is carried out by a subclasses +*/ + abstract public function toArray(); +} diff --git a/includes/formatters/ParameterFormatterFactory.php b/includes/formatters/ParameterFormatterFactory.php new file mode 100644 index 000..a0a9119 --- /dev/null +++ b/includes/formatters/ParameterFormatterFactory.php @@ -0,0 +1,65 @@ +?php + +namespace SMW; + +/** + * Factory class handling parameter formatting instances + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc.,
[MediaWiki-commits] [Gerrit] Rewrite storage to get rid of multiple issues - change (mediawiki...InviteSignup)
Nikerabbit has submitted this change and it was merged. Change subject: Rewrite storage to get rid of multiple issues .. Rewrite storage to get rid of multiple issues Change-Id: I540886ca642dcdaa2cdcaf7d89866394dbcf228e --- M InviteSignup.php A InviteStore.php M SpecialInviteSignup.php A sql/invitesignup.sql 4 files changed, 137 insertions(+), 80 deletions(-) Approvals: Nikerabbit: Verified; Looks good to me, approved diff --git a/InviteSignup.php b/InviteSignup.php index 0c81f9e..caa51a5 100644 --- a/InviteSignup.php +++ b/InviteSignup.php @@ -7,7 +7,7 @@ * @ingroup Extensions * * @author Niklas Laxström - * @copyright Copyright © 2012 Lost in Translations Inc. + * @copyright Copyright © 2012-2013 Lost in Translations Inc. * @license GPL 2.0 or later */ @@ -20,10 +20,11 @@ ); $dir = __DIR__; -$wgSpecialPages['InviteSignup'] = 'SpecialInviteSignup'; +$wgAutoloadClasses['InviteStore'] = $dir/InviteStore.php; $wgAutoloadClasses['SpecialInviteSignup'] = $dir/SpecialInviteSignup.php; $wgExtensionMessagesFiles['InviteSignupAlias'] = $dir/InviteSignup.alias.php; $wgExtensionMessagesFiles['InviteSignup'] = $dir/InviteSignup.i18n.php; +$wgSpecialPages['InviteSignup'] = 'SpecialInviteSignup'; $wgAvailableRights[] = 'invitesignup'; $wgInviteSignupHash = null; @@ -45,8 +46,9 @@ $hash = $request-getVal( 'invite', $request-getCookie( 'invite' ) ); if ( $hash ) { - $invite = SpecialInviteSignup::getInvite( $hash ); - if ( $invite $invite['used'] === false ) { + $store = new InviteStore( wfGetDB( DB_SLAVE ), 'invitesignup' ); + $invite = $store-getInvite( $hash ); + if ( $invite $invite['used'] === null ) { global $wgInviteSignupHash; $wgInviteSignupHash = $hash; $request-response()-setCookie( 'invite', $hash ); @@ -82,7 +84,10 @@ if ( $wgInviteSignupHash === null ) { return true; } - $invite = SpecialInviteSignup::getInvite( $wgInviteSignupHash ); + + $store = new InviteStore( wfGetDB( DB_MASTER ), 'invitesignup' ); + + $invite = $store-getInvite( $wgInviteSignupHash ); $user-setOption( 'is-inviter', $invite['inviter'] ); $user-setEmail( $invite['email'] ); $user-confirmEmail(); @@ -90,8 +95,14 @@ $user-addGroup( $group ); } $user-saveSettings(); - SpecialInviteSignup::addSignupDate( $user, $wgInviteSignupHash ); + $store-addSignupDate( $user, $wgInviteSignupHash ); global $wgRequest; $wgRequest-response()-setCookie( 'invite', '', time() - 86400 ); return true; }; + +$wgHooks['LoadExtensionSchemaUpdates'][] = function ( DatabaseUpdater $updater ) { + $dir = __DIR__ . '/sql'; + $updater-addExtensionTable( 'invitesignup', $dir/invitesignup.sql ); + return true; +}; diff --git a/InviteStore.php b/InviteStore.php new file mode 100644 index 000..980a8a0 --- /dev/null +++ b/InviteStore.php @@ -0,0 +1,88 @@ +?php +/** + * Storage abstraction for invites. + * + * @file + * @ingroup Extensions + * + * @author Niklas Laxström + * @copyright Copyright © 2013 Lost in Translations Inc. + */ + +/** + * InviteStore which uses database as storage. + */ +class InviteStore { + protected $db; + protected $dbTable; + + public function __construct( DatabaseBase $db, $table ) { + $this-db = $db; + $this-dbTable = $table; + } + + public function getInvites() { + $fields = array( '*' ); + $conds = array(); + $res = $this-db-select( $this-dbTable, $fields, $conds, __METHOD__ ); + $invites = array(); + foreach ( $res as $row ) { + $invites[] = $this-rowToArray( $row ); + } + return $invites; + } + + public function addInvite( User $inviter, $email, $groups ) { + global $wgSecretKey; + $hash = sha1( $inviter-getId() . $wgSecretKey . $email . wfTimestamp( TS_UNIX ) ); + + $data = array( + 'is_inviter' = $inviter-getId(), + 'is_email' = $email, + 'is_when' = wfTimestamp( TS_UNIX ), + 'is_hash' = $hash, + 'is_groups' = serialize( $groups ), + ); + + $this-db-insert( $this-dbTable, $data, __METHOD__ ); + + return $hash; + } + + + public function deleteInvite( $hash ) { + $conds = array( 'is_hash' = $hash ); + $this-db-delete( $this-dbTable, $conds, __METHOD__ ); + } + + public function getInvite( $hash ) { + $fields = array( '*' ); + $conds = array( 'is_hash' = $hash ); +
[MediaWiki-commits] [Gerrit] Preparation to support SMW\JsonParameterFormatter - change (mediawiki...SemanticMediaWiki)
jenkins-bot has submitted this change and it was merged. Change subject: Preparation to support SMW\JsonParameterFormatter .. Preparation to support SMW\JsonParameterFormatter * Clean-up to enable to support to JsonParameterFormatter * Add SMW\ParameterFormatterFactory * Move $GLOBALS out of RecurringEventsParserFunction Change-Id: I6f5ff1b05d6b9c3b2ac5ea2dcbe391b768a66c3e --- M includes/Setup.php M includes/formatters/ArrayFormatter.php A includes/formatters/ParameterFormatterFactory.php M includes/formatters/ParserParameterFormatter.php M includes/parserhooks/RecurringEventsParserFunction.php M includes/parserhooks/SetParserFunction.php M includes/parserhooks/SubobjectParserFunction.php A tests/phpunit/includes/formatters/ParameterFormatterFactoryTest.php M tests/phpunit/includes/parserhooks/RecurringEventsParserFunctionTest.php M tests/phpunit/includes/parserhooks/SubobjectParserFunctionTest.php 10 files changed, 454 insertions(+), 167 deletions(-) Approvals: Mwjames: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Setup.php b/includes/Setup.php index 4e4b36b..895960a 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -151,10 +151,11 @@ $wgAutoloadClasses['SMW\CacheHandler'] = $incDir . '/handlers/CacheHandler.php'; // Formatters - $wgAutoloadClasses['SMW\ArrayFormatter'] = $incDir . 'formatters/ArrayFormatter.php'; - $wgAutoloadClasses['SMW\ParserParameterFormatter'] = $incDir . 'formatters/ParserParameterFormatter.php'; - $wgAutoloadClasses['SMW\MessageFormatter'] = $incDir . 'formatters/MessageFormatter.php'; - $wgAutoloadClasses['SMW\TableFormatter'] = $incDir . 'formatters/TableFormatter.php'; + $wgAutoloadClasses['SMW\ArrayFormatter'] = $incDir . 'formatters/ArrayFormatter.php'; + $wgAutoloadClasses['SMW\ParserParameterFormatter'] = $incDir . 'formatters/ParserParameterFormatter.php'; + $wgAutoloadClasses['SMW\MessageFormatter'] = $incDir . 'formatters/MessageFormatter.php'; + $wgAutoloadClasses['SMW\TableFormatter'] = $incDir . 'formatters/TableFormatter.php'; + $wgAutoloadClasses['SMW\ParameterFormatterFactory'] = $incDir . 'formatters/ParameterFormatterFactory.php'; // Exceptions $wgAutoloadClasses['SMW\StoreInstanceException'] = $incDir . '/exceptions/StoreInstanceException.php'; diff --git a/includes/formatters/ArrayFormatter.php b/includes/formatters/ArrayFormatter.php index d6a3471..108fd33 100644 --- a/includes/formatters/ArrayFormatter.php +++ b/includes/formatters/ArrayFormatter.php @@ -23,10 +23,50 @@ * @since 1.9 * * @file - * @ingroup Formatter - * @codeCoverageIgnore * - * @licence GNU GPL v2+ + * @license GNU GPL v2+ * @author mwjames */ -abstract class ArrayFormatter {} \ No newline at end of file + +/** + * Interface related to classes responsible for array formatting + * + * @ingroup Formatter + * @codeCoverageIgnore + */ +abstract class ArrayFormatter { + + /** @var array */ + protected $errors = array(); + + /** +* Returns collected errors +* +* @since 1.9 +* +* @return array +*/ + public function getErrors() { + return $this-errors; + } + + /** +* Adds an error +* +* @since 1.9 +* +* @param mixed $error +*/ + public function addError( $error ) { + $this-errors = array_merge( (array)$error === $error ? $error : array( $error ), $this-errors ); + } + + /** +* Returns a formatted array +* +* @since 1.9 +* +* Implementation is carried out by a subclasses +*/ + abstract public function toArray(); +} diff --git a/includes/formatters/ParameterFormatterFactory.php b/includes/formatters/ParameterFormatterFactory.php new file mode 100644 index 000..a0a9119 --- /dev/null +++ b/includes/formatters/ParameterFormatterFactory.php @@ -0,0 +1,65 @@ +?php + +namespace SMW; + +/** + * Factory class handling parameter formatting instances + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
[MediaWiki-commits] [Gerrit] (bug 49639) Change local time zone for ko.wikibooks - change (operations/mediawiki-config)
Odder has uploaded a new change for review. https://gerrit.wikimedia.org/r/68947 Change subject: (bug 49639) Change local time zone for ko.wikibooks .. (bug 49639) Change local time zone for ko.wikibooks Setting to 'Asia/Seoul/ per bug request and community consensus. Bug: 49639 Change-Id: Ifd8e25436678a4031192072080861b7acab61743 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/47/68947/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index d9295a6..bd0d92d 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -234,6 +234,7 @@ 'kkwikiquote' = 'Asia/Almaty', 'koiwiki' = 'Asia/Yekaterinburg', 'kowiki' = 'Asia/Seoul', + 'kowikibooks' = 'Asia/Seoul', // bug 49639 'kowikinews' = 'Asia/Seoul', 'kowikiquote' = 'Asia/Seoul', 'kowikisource' = 'Asia/Seoul', -- To view, visit https://gerrit.wikimedia.org/r/68947 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd8e25436678a4031192072080861b7acab61743 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Odder tom...@twkozlowski.net ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix download title to make more sense - change (apps...commons)
Yuvipanda has submitted this change and it was merged. Change subject: Fix download title to make more sense .. Fix download title to make more sense Set title to file name, and description to app name Change-Id: I68778959cf9b6abd42b223c4866387c4880fd835 GitHub: https://github.com/wikimedia/apps-android-commons/pull/6 --- M commons/src/main/java/org/wikimedia/commons/media/MediaDetailPagerFragment.java 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Yuvipanda: Verified; Looks good to me, approved diff --git a/commons/src/main/java/org/wikimedia/commons/media/MediaDetailPagerFragment.java b/commons/src/main/java/org/wikimedia/commons/media/MediaDetailPagerFragment.java index 9e11d13..a9188ff 100644 --- a/commons/src/main/java/org/wikimedia/commons/media/MediaDetailPagerFragment.java +++ b/commons/src/main/java/org/wikimedia/commons/media/MediaDetailPagerFragment.java @@ -172,8 +172,8 @@ Uri imageUri = Uri.parse(imageUrl); DownloadManager.Request req = new DownloadManager.Request(imageUri); -req.setDescription(m.getDisplayTitle()); -req.setTitle(Commons); +req.setDescription(getString(R.string.app_name)); +req.setTitle(m.getDisplayTitle()); req.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName); if (Build.VERSION.SDK_INT = Build.VERSION_CODES.HONEYCOMB) { // Modern Android updates the gallery automatically. Yay! -- To view, visit https://gerrit.wikimedia.org/r/68545 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I68778959cf9b6abd42b223c4866387c4880fd835 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/commons Gerrit-Branch: master Gerrit-Owner: SuchABot yuvipanda+sucha...@gmail.com Gerrit-Reviewer: Brion VIBBER br...@wikimedia.org Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Mark required fields under Release Rights - change (mediawiki...UploadWizard)
Bakert has uploaded a new change for review. https://gerrit.wikimedia.org/r/68948 Change subject: Mark required fields under Release Rights .. Mark required fields under Release Rights Mark the required fields under This file is not my own work in the Release Rights stage as required in the same way as the fields in the Describe stage. (By adding a key * = This field is required. and by adding red asterisks to the field labels.) Bugzilla Bug 42775 - Confusing annotation about mandatory fields in Special:UploadWizard https://bugzilla.wikimedia.org/show_bug.cgi?id=42775 Note that the radio choice between This file is my own work and This file is not my own work is also in some sense a required field but as it has no single label as the text box fields do I haven't marked it as required in any way. Under This file is my own work there is another field (the input for username) that has the same problem - it is required but there is no obvious label to put an asterisk by. I have left these problems unsolved and they would make sense as future work. One possible problem with this actual change is that the key appears in the Release Rights section initially when all required input fields are hidden and thus no labels with asterisks are visible. Might this be confusing to the user? Change-Id: I6c0274f9d10bd83d5916a475458b0cc88ddc81c2 --- M includes/specials/SpecialUploadWizard.php M resources/mw.UploadWizardDeed.js 2 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/48/68948/1 diff --git a/includes/specials/SpecialUploadWizard.php b/includes/specials/SpecialUploadWizard.php index 0297a15..d34ab77 100644 --- a/includes/specials/SpecialUploadWizard.php +++ b/includes/specials/SpecialUploadWizard.php @@ -445,6 +445,7 @@ . '/div' . 'div class=mwe-upwiz-stepdiv id=mwe-upwiz-stepdiv-deeds style=display:none;' + . 'div id=mwe-upwiz-reqd-field-explain-containerspan class=mwe-upwiz-required-marker*/span = ' . $this-msg( mwe-upwiz-error-blank )-text() . '/div' . 'div id=mwe-upwiz-deeds-thumbnails class=ui-helper-clearfix/div' . 'div id=mwe-upwiz-deeds class=ui-helper-clearfix/div' . 'div id=mwe-upwiz-deeds-custom class=ui-helper-clearfix/div' diff --git a/resources/mw.UploadWizardDeed.js b/resources/mw.UploadWizardDeed.js index cce8997..fdb17eb 100644 --- a/resources/mw.UploadWizardDeed.js +++ b/resources/mw.UploadWizardDeed.js @@ -296,11 +296,11 @@ $j( 'div class=mwe-upwiz-source-thirdparty-custom-multiple-intro /' ), $j( 'label for=source generated=true class=mwe-validator-error style=display:block; /' ), $j( 'div class=mwe-upwiz-thirdparty-fields /' ) - .append( $j( 'label for=source /' ).text( mw.msg( 'mwe-upwiz-source' ) ).addHint( 'source' ), + .append( $j( 'label for=source /' ).text( mw.msg( 'mwe-upwiz-source' ) ).addHint( 'source' ).requiredFieldLabel(), _this.sourceInput ), $j( 'label for=author generated=true class=mwe-validator-error style=display:block; /' ), $j( 'div class=mwe-upwiz-thirdparty-fields /' ) - .append( $j( 'label for=author /' ).text( mw.msg( 'mwe-upwiz-author' ) ).addHint( 'author' ), + .append( $j( 'label for=author /' ).text( mw.msg( 'mwe-upwiz-author' ) ).addHint( 'author' ).requiredFieldLabel(), _this.authorInput ), $j( 'div class=mwe-upwiz-thirdparty-license /' ) .append( $j( 'div/div' ).msg( 'mwe-upwiz-source-thirdparty-cases', _this.uploadCount ) ) -- To view, visit https://gerrit.wikimedia.org/r/68948 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c0274f9d10bd83d5916a475458b0cc88ddc81c2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: Bakert bak...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] jquery.makeCollapsible: fix jQuery memory leak - change (mediawiki/core)
Matmarex has uploaded a new change for review. https://gerrit.wikimedia.org/r/68949 Change subject: jquery.makeCollapsible: fix jQuery memory leak .. jquery.makeCollapsible: fix jQuery memory leak jQuery saves event data in jQuery.cache and magically clears it when relevant elements are removed from DOM. However, if an element is created, has event handlers attached and is never added to the DOM, it never gets a chance to clear the data, resulting in a memory leak. Only build the default toggle link when needed to avoid this. Bug: 49626 Change-Id: I0c92e5c28a66c6a6469e107593dc9b6d3baa8a10 --- M resources/jquery/jquery.makeCollapsible.js 1 file changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/49/68949/1 diff --git a/resources/jquery/jquery.makeCollapsible.js b/resources/jquery/jquery.makeCollapsible.js index 2d46bde..2823174 100644 --- a/resources/jquery/jquery.makeCollapsible.js +++ b/resources/jquery/jquery.makeCollapsible.js @@ -227,7 +227,7 @@ } return this.each( function () { - var $collapsible, collapseText, expandText, $toggle, clickHandler, $defaultToggleLink, + var $collapsible, collapseText, expandText, $toggle, clickHandler, buildDefaultToggleLink, premadeToggleHandler, $toggleLink, $firstItem, collapsibleId, $customTogglers, firstval; // Ensure class mw-collapsible is present in case .makeCollapsible() @@ -254,14 +254,16 @@ opts = $.extend( defaultOpts, options, opts ); togglingHandler( $( this ), $collapsible, e, opts ); }; - $defaultToggleLink = - $( 'a href=#/a' ) + // Default toggle link. Only build it when needed to avoid jQuery memory leaks (event data). + buildDefaultToggleLink = function () { + return $( 'a href=#/a' ) .text( collapseText ) .wrap( 'span class=mw-collapsible-toggle/span' ) .parent() .prepend( 'nbsp;[' ) .append( ']nbsp;' ) .on( 'click.mw-collapsible', clickHandler ); + }; // Default handler for clicking on premade toggles premadeToggleHandler = function ( e, opts ) { @@ -309,7 +311,7 @@ // If theres no toggle link, add it to the last cell if ( !$toggle.length ) { - $toggleLink = $defaultToggleLink.prependTo( $firstItem.eq( -1 ) ); + $toggleLink = buildDefaultToggleLink().prependTo( $firstItem.eq( -1 ) ); } else { clickHandler = premadeToggleHandler; $toggleLink = $toggle.on( 'click.mw-collapsible', clickHandler ); @@ -329,7 +331,7 @@ if ( firstval === undefined || !firstval || firstval === '-1' || firstval === -1 ) { $firstItem.attr( 'value', '1' ); } - $toggleLink = $defaultToggleLink; + $toggleLink = buildDefaultToggleLink(); $toggleLink.wrap( 'li class=mw-collapsible-toggle-li/li' ).parent().prependTo( $collapsible ); } else { clickHandler = premadeToggleHandler; @@ -348,7 +350,7 @@ // If theres no toggle link, add it if ( !$toggle.length ) { - $toggleLink = $defaultToggleLink.prependTo( $collapsible ); + $toggleLink = buildDefaultToggleLink().prependTo( $collapsible ); } else { clickHandler = premadeToggleHandler; $toggleLink = $toggle.on( 'click.mw-collapsible', clickHandler ); -- To view, visit https://gerrit.wikimedia.org/r/68949 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange
[MediaWiki-commits] [Gerrit] SMW\JsonParameterFormatter to be used in #set and #subobject - change (mediawiki...SemanticMediaWiki)
Mwjames has uploaded a new change for review. https://gerrit.wikimedia.org/r/68950 Change subject: SMW\JsonParameterFormatter to be used in #set and #subobject .. SMW\JsonParameterFormatter to be used in #set and #subobject Code coverage: 100% CRAP: 23 JsonParameterFormatter allows to use JSON notion for #set and #subobject parser function {{#subobject:{ property:{ Foo:[ Bar, Faa ] } } }} {{#set:{ property:{ Foo:[ Bar, Faa ], Bar: [Lila, Lala, Lula] } } }} Change-Id: I90e43d53a2be1a9261e51a169a6fd52643a524c3 --- M includes/Setup.php A includes/formatters/JsonParameterFormatter.php M includes/formatters/ParameterFormatterFactory.php A tests/phpunit/includes/formatters/JsonParameterFormatterTest.php M tests/phpunit/includes/formatters/ParameterFormatterFactoryTest.php 5 files changed, 421 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki refs/changes/50/68950/1 diff --git a/includes/Setup.php b/includes/Setup.php index 895960a..211cee0 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -156,6 +156,7 @@ $wgAutoloadClasses['SMW\MessageFormatter'] = $incDir . 'formatters/MessageFormatter.php'; $wgAutoloadClasses['SMW\TableFormatter'] = $incDir . 'formatters/TableFormatter.php'; $wgAutoloadClasses['SMW\ParameterFormatterFactory'] = $incDir . 'formatters/ParameterFormatterFactory.php'; + $wgAutoloadClasses['SMW\JsonParameterFormatter'] = $incDir . 'formatters/JsonParameterFormatter.php'; // Exceptions $wgAutoloadClasses['SMW\StoreInstanceException'] = $incDir . '/exceptions/StoreInstanceException.php'; diff --git a/includes/formatters/JsonParameterFormatter.php b/includes/formatters/JsonParameterFormatter.php new file mode 100644 index 000..70cacc0 --- /dev/null +++ b/includes/formatters/JsonParameterFormatter.php @@ -0,0 +1,197 @@ +?php + +namespace SMW; + +use ArrayObject; + +/** + * Class handling JSON parameter formatting + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @since 1.9 + * + * @file + * + * @license GNU GPL v2+ + * @author mwjames + */ + +/** + * Class handling JSON parameter formatting + * + * @ingroup Formatter + */ +class JsonParameterFormatter extends ArrayFormatter { + + /** @var array */ + protected $rawParameters; + + /** @var array */ + protected $parameters = null; + + /** +* @since 1.9 +* +* @param array $rawParameters +*/ + public function __construct( ArrayObject $rawParameters ) { + $this-rawParameters = $rawParameters; + } + + /** +* Factory method that returns a JsonParameterFormatter instance +* +* @par Example: +* @code +* $formatter = JsonParameterFormatter::newFromArray( array( +* { property:{ Foo:[ Bar, Faa ] } } +* ) ); +* +* $formatter-isJson(); +* $formatter-toArray(); +* @endcode +* +* @since 1.9 +* +* @return string +*/ + public static function newFromArray( array $rawParameters ) { + $instance = new self( new ArrayObject( $rawParameters ) ); + $instance-transform(); + return $instance; + } + + /** +* Transforms raw parameters to an appropriate array format +* +* @note If the selected string starts with a '{' we assume that content +* is to be formatted using JSON decoding otherwise null is returned +* to indicate that another Formatter should be used instead +* +* @see ParameterFormatterFactory +* +* @since 1.9 +*/ + public function transform() { + + $iterator = $this-rawParameters-getIterator(); + $current = $iterator-valid() ? $iterator-current() : null; + + if ( (string)$current === $current $current{0} === '{' ) { + + $decode = json_decode( $current, true ); + $lastError = json_last_error(); + + if ( $decode !== null
[MediaWiki-commits] [Gerrit] Use IllegalValueException in newFromArray() - change (mediawiki...DataValues)
Daniel Kinzler has uploaded a new change for review. https://gerrit.wikimedia.org/r/68951 Change subject: Use IllegalValueException in newFromArray() .. Use IllegalValueException in newFromArray() DataValueFactory::newFromArray() should use IllegalValueException instead of InvalidArguemntException, to be consistent with exceptions raised when the internal structure of data values is invalid. Change-Id: I449a5d708c132fa48119d6d4b88d3a6cf9cb0698 --- M DataValues/includes/DataValueFactory.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/51/68951/1 diff --git a/DataValues/includes/DataValueFactory.php b/DataValues/includes/DataValueFactory.php index d838ff3..910946a 100644 --- a/DataValues/includes/DataValueFactory.php +++ b/DataValues/includes/DataValueFactory.php @@ -115,11 +115,11 @@ */ public function newFromArray( array $data ) { if ( !array_key_exists( 'type', $data ) ) { - throw new InvalidArgumentException( 'DataValue type is missing' ); + throw new IllegalValueException( 'DataValue type is missing' ); } if ( !array_key_exists( 'value', $data ) ) { - throw new InvalidArgumentException( 'DataValue value is missing' ); + throw new IllegalValueException( 'DataValue value is missing' ); } return $this-newDataValue( $data['type'], $data['value'] ); -- To view, visit https://gerrit.wikimedia.org/r/68951 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I449a5d708c132fa48119d6d4b88d3a6cf9cb0698 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix handling of height parameter in TMH. - change (mediawiki...TimedMediaHandler)
Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/68953 Change subject: Fix handling of height parameter in TMH. .. Fix handling of height parameter in TMH. The height parameter was being mostly ignored by TMH. Example invocations of height parameter that this changes: *[[File:Hindesite - Lily - Focus Stacking (by).ogv|900x150px]] *[[File:Hindesite - Lily - Focus Stacking (by).ogv|x100px]] Change-Id: Id37d771c4d0693980eb672f1f03f4c1a7129973d --- M TimedMediaHandler_body.php 1 file changed, 16 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/53/68953/1 diff --git a/TimedMediaHandler_body.php b/TimedMediaHandler_body.php index 55b7bdc..39e88a8 100644 --- a/TimedMediaHandler_body.php +++ b/TimedMediaHandler_body.php @@ -41,13 +41,15 @@ if ( $this-parseTimeString( $value ) === false ) { return false; } - } else if ( $name == 'disablecontrols' ) { + } elseif ( $name == 'disablecontrols' ) { $values = explode( ',', $value); foreach($values as $v) { if ( !in_array( $v, array( 'options', 'timedText', 'fullscreen' ) ) ) { return false; } } + } elseif( $name === 'width' || $name === 'height' ) { + return $value 0; } return true; } @@ -122,6 +124,14 @@ if( isset( $params['width'] ) (int)$params['width'] $image-getWidth() ){ $params['width'] = $image-getWidth(); } + + if ( isset( $params['height'] ) $params['height'] != -1 ) { + if( $params['width'] * $image-getHeight() $params['height'] * $image-getWidth() ) { + $params['width'] = self::fitBoxWidth( $image-getWidth(), $image-getHeight(), $params['height'] ); + } + } + + $params['height'] = File::scaleHeight( $image-getWidth(), $image-getHeight(), $params['width'] ); // Make sure start time is not than end time if(isset($params['start']) isset($params['end']) ){ @@ -299,6 +309,11 @@ * @return bool|MediaTransformError|MediaTransformOutput|TimedMediaTransformOutput */ function doTransform( $file, $dstPath, $dstUrl, $params, $flags = 0 ) { + # Important or height handling is wrong. + if ( !$this-normaliseParams( $file, $params ) ) { + return new TransformParameterError( $params ); + } + $srcWidth = $file-getWidth(); $srcHeight = $file-getHeight(); @@ -317,7 +332,6 @@ $targetHeight = $params['height']; $targetWidth = round( $params['width']* $srcWidth / $srcHeight ); } - $options = array( 'file' = $file, 'length' = $this-getLength( $file ), -- To view, visit https://gerrit.wikimedia.org/r/68953 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id37d771c4d0693980eb672f1f03f4c1a7129973d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: Brian Wolff bawolff...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] foo bar baz - change (mediawiki...Wikibase)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/68954 Change subject: foo bar baz .. foo bar baz Change-Id: Idcb7f70f550d60720743cf91a493932082ed2f74 --- M Wikibase.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/54/68954/1 diff --git a/Wikibase.php b/Wikibase.php index f6b584b..29d3b27 100644 --- a/Wikibase.php +++ b/Wikibase.php @@ -51,6 +51,8 @@ require_once __DIR__ . '/repo/ExampleSettings.php'; + array_pop( $_SERVER['argv'] ); + $_SERVER['argv'] = array_merge( $_SERVER['argv'], array( -- To view, visit https://gerrit.wikimedia.org/r/68954 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idcb7f70f550d60720743cf91a493932082ed2f74 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update composer description and add replace since we did a r... - change (mediawiki...DataValues)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Update composer description and add replace since we did a rename .. Update composer description and add replace since we did a rename Change-Id: Ic26e1d233a60831382fdc89434e0ab454c46270f --- M composer.json 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Jeroen De Dauw: Looks good to me, approved diff --git a/composer.json b/composer.json index 2a72a6c..dd1522b 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { name: data-values/data-values, type: library, - description: A set of simple libraries, + description: A library containing definitions for various values (ie quantities, times, coordinates, etc), keywords: [ datavalues, valueparsers, @@ -28,6 +28,9 @@ require: { php: =5.3.0 }, + replace: { + mediawiki/data-values: * + }, autoload: { files : [ DataValues.php -- To view, visit https://gerrit.wikimedia.org/r/68623 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic26e1d233a60831382fdc89434e0ab454c46270f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] ResourceLoader: Serve stylesheets with Access-Control-Allow... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: ResourceLoader: Serve stylesheets with Access-Control-Allow-Origin: * .. ResourceLoader: Serve stylesheets with Access-Control-Allow-Origin: * This allows Javascript to access our styling information (cssRules and related cross domain protected dom information) even if it is hosted on a different domain. Bug: 25886 Change-Id: I8e05c13ae1a1589fd120d5c439b1a7128ce2b659 --- M includes/resourceloader/ResourceLoader.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Parent5446: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 543bd1d..d2ddea3 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -563,6 +563,7 @@ } if ( $context-getOnly() === 'styles' ) { header( 'Content-Type: text/css; charset=utf-8' ); + header( 'Access-Control-Allow-Origin: *' ); } else { header( 'Content-Type: text/javascript; charset=utf-8' ); } -- To view, visit https://gerrit.wikimedia.org/r/60200 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e05c13ae1a1589fd120d5c439b1a7128ce2b659 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: CSteipp cste...@wikimedia.org Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Daniel Friesen dan...@nadir-seen-fire.com Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Parent5446 tylerro...@gmail.com Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: Tim Starling tstarl...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mod. add some instructions on installing a test instance. - change (analytics/user-metrics)
Rfaulk has uploaded a new change for review. https://gerrit.wikimedia.org/r/68955 Change subject: mod. add some instructions on installing a test instance. .. mod. add some instructions on installing a test instance. Change-Id: I1981d5099970009852b4925dec6d4bae4bfe3683 --- M README.md 1 file changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/user-metrics refs/changes/55/68955/1 diff --git a/README.md b/README.md index 8c126e2..be341ec 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,29 @@ Installation (in production) +Setup a Virtual Environment +~~~ + +(instructions to install a virtualenv here - http://www.virtualenv.org/en/latest/) + +Create virtualenv with `virtualenv your virtualenv` + +Activate with `source yourenv/bin/activate` + + +Installing Umapi + + +Run `git clone ssh://rfa...@gerrit.wikimedia.org:29418/analytics/user-metrics` + +Navigate to `user-metrics` and run `pip install -e .` + + +Configure the clone +~~~ + +In user_metrics/config run `cp settings.py.example settings.py` and configure as instructed below to point to datasources. + `wmf_user_metrics` is packaged with distutils: $ sudo pip -e install . -- To view, visit https://gerrit.wikimedia.org/r/68955 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1981d5099970009852b4925dec6d4bae4bfe3683 Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk rfaulk...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mod. add some instructions on installing a test instance. - change (analytics/user-metrics)
Rfaulk has submitted this change and it was merged. Change subject: mod. add some instructions on installing a test instance. .. mod. add some instructions on installing a test instance. Change-Id: I1981d5099970009852b4925dec6d4bae4bfe3683 --- M README.md 1 file changed, 23 insertions(+), 0 deletions(-) Approvals: Rfaulk: Verified; Looks good to me, approved diff --git a/README.md b/README.md index 8c126e2..be341ec 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,29 @@ Installation (in production) +Setup a Virtual Environment +~~~ + +(instructions to install a virtualenv here - http://www.virtualenv.org/en/latest/) + +Create virtualenv with `virtualenv your virtualenv` + +Activate with `source yourenv/bin/activate` + + +Installing Umapi + + +Run `git clone ssh://rfa...@gerrit.wikimedia.org:29418/analytics/user-metrics` + +Navigate to `user-metrics` and run `pip install -e .` + + +Configure the clone +~~~ + +In user_metrics/config run `cp settings.py.example settings.py` and configure as instructed below to point to datasources. + `wmf_user_metrics` is packaged with distutils: $ sudo pip -e install . -- To view, visit https://gerrit.wikimedia.org/r/68955 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1981d5099970009852b4925dec6d4bae4bfe3683 Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk rfaulk...@wikimedia.org Gerrit-Reviewer: Rfaulk rfaulk...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mod. More details. - change (analytics/user-metrics)
Rfaulk has submitted this change and it was merged. Change subject: mod. More details. .. mod. More details. Change-Id: I5628e316226f4fb998811e99bf39a4f7d27816ce --- M README.md 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Rfaulk: Verified; Looks good to me, approved diff --git a/README.md b/README.md index be341ec..3f57ca2 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Setup a Virtual Environment -~~~ +^^^ (instructions to install a virtualenv here - http://www.virtualenv.org/en/latest/) @@ -45,7 +45,7 @@ Installing Umapi - + Run `git clone ssh://rfa...@gerrit.wikimedia.org:29418/analytics/user-metrics` @@ -53,13 +53,12 @@ Configure the clone -~~~ +^^^ -In user_metrics/config run `cp settings.py.example settings.py` and configure as instructed below to point to datasources. +In user_metrics/config run `cp settings.py.example settings.py` and configure as instructed below to point to datasources. Ensure that +datasource hosts are reachable from your environment. To run the server execute: -`wmf_user_metrics` is packaged with distutils: - -$ sudo pip -e install . + $ python user_metrics/api/run.py Once installed you will need to modify the configuration files. This can be found in the file `settings.py` under @@ -74,7 +73,8 @@ # Project settings # - + +version = {% your version %} __project_home__ = realpath('../..') + '/' __web_home__ = ''.join([__project_home__, 'src/api/']) __data_file_dir__ = ''.join([__project_home__, 'data/']) -- To view, visit https://gerrit.wikimedia.org/r/68956 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5628e316226f4fb998811e99bf39a4f7d27816ce Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk rfaulk...@wikimedia.org Gerrit-Reviewer: Rfaulk rfaulk...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mod. More details. - change (analytics/user-metrics)
Rfaulk has uploaded a new change for review. https://gerrit.wikimedia.org/r/68956 Change subject: mod. More details. .. mod. More details. Change-Id: I5628e316226f4fb998811e99bf39a4f7d27816ce --- M README.md 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/user-metrics refs/changes/56/68956/1 diff --git a/README.md b/README.md index be341ec..3f57ca2 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Setup a Virtual Environment -~~~ +^^^ (instructions to install a virtualenv here - http://www.virtualenv.org/en/latest/) @@ -45,7 +45,7 @@ Installing Umapi - + Run `git clone ssh://rfa...@gerrit.wikimedia.org:29418/analytics/user-metrics` @@ -53,13 +53,12 @@ Configure the clone -~~~ +^^^ -In user_metrics/config run `cp settings.py.example settings.py` and configure as instructed below to point to datasources. +In user_metrics/config run `cp settings.py.example settings.py` and configure as instructed below to point to datasources. Ensure that +datasource hosts are reachable from your environment. To run the server execute: -`wmf_user_metrics` is packaged with distutils: - -$ sudo pip -e install . + $ python user_metrics/api/run.py Once installed you will need to modify the configuration files. This can be found in the file `settings.py` under @@ -74,7 +73,8 @@ # Project settings # - + +version = {% your version %} __project_home__ = realpath('../..') + '/' __web_home__ = ''.join([__project_home__, 'src/api/']) __data_file_dir__ = ''.join([__project_home__, 'data/']) -- To view, visit https://gerrit.wikimedia.org/r/68956 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5628e316226f4fb998811e99bf39a4f7d27816ce Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk rfaulk...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mod. Formatting fixes. - change (analytics/user-metrics)
Rfaulk has uploaded a new change for review. https://gerrit.wikimedia.org/r/68957 Change subject: mod. Formatting fixes. .. mod. Formatting fixes. Change-Id: I0ebb96d3a061cb059f2b3fbba0cbfdf8fcd008b4 --- M README.md 1 file changed, 4 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/user-metrics refs/changes/57/68957/1 diff --git a/README.md b/README.md index 3f57ca2..982f30e 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,10 @@ Now you should be able to browse to [user metrics running locally][local_vagrant_user_metrics_server] and start working. The code that's being served is under the user\_metrics folder and you can use that like any clone of a gerrit repository. -Installation (in production) - - Setup a Virtual Environment -^^^ +--- -(instructions to install a virtualenv here - http://www.virtualenv.org/en/latest/) +Note: instructions to install a virtualenv here - http://www.virtualenv.org/en/latest/. Create virtualenv with `virtualenv your virtualenv` @@ -45,7 +42,7 @@ Installing Umapi - + Run `git clone ssh://rfa...@gerrit.wikimedia.org:29418/analytics/user-metrics` @@ -53,7 +50,7 @@ Configure the clone -^^^ +--- In user_metrics/config run `cp settings.py.example settings.py` and configure as instructed below to point to datasources. Ensure that datasource hosts are reachable from your environment. To run the server execute: -- To view, visit https://gerrit.wikimedia.org/r/68957 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ebb96d3a061cb059f2b3fbba0cbfdf8fcd008b4 Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk rfaulk...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mod. Formatting fixes. - change (analytics/user-metrics)
Rfaulk has submitted this change and it was merged. Change subject: mod. Formatting fixes. .. mod. Formatting fixes. Change-Id: I0ebb96d3a061cb059f2b3fbba0cbfdf8fcd008b4 --- M README.md 1 file changed, 4 insertions(+), 7 deletions(-) Approvals: Rfaulk: Verified; Looks good to me, approved diff --git a/README.md b/README.md index 3f57ca2..982f30e 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,10 @@ Now you should be able to browse to [user metrics running locally][local_vagrant_user_metrics_server] and start working. The code that's being served is under the user\_metrics folder and you can use that like any clone of a gerrit repository. -Installation (in production) - - Setup a Virtual Environment -^^^ +--- -(instructions to install a virtualenv here - http://www.virtualenv.org/en/latest/) +Note: instructions to install a virtualenv here - http://www.virtualenv.org/en/latest/. Create virtualenv with `virtualenv your virtualenv` @@ -45,7 +42,7 @@ Installing Umapi - + Run `git clone ssh://rfa...@gerrit.wikimedia.org:29418/analytics/user-metrics` @@ -53,7 +50,7 @@ Configure the clone -^^^ +--- In user_metrics/config run `cp settings.py.example settings.py` and configure as instructed below to point to datasources. Ensure that datasource hosts are reachable from your environment. To run the server execute: -- To view, visit https://gerrit.wikimedia.org/r/68957 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ebb96d3a061cb059f2b3fbba0cbfdf8fcd008b4 Gerrit-PatchSet: 1 Gerrit-Project: analytics/user-metrics Gerrit-Branch: master Gerrit-Owner: Rfaulk rfaulk...@wikimedia.org Gerrit-Reviewer: Rfaulk rfaulk...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use IllegalValueException in newFromArray() - change (mediawiki...DataValues)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Use IllegalValueException in newFromArray() .. Use IllegalValueException in newFromArray() DataValueFactory::newFromArray() should use IllegalValueException instead of InvalidArguemntException, to be consistent with exceptions raised when the internal structure of data values is invalid. Change-Id: I449a5d708c132fa48119d6d4b88d3a6cf9cb0698 --- M DataValues/includes/DataValueFactory.php 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/DataValues/includes/DataValueFactory.php b/DataValues/includes/DataValueFactory.php index d838ff3..e2ace8d 100644 --- a/DataValues/includes/DataValueFactory.php +++ b/DataValues/includes/DataValueFactory.php @@ -29,6 +29,7 @@ * * @licence GNU GPL v2+ * @author Jeroen De Dauw jeroended...@gmail.com + * @author Daniel Kinzler */ class DataValueFactory { @@ -111,15 +112,15 @@ * @param array $data * * @return DataValue -* @throws InvalidArgumentException +* @throws IllegalValueException */ public function newFromArray( array $data ) { if ( !array_key_exists( 'type', $data ) ) { - throw new InvalidArgumentException( 'DataValue type is missing' ); + throw new IllegalValueException( 'DataValue type is missing' ); } if ( !array_key_exists( 'value', $data ) ) { - throw new InvalidArgumentException( 'DataValue value is missing' ); + throw new IllegalValueException( 'DataValue value is missing' ); } return $this-newDataValue( $data['type'], $data['value'] ); -- To view, visit https://gerrit.wikimedia.org/r/68951 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I449a5d708c132fa48119d6d4b88d3a6cf9cb0698 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: Daniel Werner daniel.wer...@wikimedia.de Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] latest version of rmtool - change (labs/toollabs)
coren has submitted this change and it was merged. Change subject: latest version of rmtool .. latest version of rmtool Change-Id: I83a7e7046ad991d3e29c59aece92d1daf4501767 --- A usr/local/sbin/rmtool 1 file changed, 91 insertions(+), 0 deletions(-) Approvals: coren: Verified; Looks good to me, approved Objections: AzaToth: There's a problem with this change, please improve diff --git a/usr/local/sbin/rmtool b/usr/local/sbin/rmtool new file mode 100755 index 000..06a7696 --- /dev/null +++ b/usr/local/sbin/rmtool @@ -0,0 +1,91 @@ +#!/bin/bash + +if [ $UID -gt 0 ];then + echo Error you must be root + exit 2 +fi + +if [ $# -lt 1 ];then + echo You need to provide a tool name + exit 1 +fi + +tool=$1 +dbuser=`echo $1 | sed 's/-//'` + +# get a number of users of this name in mysql +uc=`echo select user from user; | mysql mysql | grep -cE ^$dbuser'$'` + +echo There is $uc user accounts of name $dbuser in database + +if [ $uc -gt 0 ];then + echo Removing db access of $tool + echo drop user $dbuser; | mysql mysql +fi + +# get the number of databases for this user +db=`echo show databases; | mysql mysql | grep -cE ^$dbuser'$'` + +echo There is $db databases of name $tool in database + +if [ $db -gt 0 ];then + echo Creating a backup of database $tool + if [ -f /data/project/$tool/database_backup.sql ];then + echo Error there is already a backup file + exit 1 + fi + if [ ! -d /data/project/$tool ];then + echo There is no folder to save backup of db to! + exit 1 + fi + mysqldump $dbuser /data/project/$tool/database_backup.sql +echo Removing db access of $tool +echo drop database $dbuser; | mysql mysql +fi + +if [ ! -d /data/project/removed_tools ];then +echo There is no folder to store removed tools! +exit 1 +fi + +if [ -d /data/project/$tool ];then + echo Removing data folder for $tool + if [ -d /data/project/removed_tools/$tool ];then + echo Unable to remove the folder, there is already backup folder with this name + exit 1 + fi + mv /data/project/$tool /data/project/removed_tools/$tool/ + if [ -f /data/project/removed_tools/$tool.tar.gz ];then + echo Unable to tarball the folder because there is another tarball with same name + else + cd /data/project/removed_tools + tar -zcvf $tool.tar.gz $tool + if [ -f /data/project/removed_tools/$tool.tar.gz ];then + echo Deleting project folder + rm -rf /data/project/removed_tools/$tool + fi + fi +fi + +# get a number of records in /data/project/.system/webservers + +while [ -f /data/project/.system/webservers.lock ] +do + echo There is a lockfile, sleeping for 10 seconds + sleep 10 +done + +touch /data/project/.system/webservers.lock +wc=`cat /data/project/.system/webservers | grep -Ec ^$tool\s.*` + +if [ $wc -gt 0 ];then + # create a backup file so that if stuff get fucked up we can recover it + cp /data/project/.system/webservers /tmp/webservers.backup.`date +%H:%M:%S` + echo Removing webserver + cat /data/project/.system/webservers | grep -vE ^$tool\s.* /tmp/webservers + mv /tmp/webservers /data/project/.system/webservers +fi + +rm /data/project/.system/webservers.lock + +echo All data for $tool were cleaned -- To view, visit https://gerrit.wikimedia.org/r/62350 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I83a7e7046ad991d3e29c59aece92d1daf4501767 Gerrit-PatchSet: 2 Gerrit-Project: labs/toollabs Gerrit-Branch: master Gerrit-Owner: Petrb benap...@gmail.com Gerrit-Reviewer: AzaToth azat...@gmail.com Gerrit-Reviewer: coren mpellet...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Test that Perl scripts are compilable before packaging. - change (labs/toollabs)
coren has submitted this change and it was merged. Change subject: Test that Perl scripts are compilable before packaging. .. Test that Perl scripts are compilable before packaging. Change-Id: I366825b809c1e228b1b39e9aac403e9202156faa --- M debian/rules 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: coren: Verified; Looks good to me, approved AzaToth: Looks good to me, but someone else must approve diff --git a/debian/rules b/debian/rules index c30bbdb..c916ab4 100755 --- a/debian/rules +++ b/debian/rules @@ -19,3 +19,8 @@ %: dh $@ + +# Test that Perl scripts not have compilation errors. +override_dh_auto_test: + perl -cw jobutils/bin/job + perl -cw jobutils/bin/jsub -- To view, visit https://gerrit.wikimedia.org/r/68330 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I366825b809c1e228b1b39e9aac403e9202156faa Gerrit-PatchSet: 1 Gerrit-Project: labs/toollabs Gerrit-Branch: master Gerrit-Owner: Tim Landscheidt t...@tim-landscheidt.de Gerrit-Reviewer: AzaToth azat...@gmail.com Gerrit-Reviewer: Petrb benap...@gmail.com Gerrit-Reviewer: coren mpellet...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix variable declaration and enable warnings in job. - change (labs/toollabs)
coren has submitted this change and it was merged. Change subject: Fix variable declaration and enable warnings in job. .. Fix variable declaration and enable warnings in job. Change-Id: I5c674e2b201a140153fdb950c82f254e106407c9 --- M jobutils/bin/job 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: coren: Verified; Looks good to me, approved diff --git a/jobutils/bin/job b/jobutils/bin/job index f8e697e..083281f 100755 --- a/jobutils/bin/job +++ b/jobutils/bin/job @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#!/usr/bin/perl -w # # Copyright © 2013 Marc-André Pelletier mpellet...@wikimedia.org # @@ -14,6 +14,9 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # + +use strict; +use warnings; my $mode; $mode = shift if $#ARGV0 and $ARGV[0] eq '-v'; @@ -38,7 +41,7 @@ my $name = shift; -my $jnum, $jname, $jstate, $jstart; +my ($jnum, $jname, $jstate, $jstart); open XML, /usr/bin/qstat -xml| or die qstat: $!; while(XML) { -- To view, visit https://gerrit.wikimedia.org/r/68331 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c674e2b201a140153fdb950c82f254e106407c9 Gerrit-PatchSet: 1 Gerrit-Project: labs/toollabs Gerrit-Branch: master Gerrit-Owner: Tim Landscheidt t...@tim-landscheidt.de Gerrit-Reviewer: Petrb benap...@gmail.com Gerrit-Reviewer: coren mpellet...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] About attribute values should have # prefixed everywhere - change (mediawiki...Parsoid)
Subramanya Sastry has uploaded a new change for review. https://gerrit.wikimedia.org/r/68959 Change subject: About attribute values should have # prefixed everywhere .. About attribute values should have # prefixed everywhere * While debugging reports of dirty diffs on some pages (en:Bleak House specifically), it took me a while to notice that some mw:Transclusion had about=mwt5 style ids (introduced during template expansion reuse) whereas all other about ids had about=#mwt5 (note the # char) style ids. While this by itself shouldn't cause dirty diffs since DOM-diff ignores about ids, this could potentially introduce introduce other bugs elsewhere if we start using/comparing about ids. Fixed all uses of # + env.newObjectId() with env.newAboutId and let env prefix the # key. Change-Id: I74d50ae155f5d24af95c07da15b14eb990cf2891 --- M js/lib/ext.Cite.js M js/lib/ext.core.AttributeExpander.js M js/lib/ext.core.LinkHandler.js M js/lib/ext.core.TemplateHandler.js M js/lib/mediawiki.parser.environment.js M js/lib/pegTokenizer.pegjs.txt 6 files changed, 10 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/59/68959/1 diff --git a/js/lib/ext.Cite.js b/js/lib/ext.Cite.js index 646b1d5..6fee729 100644 --- a/js/lib/ext.Cite.js +++ b/js/lib/ext.Cite.js @@ -99,7 +99,7 @@ var inReferencesExt = pipelineOpts.extTag === references, refOpts = $.extend({ name: null, group: null }, Util.KVtoHash(refTok.getAttribute(options))), - about = inReferencesExt ? '' : # + manager.env.newObjectId(), + about = inReferencesExt ? '' : manager.env.newAboutId(), finalCB = function(toks, content) { // Marker meta with ref content var da = Util.clone(refTok.dataAttribs); @@ -288,7 +288,7 @@ marker.dataAttribs.stx = undefined; DU.addAttributes(marker, { - 'about': '#' + manager.env.newObjectId(), + 'about': manager.env.newAboutId(), 'group': group, 'typeof': 'mw:Extension/references/Marker' }); diff --git a/js/lib/ext.core.AttributeExpander.js b/js/lib/ext.core.AttributeExpander.js index b35563f..0312693 100644 --- a/js/lib/ext.core.AttributeExpander.js +++ b/js/lib/ext.core.AttributeExpander.js @@ -306,7 +306,7 @@ var tokenId = token.getAttribute( 'about' ); if ( !tokenId ) { - tokenId = # + this.manager.env.newObjectId(); + tokenId = this.manager.env.newAboutId(); token.addAttribute(about, tokenId); var objType; var producerObjTypeMatch = producerObjType.match( diff --git a/js/lib/ext.core.LinkHandler.js b/js/lib/ext.core.LinkHandler.js index 57b4b07..129f78b 100644 --- a/js/lib/ext.core.LinkHandler.js +++ b/js/lib/ext.core.LinkHandler.js @@ -210,7 +210,7 @@ // Ensure that the link has about set about = Util.lookup( obj.attribs, 'about' ); if (!about) { - about = # + this.manager.env.newObjectId(); + about = this.manager.env.newAboutId(); obj.addAttribute(about, about); } diff --git a/js/lib/ext.core.TemplateHandler.js b/js/lib/ext.core.TemplateHandler.js index ba46b3c..9e230a0 100644 --- a/js/lib/ext.core.TemplateHandler.js +++ b/js/lib/ext.core.TemplateHandler.js @@ -52,7 +52,7 @@ */ TemplateHandler.prototype.encapsulateExpansionHTML = function(extToken, expansion) { var toks = DU.getWrapperTokens(expansion.nodes), - about = this.manager.env.newObjectId(); + about = this.manager.env.newAboutId(); // Assign the HTML fragment to the data-parsoid.html on the first // wrapper token. toks[0].dataAttribs.html = expansion.html; diff --git a/js/lib/mediawiki.parser.environment.js b/js/lib/mediawiki.parser.environment.js index d331021..ad55aa6 100644 --- a/js/lib/mediawiki.parser.environment.js +++ b/js/lib/mediawiki.parser.environment.js @@ -488,6 +488,10 @@ return mwt + this.generateUID(); }; +MWParserEnvironment.prototype.newAboutId = function () { + return # + this.newObjectId(); +}; + MWParserEnvironment.prototype.stripIdPrefix = function(aboutId) { return aboutId.replace(/^#?mwt/, ''); }; diff --git a/js/lib/pegTokenizer.pegjs.txt b/js/lib/pegTokenizer.pegjs.txt index 8cb76e6..7bb87cd 100644 --- a/js/lib/pegTokenizer.pegjs.txt +++ b/js/lib/pegTokenizer.pegjs.txt @@ -1500,7 +1500,7 @@
[MediaWiki-commits] [Gerrit] Tool Labs: move rmtool to the proper spot - change (labs/toollabs)
coren has uploaded a new change for review. https://gerrit.wikimedia.org/r/68960 Change subject: Tool Labs: move rmtool to the proper spot .. Tool Labs: move rmtool to the proper spot Change-Id: Iac159bb27a7b2864a019bb8b8aceaf18991d666a --- R tools/rmtool 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs refs/changes/60/68960/1 diff --git a/usr/local/sbin/rmtool b/tools/rmtool similarity index 100% rename from usr/local/sbin/rmtool rename to tools/rmtool -- To view, visit https://gerrit.wikimedia.org/r/68960 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac159bb27a7b2864a019bb8b8aceaf18991d666a Gerrit-PatchSet: 1 Gerrit-Project: labs/toollabs Gerrit-Branch: master Gerrit-Owner: coren mpellet...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] jquery.checkboxShiftClick: don't toggle if disabled or readonly - change (mediawiki/core)
Matmarex has uploaded a new change for review. https://gerrit.wikimedia.org/r/68961 Change subject: jquery.checkboxShiftClick: don't toggle if disabled or readonly .. jquery.checkboxShiftClick: don't toggle if disabled or readonly These are not togglable via normal user interaction, so shouldn't be togglable this way either. Bug: 49648 Change-Id: I14b90c86007b583aa27ab5312768b51f3a25cdbb --- M resources/jquery/jquery.checkboxShiftClick.js 1 file changed, 11 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/61/68961/1 diff --git a/resources/jquery/jquery.checkboxShiftClick.js b/resources/jquery/jquery.checkboxShiftClick.js index aced063..77ed778 100644 --- a/resources/jquery/jquery.checkboxShiftClick.js +++ b/resources/jquery/jquery.checkboxShiftClick.js @@ -15,11 +15,17 @@ $box.click( function ( e ) { // And one has been clicked before... if ( prevCheckbox !== null e.shiftKey ) { - // Check or uncheck this one and all in-between checkboxes - $box.slice( - Math.min( $box.index( prevCheckbox ), $box.index( e.target ) ), - Math.max( $box.index( prevCheckbox ), $box.index( e.target ) ) + 1 - ).prop( 'checked', !!e.target.checked ); + // Check or uncheck this one and all in-between checkboxes, + // except for disabled and readonly ones + $box + .slice( + Math.min( $box.index( prevCheckbox ), $box.index( e.target ) ), + Math.max( $box.index( prevCheckbox ), $box.index( e.target ) ) + 1 + ) + .filter( function () { + return !this.prop( 'disabled' ) !this.prop( 'readonly' ); + } ) + .prop( 'checked', !!e.target.checked ); } // Either way, update the prevCheckbox variable to the one clicked now prevCheckbox = e.target; -- To view, visit https://gerrit.wikimedia.org/r/68961 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I14b90c86007b583aa27ab5312768b51f3a25cdbb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Matmarex matma@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't reinvent the wheel in SpecialRecentchangeslinked::getE... - change (mediawiki/core)
TheDJ has submitted this change and it was merged. Change subject: Don't reinvent the wheel in SpecialRecentchangeslinked::getExtraOptions .. Don't reinvent the wheel in SpecialRecentchangeslinked::getExtraOptions Just call parent::getExtraOptions() first and then simply add the one additional field. The 'SpecialRecentChangesPanel' hook wasn't called from SpecialRecentchangeslinked previously, I've wrapped the call in an if to keep the behavior the same. Changes this causes: * If $wgAllowCategorizedRecentChanges is true, Recentchangeslinked will include the category filter form as well. * The target filter on Recentchangeslinked will be displayed at the end of the form, below the tag filter. Change-Id: I4436a63356adb1e0b0daa1aa52c179974a036fa1 --- M includes/specials/SpecialRecentchanges.php M includes/specials/SpecialRecentchangeslinked.php 2 files changed, 16 insertions(+), 13 deletions(-) Approvals: TheDJ: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 0d6378c..1f10ad4 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -592,10 +592,6 @@ $defaults = $opts-getAllValues(); $nondefaults = $opts-getChangedValues(); - $opts-consumeValues( array( - 'namespace', 'invert', 'associated', 'tagfilter', - 'categories', 'categories_any' - ) ); $panel = array(); $panel[] = $this-optionsPanel( $defaults, $nondefaults ); @@ -664,6 +660,10 @@ * @return array */ function getExtraOptions( $opts ) { + $opts-consumeValues( array( + 'namespace', 'invert', 'associated', 'tagfilter', 'categories', 'categories_any' + ) ); + $extraOpts = array(); $extraOpts['namespace'] = $this-namespaceFilterForm( $opts ); @@ -677,7 +677,10 @@ $extraOpts['tagfilter'] = $tagFilter; } - wfRunHooks( 'SpecialRecentChangesPanel', array( $extraOpts, $opts ) ); + // Don't fire the hook for subclasses. (Or should we?) + if ( $this-getName() === 'Recentchanges' ) { + wfRunHooks( 'SpecialRecentChangesPanel', array( $extraOpts, $opts ) ); + } return $extraOpts; } diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php index 062e09d..4773c4a 100644 --- a/includes/specials/SpecialRecentchangeslinked.php +++ b/includes/specials/SpecialRecentchangeslinked.php @@ -226,21 +226,21 @@ } /** -* @param $opts FormOptions +* Get options to be displayed in a form +* +* @param FormOptions $opts * @return array */ function getExtraOptions( $opts ) { - $opts-consumeValues( array( 'showlinkedto', 'target', 'tagfilter' ) ); - $extraOpts = array(); - $extraOpts['namespace'] = $this-namespaceFilterForm( $opts ); + $extraOpts = parent::getExtraOptions( $opts ); + + $opts-consumeValues( array( 'showlinkedto', 'target' ) ); + $extraOpts['target'] = array( $this-msg( 'recentchangeslinked-page' )-escaped(), Xml::input( 'target', 40, str_replace( '_', ' ', $opts['target'] ) ) . Xml::check( 'showlinkedto', $opts['showlinkedto'], array( 'id' = 'showlinkedto' ) ) . ' ' . Xml::label( $this-msg( 'recentchangeslinked-to' )-text(), 'showlinkedto' ) ); - $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] ); - if ( $tagFilter ) { - $extraOpts['tagfilter'] = $tagFilter; - } + return $extraOpts; } -- To view, visit https://gerrit.wikimedia.org/r/64571 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4436a63356adb1e0b0daa1aa52c179974a036fa1 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Matmarex matma@gmail.com Gerrit-Reviewer: Anomie bjor...@wikimedia.org Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: Matmarex matma@gmail.com Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com Gerrit-Reviewer: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix dependency inclusion path - change (mediawiki...WikibaseQueryEngine)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Fix dependency inclusion path .. Fix dependency inclusion path Change-Id: If8fe36b728cc16deb49c63003669eb86a02d07ef --- M WikibaseQueryEngine.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jeroen De Dauw: Verified; Looks good to me, approved diff --git a/WikibaseQueryEngine.php b/WikibaseQueryEngine.php index 596536c..d4576da 100644 --- a/WikibaseQueryEngine.php +++ b/WikibaseQueryEngine.php @@ -58,7 +58,7 @@ // Attempt to include the Ask lib if that hasn't been done yet. if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) file_exists( __DIR__ . '/../Wikibase/Database/Database.php' ) ) { - include_once( __DIR__ . '/../Wikibase/Database/Database.php' ); + include_once( __DIR__ . '/../WikibaseDatabase/WikibaseDatabase.php' ); } spl_autoload_register( function ( $className ) { -- To view, visit https://gerrit.wikimedia.org/r/69007 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If8fe36b728cc16deb49c63003669eb86a02d07ef Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQueryEngine Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix dependency inclusion path - change (mediawiki...WikibaseQueryEngine)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/69007 Change subject: Fix dependency inclusion path .. Fix dependency inclusion path Change-Id: If8fe36b728cc16deb49c63003669eb86a02d07ef --- M WikibaseQueryEngine.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQueryEngine refs/changes/07/69007/1 diff --git a/WikibaseQueryEngine.php b/WikibaseQueryEngine.php index 596536c..d4576da 100644 --- a/WikibaseQueryEngine.php +++ b/WikibaseQueryEngine.php @@ -58,7 +58,7 @@ // Attempt to include the Ask lib if that hasn't been done yet. if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) file_exists( __DIR__ . '/../Wikibase/Database/Database.php' ) ) { - include_once( __DIR__ . '/../Wikibase/Database/Database.php' ); + include_once( __DIR__ . '/../WikibaseDatabase/WikibaseDatabase.php' ); } spl_autoload_register( function ( $className ) { -- To view, visit https://gerrit.wikimedia.org/r/69007 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8fe36b728cc16deb49c63003669eb86a02d07ef Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQueryEngine Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix dependency inclusion path - change (mediawiki...WikibaseQueryEngine)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/69008 Change subject: Fix dependency inclusion path .. Fix dependency inclusion path Change-Id: I2584ae79f21ad54c7bd4acc3c312750f3ea97071 --- M WikibaseQueryEngine.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQueryEngine refs/changes/08/69008/1 diff --git a/WikibaseQueryEngine.php b/WikibaseQueryEngine.php index d4576da..460e6bc 100644 --- a/WikibaseQueryEngine.php +++ b/WikibaseQueryEngine.php @@ -57,7 +57,7 @@ } // Attempt to include the Ask lib if that hasn't been done yet. -if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) file_exists( __DIR__ . '/../Wikibase/Database/Database.php' ) ) { +if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) file_exists( __DIR__ . '/../Wikibase/WikibaseDatabase/WikibaseDatabase.php' ) ) { include_once( __DIR__ . '/../WikibaseDatabase/WikibaseDatabase.php' ); } -- To view, visit https://gerrit.wikimedia.org/r/69008 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2584ae79f21ad54c7bd4acc3c312750f3ea97071 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQueryEngine Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix dependency inclusion path - change (mediawiki...WikibaseQueryEngine)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Fix dependency inclusion path .. Fix dependency inclusion path Change-Id: I2584ae79f21ad54c7bd4acc3c312750f3ea97071 --- M WikibaseQueryEngine.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/WikibaseQueryEngine.php b/WikibaseQueryEngine.php index d4576da..460e6bc 100644 --- a/WikibaseQueryEngine.php +++ b/WikibaseQueryEngine.php @@ -57,7 +57,7 @@ } // Attempt to include the Ask lib if that hasn't been done yet. -if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) file_exists( __DIR__ . '/../Wikibase/Database/Database.php' ) ) { +if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) file_exists( __DIR__ . '/../Wikibase/WikibaseDatabase/WikibaseDatabase.php' ) ) { include_once( __DIR__ . '/../WikibaseDatabase/WikibaseDatabase.php' ); } -- To view, visit https://gerrit.wikimedia.org/r/69008 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2584ae79f21ad54c7bd4acc3c312750f3ea97071 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQueryEngine Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix the path on Database component inclusion - change (mediawiki...WikibaseQueryEngine)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/69009 Change subject: Fix the path on Database component inclusion .. Fix the path on Database component inclusion Change-Id: I5e04231357185a92c2c4089eb1a8d1838c8070da --- M WikibaseQueryEngine.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQueryEngine refs/changes/09/69009/1 diff --git a/WikibaseQueryEngine.php b/WikibaseQueryEngine.php index 460e6bc..f8103af 100644 --- a/WikibaseQueryEngine.php +++ b/WikibaseQueryEngine.php @@ -57,7 +57,7 @@ } // Attempt to include the Ask lib if that hasn't been done yet. -if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) file_exists( __DIR__ . '/../Wikibase/WikibaseDatabase/WikibaseDatabase.php' ) ) { +if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) file_exists( __DIR__ . '/../WikibaseDatabase/WikibaseDatabase.php' ) ) { include_once( __DIR__ . '/../WikibaseDatabase/WikibaseDatabase.php' ); } -- To view, visit https://gerrit.wikimedia.org/r/69009 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5e04231357185a92c2c4089eb1a8d1838c8070da Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQueryEngine Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix the path on Database component inclusion - change (mediawiki...WikibaseQueryEngine)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Fix the path on Database component inclusion .. Fix the path on Database component inclusion Change-Id: I5e04231357185a92c2c4089eb1a8d1838c8070da --- M WikibaseQueryEngine.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/WikibaseQueryEngine.php b/WikibaseQueryEngine.php index 460e6bc..f8103af 100644 --- a/WikibaseQueryEngine.php +++ b/WikibaseQueryEngine.php @@ -57,7 +57,7 @@ } // Attempt to include the Ask lib if that hasn't been done yet. -if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) file_exists( __DIR__ . '/../Wikibase/WikibaseDatabase/WikibaseDatabase.php' ) ) { +if ( !defined( 'WIKIBASE_DATABASE_VERSION' ) file_exists( __DIR__ . '/../WikibaseDatabase/WikibaseDatabase.php' ) ) { include_once( __DIR__ . '/../WikibaseDatabase/WikibaseDatabase.php' ); } -- To view, visit https://gerrit.wikimedia.org/r/69009 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5e04231357185a92c2c4089eb1a8d1838c8070da Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQueryEngine Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update Wikidata and SMW IRC notification repos - change (operations/puppet)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/69010 Change subject: Update Wikidata and SMW IRC notification repos .. Update Wikidata and SMW IRC notification repos Change-Id: Idd7488d10c00b1aa7291202787a943af14001835 --- M templates/gerrit/hookconfig.py.erb 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/10/69010/1 diff --git a/templates/gerrit/hookconfig.py.erb b/templates/gerrit/hookconfig.py.erb index 38c6cb9..e08de59 100644 --- a/templates/gerrit/hookconfig.py.erb +++ b/templates/gerrit/hookconfig.py.erb @@ -46,11 +46,20 @@ mediawiki/extensions/RDFIO : semantic-mediawiki.log, mediawiki/extensions/SolrStore : semantic-mediawiki.log, mediawiki/extensions/SMW* : semantic-mediawiki.log, + mediawiki/extensions/Ask : semantic-mediawiki.log, + mediawiki/extensions/DataValues : semantic-mediawiki.log, + mediawiki/extensions/ValueValidators : semantic-mediawiki.log, # Wikidata - mediawiki/extensions/Wikibase : wikidata.log, + mediawiki/extensions/Wikibase* : wikidata.log, mediawiki/extensions/Diff : wikidata.log, + mediawiki/extensions/Ask : wikidata.log, + mediawiki/extensions/DataTypes : wikidata.log, mediawiki/extensions/DataValues : wikidata.log, + mediawiki/extensions/ValueView : wikidata.log, + mediawiki/extensions/ValueValidators : wikidata.log, + mediawiki/extensions/ValueParsers : wikidata.log, + mediawiki/extensions/ValueFormatters : wikidata.log, # We ping Gerrit everything 5 mins on test/gerrit-ping.git # so just send that to a file which is not being used -- To view, visit https://gerrit.wikimedia.org/r/69010 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd7488d10c00b1aa7291202787a943af14001835 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Tool Labs: move rmtool to the proper spot - change (labs/toollabs)
coren has submitted this change and it was merged. Change subject: Tool Labs: move rmtool to the proper spot .. Tool Labs: move rmtool to the proper spot - fix: Doh! Needs to be installed! Change-Id: Iac159bb27a7b2864a019bb8b8aceaf18991d666a --- M debian/changelog M debian/tools.install R tools/rmtool 3 files changed, 9 insertions(+), 0 deletions(-) Approvals: coren: Verified; Looks good to me, approved AzaToth: Looks good to me, but someone else must approve diff --git a/debian/changelog b/debian/changelog index 8a9c2e8..72ea948 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +toollabs (1.0.3) unstable; urgency=low + + * Tim Landscheidt: Add umask defaults for output files + * Tim Landscheidt: other minor tweaks and fixes + * Marc-André Pelletier: add rmtool + + -- Marc-André Pelletier mpellet...@wikimedia.org Mon, 16 Jun 2013 16:42:00 -0400 + toollabs (1.0.2) unstable; urgency=low * Tim Landscheidt: Add umask defaults for output files diff --git a/debian/tools.install b/debian/tools.install index 6f0392e..3eb6a68 100644 --- a/debian/tools.install +++ b/debian/tools.install @@ -1,2 +1,3 @@ tools/become /usr/bin tools/toolwatcher /usr/sbin +tools/rmtool /usr/sbin diff --git a/usr/local/sbin/rmtool b/tools/rmtool similarity index 100% rename from usr/local/sbin/rmtool rename to tools/rmtool -- To view, visit https://gerrit.wikimedia.org/r/68960 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iac159bb27a7b2864a019bb8b8aceaf18991d666a Gerrit-PatchSet: 2 Gerrit-Project: labs/toollabs Gerrit-Branch: master Gerrit-Owner: coren mpellet...@wikimedia.org Gerrit-Reviewer: AzaToth azat...@gmail.com Gerrit-Reviewer: coren mpellet...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove non-existing class from autoloader - change (mediawiki...Translate)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/69011 Change subject: Remove non-existing class from autoloader .. Remove non-existing class from autoloader Change-Id: I94c4ce346213c5943037d8bb50915a1c0991d120 --- M _autoload.php 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/11/69011/1 diff --git a/_autoload.php b/_autoload.php index b5b5d72..a8c0280 100644 --- a/_autoload.php +++ b/_autoload.php @@ -241,7 +241,6 @@ $wgAutoloadClasses['RecentMessageGroup'] = $dir/messagegroups/RecentMessageGroup.php; $wgAutoloadClasses['RecentAdditionsMessageGroup'] = $dir/messagegroups/RecentAdditionsMessageGroup.php; $wgAutoloadClasses['SingleFileBasedMessageGroup'] = $dir/messagegroups/SingleFileBasedMessageGroup.php; -$wgAutoloadClasses['VoctrainMessageGroup'] = $dir/ffs/Voctrain.php; $wgAutoloadClasses['WikiMessageGroup'] = $dir/messagegroups/WikiMessageGroup.php; $wgAutoloadClasses['WikiPageMessageGroup'] = $dir/messagegroups/WikiPageMessageGroup.php; $wgAutoloadClasses['WorkflowStatesMessageGroup'] = $dir/messagegroups/WorkflowStatesMessageGroup.php; -- To view, visit https://gerrit.wikimedia.org/r/69011 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94c4ce346213c5943037d8bb50915a1c0991d120 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove non-existing class from autoloader - change (mediawiki...SemanticMediaWiki)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/69012 Change subject: Remove non-existing class from autoloader .. Remove non-existing class from autoloader Change-Id: I1bef84d7e9d4acefc39a1140ea6fc64cea5710d5 --- M includes/Setup.php 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki refs/changes/12/69012/1 diff --git a/includes/Setup.php b/includes/Setup.php index d9410f0..edc5c49 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -260,7 +260,6 @@ $wgAutoloadClasses['SMWSQLStore3SpecialPageHandlers'] = $stoDirSQL . 'SMW_SQLStore3_SpecialPageHandlers.php'; $wgAutoloadClasses['SMWSQLStore3SetupHandlers']= $stoDirSQL . 'SMW_SQLStore3_SetupHandlers.php'; $wgAutoloadClasses['SMWDataItemHandler'] = $stoDirSQL . 'SMW_DataItemHandler.php'; - $wgAutoloadClasses['SMWDIHandlerProperty']= $stoDirSQL . 'SMW_DIHandler_Property.php'; $wgAutoloadClasses['SMWDIHandlerBoolean'] = $stoDirSQL . 'SMW_DIHandler_Bool.php'; $wgAutoloadClasses['SMWDIHandlerNumber'] = $stoDirSQL . 'SMW_DIHandler_Number.php'; $wgAutoloadClasses['SMWDIHandlerBlob']= $stoDirSQL . 'SMW_DIHandler_Blob.php'; -- To view, visit https://gerrit.wikimedia.org/r/69012 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1bef84d7e9d4acefc39a1140ea6fc64cea5710d5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticMediaWiki Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove non-existing class from autoloader - change (mediawiki...SemanticForms)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/69013 Change subject: Remove non-existing class from autoloader .. Remove non-existing class from autoloader Change-Id: I5fa029b9222f1bb4a4e0fe181b142afda2c8d66c --- M SemanticForms.php 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms refs/changes/13/69013/1 diff --git a/SemanticForms.php b/SemanticForms.php index 2630923..007b80b 100644 --- a/SemanticForms.php +++ b/SemanticForms.php @@ -147,7 +147,6 @@ $wgAutoloadClasses['SFFormField'] = $sfgIP . '/includes/SF_FormField.php'; $wgAutoloadClasses['SFFormPrinter'] = $sfgIP . '/includes/SF_FormPrinter.php'; $wgAutoloadClasses['SFFormUtils'] = $sfgIP . '/includes/SF_FormUtils.php'; -$wgAutoloadClasses['SFFormEditTab'] = $sfgIP . '/includes/SF_FormEditTab.php'; $wgAutoloadClasses['SFFormEditPage'] = $sfgIP . '/includes/SF_FormEditPage.php'; $wgAutoloadClasses['SFUtils'] = $sfgIP . '/includes/SF_Utils.php'; $wgAutoloadClasses['SFFormLinker'] = $sfgIP . '/includes/SF_FormLinker.php'; -- To view, visit https://gerrit.wikimedia.org/r/69013 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fa029b9222f1bb4a4e0fe181b142afda2c8d66c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticForms Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove non-existing class from autoloader - change (mediawiki...SemanticMaps)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/69014 Change subject: Remove non-existing class from autoloader .. Remove non-existing class from autoloader Change-Id: I6b82e004cf19279e718adcf28e970df429257532 --- M includes/services/OpenLayers/SM_OpenLayers.php 1 file changed, 5 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMaps refs/changes/14/69014/1 diff --git a/includes/services/OpenLayers/SM_OpenLayers.php b/includes/services/OpenLayers/SM_OpenLayers.php index 1263760..babf7a4 100644 --- a/includes/services/OpenLayers/SM_OpenLayers.php +++ b/includes/services/OpenLayers/SM_OpenLayers.php @@ -38,14 +38,12 @@ function smfInitOpenLayers() { global $wgAutoloadClasses; - - $wgAutoloadClasses['SMOpenLayersQP'] = __DIR__ . '/SM_OpenLayersQP.php'; - + // TODO: the if should not be needed, but when omitted, a fatal error occurs cause the class that's extended by this one is not found. if ( defined( 'SF_VERSION' ) ) $wgAutoloadClasses['SMOpenLayersFormInput'] = __DIR__ . '/SM_OpenLayersFormInput.php'; - + MapsMappingServices::registerServiceFeature( 'openlayers', 'qp', 'SMMapPrinter' ); - MapsMappingServices::registerServiceFeature( 'openlayers', 'fi', 'SMOpenLayersFormInput' ); - + MapsMappingServices::registerServiceFeature( 'openlayers', 'fi', 'SMOpenLayersFormInput' ); + return true; -} \ No newline at end of file +} -- To view, visit https://gerrit.wikimedia.org/r/69014 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6b82e004cf19279e718adcf28e970df429257532 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticMaps Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add wikidata as keyword in package description - change (mediawiki...Diff)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/69015 Change subject: Add wikidata as keyword in package description .. Add wikidata as keyword in package description Change-Id: I7c45fd053b8b8743c45a62b41302279b6eeb6fbc --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Diff refs/changes/15/69015/1 diff --git a/composer.json b/composer.json index d5893a9..39f68ee 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ name: diff/diff, type: library, description: Library for computing and representing diffs between JSON like data structures, - keywords: [diff], + keywords: [diff, wikidata], homepage: https://www.mediawiki.org/wiki/Extension:Diff;, license: GPL-2.0+, authors: [ -- To view, visit https://gerrit.wikimedia.org/r/69015 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c45fd053b8b8743c45a62b41302279b6eeb6fbc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Diff Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add wikidata as keyword in package description - change (mediawiki...Diff)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Add wikidata as keyword in package description .. Add wikidata as keyword in package description Change-Id: I7c45fd053b8b8743c45a62b41302279b6eeb6fbc --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.json b/composer.json index d5893a9..39f68ee 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ name: diff/diff, type: library, description: Library for computing and representing diffs between JSON like data structures, - keywords: [diff], + keywords: [diff, wikidata], homepage: https://www.mediawiki.org/wiki/Extension:Diff;, license: GPL-2.0+, authors: [ -- To view, visit https://gerrit.wikimedia.org/r/69015 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7c45fd053b8b8743c45a62b41302279b6eeb6fbc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Diff Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add wikidata as keyword in package description - change (mediawiki...DataValues)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/69016 Change subject: Add wikidata as keyword in package description .. Add wikidata as keyword in package description Change-Id: I6d1e77897be6524d99e6d37c62cda7d9c37858d0 --- M composer.json 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/16/69016/1 diff --git a/composer.json b/composer.json index dd1522b..ccfd128 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,8 @@ valueparsers, valueformatters, datatypes, - valuevalidators + valuevalidators, + wikidata ], homepage: https://www.mediawiki.org/wiki/Extension:DataValues;, license: GPL-2.0+, -- To view, visit https://gerrit.wikimedia.org/r/69016 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6d1e77897be6524d99e6d37c62cda7d9c37858d0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add wikidata as keyword in package description - change (mediawiki...DataValues)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Add wikidata as keyword in package description .. Add wikidata as keyword in package description Change-Id: I6d1e77897be6524d99e6d37c62cda7d9c37858d0 --- M composer.json 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Jeroen De Dauw: Looks good to me, approved diff --git a/composer.json b/composer.json index dd1522b..ccfd128 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,8 @@ valueparsers, valueformatters, datatypes, - valuevalidators + valuevalidators, + wikidata ], homepage: https://www.mediawiki.org/wiki/Extension:DataValues;, license: GPL-2.0+, -- To view, visit https://gerrit.wikimedia.org/r/69016 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6d1e77897be6524d99e6d37c62cda7d9c37858d0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Combine text and ID update fields - change (mediawiki...UserMerge)
Parent5446 has uploaded a new change for review. https://gerrit.wikimedia.org/r/69017 Change subject: Combine text and ID update fields .. Combine text and ID update fields Reduce the number of expensive database queries performed while merging by combining the updates of text fields with their corresponding ID fields. Bug: 49520 Change-Id: Ibb36ef49e99246e502835f51ab6776422b62438d --- M UserMerge_body.php 1 file changed, 36 insertions(+), 27 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UserMerge refs/changes/17/69017/1 diff --git a/UserMerge_body.php b/UserMerge_body.php index 9573213..d3e61a4 100644 --- a/UserMerge_body.php +++ b/UserMerge_body.php @@ -215,41 +215,50 @@ * @return bool Always returns true - throws exceptions on failure. */ private function mergeUser( $objNewUser, $newuser_text, $newuserID, $objOldUser, $olduser_text, $olduserID ) { - $idUpdateFields = array( - array( 'archive', 'ar_user' ), - array( 'revision', 'rev_user' ), - array( 'filearchive', 'fa_user' ), - array( 'image', 'img_user' ), - array( 'oldimage', 'oi_user' ), - array( 'recentchanges', 'rc_user' ), + // Fields to update with the format: + // array( tableName, idField, textField ) + $updateFields = array( + array( 'archive', 'ar_user', 'ar_user_text' ), + array( 'revision', 'rev_user', 'rev_user_text' ), + array( 'filearchive', 'fa_user', 'fa_user_text' ), + array( 'image', 'img_user', 'img_user_text' ), + array( 'oldimage', 'oi_user', 'oi_user_text' ), + array( 'recentchanges', 'rc_user', 'rc_user_text' ), array( 'logging', 'log_user' ), - array( 'ipblocks', 'ipb_user' ), - array( 'ipblocks', 'ipb_by' ), + array( 'ipblocks', 'ipb_user', 'ipb_address' ), + array( 'ipblocks', 'ipb_by', 'ipb_by_text' ), array( 'watchlist', 'wl_user' ), - ); - - $textUpdateFields = array( - array( 'archive', 'ar_user_text' ), - array( 'revision', 'rev_user_text' ), - array( 'filearchive', 'fa_user_text' ), - array( 'image', 'img_user_text' ), - array( 'oldimage', 'oi_user_text' ), - array( 'recentchanges', 'rc_user_text' ), - array( 'ipblocks', 'ipb_address' ), - array( 'ipblocks', 'ipb_by_text' ), ); $dbw = wfGetDB( DB_MASTER ); $out = $this-getOutput(); - foreach ( $idUpdateFields as $idUpdateField ) { - $dbw-update( $idUpdateField[0], array( $idUpdateField[1] = $newuserID ), array( $idUpdateField[1] = $olduserID ) ); - $out-addHTML( $this-msg( 'usermerge-updating', $idUpdateField[0], $olduserID, $newuserID )-escaped() . br /\n ); - } + foreach ( $updateFields as $fieldInfo ) { + $tableName = array_shift( $fieldInfo ); + $idField = array_shift( $fieldInfo ); - foreach ( $textUpdateFields as $textUpdateField ) { - $dbw-update( $textUpdateField[0], array( $textUpdateField[1] = $newuser_text ), array( $textUpdateField[1] = $olduser_text ) ); - $out-addHTML( $this-msg( 'usermerge-updating', $textUpdateField[0], $olduser_text, $newuser_text )-escaped() . br /\n ); + $dbw-update( + $tableName, + array( $idField = $newuserID ) + array_fill_keys( $fieldInfo, $newuser_text ), + array( $idField = $olduserID ), + __METHOD__ + ); + + $out-addHTML( $this-msg( + 'usermerge-updating', + $tableName, + $olduserID, + $newuserID + )-escaped() . br /\n ); + + foreach ( $fieldInfo as $textField ) { + $out-addHTML( $this-msg( + 'usermerge-updating', + $tableName, + $olduser_text, + $newuser_text + )-escaped() . br /\n ); + } }
[MediaWiki-commits] [Gerrit] Updated and added default configuration - change (mediawiki...AWS)
Parent5446 has uploaded a new change for review. https://gerrit.wikimedia.org/r/69018 Change subject: Updated and added default configuration .. Updated and added default configuration Some parts of the configuration must be a certain way, so let those be defaults so that the end user doesn't have to configure them manually. Change-Id: I66952eecb1f7ce619c1e2f203a485446712c2d11 --- M AWS.php 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AWS refs/changes/18/69018/1 diff --git a/AWS.php b/AWS.php index ff65e5a..76d5b20 100644 --- a/AWS.php +++ b/AWS.php @@ -55,6 +55,15 @@ $wgExtensionMessagesFiles['AWS'] = __DIR__ . '/AWS.i18n.php'; $wgAutoloadClasses['JobQueueAmazonSqs'] = __DIR__ . '/sqs/JobQueueAmazonSqs.php'; $wgAutoloadClasses['AmazonS3FileBackend'] = __DIR__ . '/s3/AmazonS3FileBackend.php'; -$wgJobTypeConf['sqs'] = array( 'class' = 'JobQueueAmazonSqs', 'order' = 'random' ); + +$wgJobTypeConf['sqs'] = array( + 'class' = 'JobQueueAmazonSqs', + 'order' = 'random' +); +$wgFileBackends['s3'] = array( + 'name' = 'AmazonS3', + 'class' = 'AmazonS3FileBackend', + 'lockManager' = 'nullLockManager', +); require_once __DIR__ . '/vendor/autoload.php'; -- To view, visit https://gerrit.wikimedia.org/r/69018 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I66952eecb1f7ce619c1e2f203a485446712c2d11 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AWS Gerrit-Branch: master Gerrit-Owner: Parent5446 tylerro...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updated and added default configuration - change (mediawiki...AWS)
Parent5446 has submitted this change and it was merged. Change subject: Updated and added default configuration .. Updated and added default configuration Some parts of the configuration must be a certain way, so let those be defaults so that the end user doesn't have to configure them manually. Change-Id: I66952eecb1f7ce619c1e2f203a485446712c2d11 --- M AWS.php 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Parent5446: Verified; Looks good to me, approved diff --git a/AWS.php b/AWS.php index ff65e5a..76d5b20 100644 --- a/AWS.php +++ b/AWS.php @@ -55,6 +55,15 @@ $wgExtensionMessagesFiles['AWS'] = __DIR__ . '/AWS.i18n.php'; $wgAutoloadClasses['JobQueueAmazonSqs'] = __DIR__ . '/sqs/JobQueueAmazonSqs.php'; $wgAutoloadClasses['AmazonS3FileBackend'] = __DIR__ . '/s3/AmazonS3FileBackend.php'; -$wgJobTypeConf['sqs'] = array( 'class' = 'JobQueueAmazonSqs', 'order' = 'random' ); + +$wgJobTypeConf['sqs'] = array( + 'class' = 'JobQueueAmazonSqs', + 'order' = 'random' +); +$wgFileBackends['s3'] = array( + 'name' = 'AmazonS3', + 'class' = 'AmazonS3FileBackend', + 'lockManager' = 'nullLockManager', +); require_once __DIR__ . '/vendor/autoload.php'; -- To view, visit https://gerrit.wikimedia.org/r/69018 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I66952eecb1f7ce619c1e2f203a485446712c2d11 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AWS Gerrit-Branch: master Gerrit-Owner: Parent5446 tylerro...@gmail.com Gerrit-Reviewer: Parent5446 tylerro...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] splitClusters uses Grapheme Cluster Boundary rules - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: splitClusters uses Grapheme Cluster Boundary rules .. splitClusters uses Grapheme Cluster Boundary rules unicodejs.graphemebreak.js * New file: singleton class with splitClusters method * On load, builds graphemeBreakRegexp from unicodejs.graphemebreakproperties.js unicodejs.js * Remove old splitClusters method (was just a placeholder) * Change conjunction - disjunction, for consistency and correctness unicodejs.textstring.js * Use new splitClusters method modules/ve/ve.js * Use new splitClusters method unicodejs.wordbreak.text.js * Add new splitClusters test * Refactor charRangeArrayRegexp test to use splitClusters PHP files * add unicodejs.graphemebreak.js, unicodejs.graphemebreakproperties.js .docs/categories.json * add unicodeJS.wordbreak class Change-Id: I8f512e2fc2c46eb4b5f00994a8dac88f3c8f7dd2 --- M .docs/categories.json M VisualEditor.php M demos/ve/index.php M maintenance/makeStaticLoader.php M modules/unicodejs/index.php A modules/unicodejs/unicodejs.graphemebreak.js M modules/unicodejs/unicodejs.js M modules/unicodejs/unicodejs.textstring.js M modules/unicodejs/unicodejs.wordbreak.test.js M modules/ve/test/index.php M modules/ve/ve.js 11 files changed, 176 insertions(+), 66 deletions(-) Approvals: Esanders: Looks good to me, approved jenkins-bot: Verified diff --git a/.docs/categories.json b/.docs/categories.json index 2601503..0efd230 100644 --- a/.docs/categories.json +++ b/.docs/categories.json @@ -173,7 +173,7 @@ { name: UnicodeJS, classes: [ - unicodeJS, unicodeJS.TextString, unicodeJS.wordbreak + unicodeJS, unicodeJS.TextString, unicodeJS.wordbreak, unicodeJS.graphemebreak ] } ] diff --git a/VisualEditor.php b/VisualEditor.php index b3bcfd6..f7356a8 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -85,6 +85,8 @@ 'scripts' = array( 'unicodejs/unicodejs.js', 'unicodejs/unicodejs.textstring.js', + 'unicodejs/unicodejs.graphemebreakproperties.js', + 'unicodejs/unicodejs.graphemebreak.js', 'unicodejs/unicodejs.wordbreakproperties.js', 'unicodejs/unicodejs.wordbreak.js', ), diff --git a/demos/ve/index.php b/demos/ve/index.php index a1d3d34..88ab824 100644 --- a/demos/ve/index.php +++ b/demos/ve/index.php @@ -85,6 +85,8 @@ script src=../../modules/rangy/rangy-position-1.3.js/script script src=../../modules/unicodejs/unicodejs.js/script script src=../../modules/unicodejs/unicodejs.textstring.js/script + script src=../../modules/unicodejs/unicodejs.graphemebreakproperties.js/script + script src=../../modules/unicodejs/unicodejs.graphemebreak.js/script script src=../../modules/unicodejs/unicodejs.wordbreakproperties.js/script script src=../../modules/unicodejs/unicodejs.wordbreak.js/script !-- ext.visualEditor.base#standalone-init -- diff --git a/maintenance/makeStaticLoader.php b/maintenance/makeStaticLoader.php index 7478d3c..7054855 100644 --- a/maintenance/makeStaticLoader.php +++ b/maintenance/makeStaticLoader.php @@ -89,6 +89,8 @@ 'rangy/rangy-position-1.3.js', 'unicodejs/unicodejs.js', 'unicodejs/unicodejs.textstring.js', + 'unicodejs/unicodejs.graphemebreakproperties.js', + 'unicodejs/unicodejs.graphemebreak.js', 'unicodejs/unicodejs.wordbreakproperties.js', 'unicodejs/unicodejs.wordbreak.js', ), diff --git a/modules/unicodejs/index.php b/modules/unicodejs/index.php index 7fc9a0f..121764e 100644 --- a/modules/unicodejs/index.php +++ b/modules/unicodejs/index.php @@ -21,6 +21,8 @@ script src=../jquery/jquery.js/script script src=unicodejs.js/script script src=unicodejs.textstring.js/script + script src=unicodejs.graphemebreakproperties.js/script + script src=unicodejs.graphemebreak.js/script script src=unicodejs.wordbreakproperties.js/script script src=unicodejs.wordbreak.js/script diff --git a/modules/unicodejs/unicodejs.graphemebreak.js b/modules/unicodejs/unicodejs.graphemebreak.js new file mode 100644 index 000..abb86f5 --- /dev/null +++ b/modules/unicodejs/unicodejs.graphemebreak.js @@ -0,0 +1,91 @@ +/*! + * Graphemebreak module + * + *
[MediaWiki-commits] [Gerrit] Remove non-existing class from autoloader - change (mediawiki...SemanticMediaWiki)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Remove non-existing class from autoloader .. Remove non-existing class from autoloader Change-Id: I1bef84d7e9d4acefc39a1140ea6fc64cea5710d5 --- M includes/Setup.php 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Setup.php b/includes/Setup.php index d9410f0..edc5c49 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -260,7 +260,6 @@ $wgAutoloadClasses['SMWSQLStore3SpecialPageHandlers'] = $stoDirSQL . 'SMW_SQLStore3_SpecialPageHandlers.php'; $wgAutoloadClasses['SMWSQLStore3SetupHandlers']= $stoDirSQL . 'SMW_SQLStore3_SetupHandlers.php'; $wgAutoloadClasses['SMWDataItemHandler'] = $stoDirSQL . 'SMW_DataItemHandler.php'; - $wgAutoloadClasses['SMWDIHandlerProperty']= $stoDirSQL . 'SMW_DIHandler_Property.php'; $wgAutoloadClasses['SMWDIHandlerBoolean'] = $stoDirSQL . 'SMW_DIHandler_Bool.php'; $wgAutoloadClasses['SMWDIHandlerNumber'] = $stoDirSQL . 'SMW_DIHandler_Number.php'; $wgAutoloadClasses['SMWDIHandlerBlob']= $stoDirSQL . 'SMW_DIHandler_Blob.php'; -- To view, visit https://gerrit.wikimedia.org/r/69012 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1bef84d7e9d4acefc39a1140ea6fc64cea5710d5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticMediaWiki Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove non-existing class from autoloader - change (mediawiki...SemanticMaps)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Remove non-existing class from autoloader .. Remove non-existing class from autoloader Change-Id: I6b82e004cf19279e718adcf28e970df429257532 --- M includes/services/OpenLayers/SM_OpenLayers.php 1 file changed, 5 insertions(+), 7 deletions(-) Approvals: Jeroen De Dauw: Verified; Looks good to me, approved diff --git a/includes/services/OpenLayers/SM_OpenLayers.php b/includes/services/OpenLayers/SM_OpenLayers.php index 1263760..babf7a4 100644 --- a/includes/services/OpenLayers/SM_OpenLayers.php +++ b/includes/services/OpenLayers/SM_OpenLayers.php @@ -38,14 +38,12 @@ function smfInitOpenLayers() { global $wgAutoloadClasses; - - $wgAutoloadClasses['SMOpenLayersQP'] = __DIR__ . '/SM_OpenLayersQP.php'; - + // TODO: the if should not be needed, but when omitted, a fatal error occurs cause the class that's extended by this one is not found. if ( defined( 'SF_VERSION' ) ) $wgAutoloadClasses['SMOpenLayersFormInput'] = __DIR__ . '/SM_OpenLayersFormInput.php'; - + MapsMappingServices::registerServiceFeature( 'openlayers', 'qp', 'SMMapPrinter' ); - MapsMappingServices::registerServiceFeature( 'openlayers', 'fi', 'SMOpenLayersFormInput' ); - + MapsMappingServices::registerServiceFeature( 'openlayers', 'fi', 'SMOpenLayersFormInput' ); + return true; -} \ No newline at end of file +} -- To view, visit https://gerrit.wikimedia.org/r/69014 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6b82e004cf19279e718adcf28e970df429257532 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticMaps Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update thumb.php to handle langXX-type thumbnail names - change (mediawiki/core)
Jarry1250 has uploaded a new change for review. https://gerrit.wikimedia.org/r/69019 Change subject: Update thumb.php to handle langXX-type thumbnail names .. Update thumb.php to handle langXX-type thumbnail names See changeset #25838 for the introduction of that type, rationale, etc. See also bug #49629 for why we may want to abandon this approach at some point (probably not now though). Tested locally. Change-Id: I3e703c84ff84e30d8b96acf491318829767eb2ab --- M thumb.php 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/19/69019/1 diff --git a/thumb.php b/thumb.php index 4a0c9fb..f171ac9 100644 --- a/thumb.php +++ b/thumb.php @@ -330,6 +330,10 @@ $params['page'] = $pagenum; } return $params; // valid thumbnail URL + } elseif ( preg_match( '!^lang([a-z]+(?:-[a-z]+)*)-(\d*)px-[^/]*$!', $thumbname, $matches ) ) { + $params['lang'] = $matches[1]; + $params['width'] = array_pop( $matches ); + return $params; // valid thumbnail URL } return null; // not a valid thumbnail URL -- To view, visit https://gerrit.wikimedia.org/r/69019 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e703c84ff84e30d8b96acf491318829767eb2ab Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Jarry1250 jarry1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Roundtrip {{#tag:ref|..}} properly in editMode - change (mediawiki...Parsoid)
Subramanya Sastry has uploaded a new change for review. https://gerrit.wikimedia.org/r/69020 Change subject: Roundtrip {{#tag:ref|..}} properly in editMode .. Roundtrip {{#tag:ref|..}} properly in editMode * See example below that clarifies the problem before this patch --- $ echo {{#tag:ref|foo}} {{echo|references /}} | node parse --extensions ref,references --wt2wt --editMode true reffoo/ref references / --- * The problem is that references are generated after dom fragments are unpacked in the DOM which lost the mw:Transclusion typeof and data-mw that had been set on the ref and references tags. * This is a quick fix to prevent some dirty diffs with #tag:ref being reported on en-wp. Longer term, we do have a plan to use DOMFragment encapsulation for refs and references as well and splitting up references processing differently than is being done currently. Change-Id: I4186cae93b9882d367c7d4efecc092607fe17c61 --- M js/lib/ext.Cite.js M js/lib/mediawiki.WikitextSerializer.js 2 files changed, 34 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/20/69020/1 diff --git a/js/lib/ext.Cite.js b/js/lib/ext.Cite.js index 646b1d5..ac990d6 100644 --- a/js/lib/ext.Cite.js +++ b/js/lib/ext.Cite.js @@ -334,18 +334,19 @@ about = node.getAttribute(about), skipLinkback = node.getAttribute(skiplinkback) === 1, refGroup = getRefGroup(this.refGroups, group, true), - ref = refGroup.add(refName, about, skipLinkback); + ref = refGroup.add(refName, about, skipLinkback), + nodeType = (node.getAttribute(typeof) || '').replace(/mw:Extension\/ref\/Marker/, ''); + // Add ref-index linkback if (!skipLinkback) { var doc = node.ownerDocument, span = doc.createElement('span'), - content = node.getAttribute(content); + content = node.getAttribute(content), + dataMW = node.getAttribute('data-mw'); - DU.addAttributes(span, { - 'about': about, - 'class': 'reference', - 'data-mw': JSON.stringify({ + if (!dataMW) { + dataMW = JSON.stringify({ 'name': 'ref', // Dont set body if this is a reused reference // like ref name='..' / with empty content. @@ -355,10 +356,16 @@ 'group': group || undefined, 'name': refName || undefined } - }), + }); + } + + DU.addAttributes(span, { + 'about': about, + 'class': 'reference', + 'data-mw': dataMW, 'id': ref.linkbacks[ref.linkbacks.length - 1], 'rel': 'dc:references', - 'typeof': 'mw:Extension/ref' + 'typeof': nodeType + 'mw:Extension/ref' }); span.data = { parsoid: { @@ -394,12 +401,12 @@ // Extract ext-source for references../references usage body = Util.extractExtBody(references, src).trim(), refGroup = getRefGroup(this.refGroups, group), - ol = refsNode.ownerDocument.createElement('ol'); + ol = refsNode.ownerDocument.createElement('ol'), + nodeType = (refsNode.getAttribute(typeof) || '').replace(/mw:Extension\/references\/Marker/, ''); - DU.addAttributes(ol, { - 'about': about, - 'class': 'references', - 'data-mw': JSON.stringify({ + var dataMW = refsNode.getAttribute('data-mw'); + if (!dataMW) { + dataMW = JSON.stringify({ 'name': 'references', // We'll have to output data-mw.body.extsrc in // scenarios where original wikitext was of the form: @@ -410,8 +417,14 @@ // Dont emit empty keys 'group': group || undefined } - }), - 'typeof': 'mw:Extension/references' + }); + } + + DU.addAttributes(ol, { + 'about': about, + 'class': 'references', + 'data-mw': dataMW, + 'typeof': nodeType + 'mw:Extension/references' }); ol.data = refsNode.data; if (refGroup) { diff --git a/js/lib/mediawiki.WikitextSerializer.js b/js/lib/mediawiki.WikitextSerializer.js index
[MediaWiki-commits] [Gerrit] lockmanager: QuorumLockManager subclasses can now EX/SH lock... - change (mediawiki/core)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/69021 Change subject: lockmanager: QuorumLockManager subclasses can now EX/SH locks at once .. lockmanager: QuorumLockManager subclasses can now EX/SH locks at once * Also reduced rount trips in doUnlockingRequestBucket(). * Also removed some redundant doc comments. Change-Id: I81878e92332509bd7fda9ddeef950b774f5b015d --- M includes/filebackend/lockmanager/DBLockManager.php M includes/filebackend/lockmanager/LockManager.php M includes/filebackend/lockmanager/MemcLockManager.php M includes/filebackend/lockmanager/QuorumLockManager.php M includes/filebackend/lockmanager/RedisLockManager.php 5 files changed, 171 insertions(+), 103 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/21/69021/1 diff --git a/includes/filebackend/lockmanager/DBLockManager.php b/includes/filebackend/lockmanager/DBLockManager.php index e081987..762920d 100644 --- a/includes/filebackend/lockmanager/DBLockManager.php +++ b/includes/filebackend/lockmanager/DBLockManager.php @@ -110,6 +110,19 @@ $this-session = wfRandomString( 31 ); } + // @TODO: change this code to work in one batch + protected function getLocksOnServer( $lockSrv, array $pathsByType ) { + $status = Status::newGood(); + foreach ( $pathsByType as $type = $paths ) { + $status-merge( $this-doGetLocksOnServer( $lockSrv, $paths, $type ) ); + } + return $status; + } + + protected function freeLocksOnServer( $lockSrv, array $pathsByType ) { + return Status::newGood(); + } + /** * @see QuorumLockManager::isServerUp() * @return bool @@ -252,7 +265,7 @@ * @see DBLockManager::getLocksOnServer() * @return Status */ - protected function getLocksOnServer( $lockSrv, array $paths, $type ) { + protected function doGetLocksOnServer( $lockSrv, array $paths, $type ) { $status = Status::newGood(); $db = $this-getConnection( $lockSrv ); // checked in isServerUp() @@ -294,6 +307,7 @@ __METHOD__ ); if ( !$blocked ) { + var_dump( $encSession ); # Build up values for INSERT clause $data = array(); foreach ( $keys as $key ) { @@ -316,14 +330,6 @@ } return $status; - } - - /** -* @see QuorumLockManager::freeLocksOnServer() -* @return Status -*/ - protected function freeLocksOnServer( $lockSrv, array $paths, $type ) { - return Status::newGood(); // not supported } /** @@ -361,7 +367,7 @@ self::LOCK_EX = self::LOCK_EX ); - protected function getLocksOnServer( $lockSrv, array $paths, $type ) { + protected function doGetLocksOnServer( $lockSrv, array $paths, $type ) { $status = Status::newGood(); if ( !count( $paths ) ) { return $status; // nothing to lock @@ -405,14 +411,6 @@ } return $status; - } - - /** -* @see QuorumLockManager::freeLocksOnServer() -* @return Status -*/ - protected function freeLocksOnServer( $lockSrv, array $paths, $type ) { - return Status::newGood(); // not supported } /** diff --git a/includes/filebackend/lockmanager/LockManager.php b/includes/filebackend/lockmanager/LockManager.php index f0e54ec..dad8a62 100644 --- a/includes/filebackend/lockmanager/LockManager.php +++ b/includes/filebackend/lockmanager/LockManager.php @@ -98,7 +98,7 @@ /** * Lock the resources at the given abstract paths * -* @param array $paths Map of LockManager::LOCK_* constants to lists of storage paths +* @param array $pathsByType Map of LockManager::LOCK_* constants to lists of paths * @param integer $timeout Timeout in seconds (0 means non-blocking) (since 1.21) * @return Status * @since 1.22 @@ -125,7 +125,7 @@ /** * Unlock the resources at the given abstract paths * -* @param array $paths List of storage paths +* @param array $paths List of paths * @param $type integer LockManager::LOCK_* constant * @return Status */ @@ -136,7 +136,7 @@ /** * Unlock the resources at the given abstract paths * -* @param array $paths Map of LockManager::LOCK_* constants to lists of storage paths +* @param array $pathsByType Map of LockManager::LOCK_* constants to lists of paths *
[MediaWiki-commits] [Gerrit] Fixed mysql warning about expecting a resource. - change (mediawiki/core)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/69022 Change subject: Fixed mysql warning about expecting a resource. .. Fixed mysql warning about expecting a resource. Change-Id: I799d063fec7a8e96f49db34ce669453bd26c3fb3 --- M includes/db/DatabaseMysql.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/22/69022/1 diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index 1cd14a1..b75d615 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -164,7 +164,7 @@ } protected function mysqlError( $conn = null ) { - return mysql_error( $conn ); + return ( $conn !== null ) ? mysql_error( $conn ) : mysql_error(); // avoid warning } protected function mysqlRealEscapeString( $s ) { -- To view, visit https://gerrit.wikimedia.org/r/69022 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I799d063fec7a8e96f49db34ce669453bd26c3fb3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz asch...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add audio transcodes to Special:TimedMediaHandler. - change (mediawiki...TimedMediaHandler)
Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/69023 Change subject: Add audio transcodes to Special:TimedMediaHandler. .. Add audio transcodes to Special:TimedMediaHandler. Future todo: Add number audio files to summary at top. Bug: 49654 Change-Id: I99d29908f1d2a0ebdd3a44db4652a0aa4e35b034 --- M SpecialTimedMediaHandler.php 1 file changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/23/69023/1 diff --git a/SpecialTimedMediaHandler.php b/SpecialTimedMediaHandler.php index 8403dd9..465cff2 100644 --- a/SpecialTimedMediaHandler.php +++ b/SpecialTimedMediaHandler.php @@ -64,7 +64,8 @@ * @param bool $showTable */ private function renderState ( $out, $state, $stats, $showTable = true ) { - global $wgEnabledTranscodeSet; + global $wgEnabledTranscodeSet, $wgEnabledAudioTranscodeSet; + $allTranscodes = array_merge( $wgEnabledTranscodeSet, $wgEnabledAudioTranscodeSet ); if ( $stats[ $state ][ 'total' ] ) { // Give grep a chance to find the usages: // timedmedia-derivative-state-transcodes, timedmedia-derivative-state-active, @@ -74,7 +75,7 @@ . $this-msg( 'timedmedia-derivative-state-' . $state, $stats[ $state ]['total'] )-escaped() . /h2 ); - foreach( $wgEnabledTranscodeSet as $key ) { + foreach( $allTranscodes as $key ) { if ( $stats[ $state ][ $key ] ) { $out-addHTML( $stats[ $state ][ $key ] @@ -129,20 +130,21 @@ } private function getStats() { - global $wgEnabledTranscodeSet; + global $wgEnabledTranscodeSet, $wgEnabledAudioTranscodeSet; + $allTranscodes = array_merge( $wgEnabledTranscodeSet, $wgEnabledAudioTranscodeSet ); $stats = array(); $dbr = wfGetDB( DB_SLAVE ); $stats[ 'transcodes' ] = array( 'total' = 0 ); foreach ( $this-transcodeStates as $state = $condition ) { $stats[ $state ] = array( 'total' = 0 ); - foreach( $wgEnabledTranscodeSet as $type ) { + foreach( $allTranscodes as $type ) { // Important to pre-initialize, as can give // warnings if you don't have a lot of things in transcode table. $stats[ $state ][ $type ] = 0; } } foreach ( $this-transcodeStates as $state = $condition ) { - $cond = array( 'transcode_key' = $wgEnabledTranscodeSet ); + $cond = array( 'transcode_key' = $allTranscodes ); $cond[] = $condition; $res = $dbr-select( 'transcode', array('COUNT(*) as count', 'transcode_key'), @@ -158,7 +160,7 @@ } $res = $dbr-select( 'transcode', array( 'COUNT(*) as count', 'transcode_key' ), - array( 'transcode_key' = $wgEnabledTranscodeSet ), + array( 'transcode_key' = $allTranscodes ), __METHOD__, array( 'GROUP BY' = 'transcode_key' ) ); -- To view, visit https://gerrit.wikimedia.org/r/69023 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I99d29908f1d2a0ebdd3a44db4652a0aa4e35b034 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: Brian Wolff bawolff...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove handling of old 'editsection' class - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Remove handling of old 'editsection' class .. Remove handling of old 'editsection' class It's been replaced with 'mw-editsection' and all cached renders on Wikimedia wikis have expired by now. All backwards-compatibility occurences have been removed from MediaWiki core already. Change-Id: Id3731222445b588de8aec0e86892879ac4472636 --- M modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js index ddde3f4..acd1984 100644 --- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js @@ -986,7 +986,7 @@ */ ve.init.mw.ViewPageTarget.prototype.setupSectionEditLinks = function () { var veEditUri = this.veEditUri, - $links = $( '#mw-content-text .mw-editsection a, #mw-content-text .editsection a' ); + $links = $( '#mw-content-text .mw-editsection a' ); if ( this.isViewPage ) { $links.click( ve.bind( this.onEditSectionLinkClick, this ) ); } else { -- To view, visit https://gerrit.wikimedia.org/r/68865 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id3731222445b588de8aec0e86892879ac4472636 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Matmarex matma@gmail.com Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Jforrester jforres...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] LabsNFS: switch to 8k transmit size - change (operations/puppet)
coren has uploaded a new change for review. https://gerrit.wikimedia.org/r/69024 Change subject: LabsNFS: switch to 8k transmit size .. LabsNFS: switch to 8k transmit size Works around a possible kernel bug: https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/879334 Change-Id: Ibd8d48667e955eddf8c4341c3d99803a4c80d5d0 --- M templates/labsnfs/auto.master.erb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/24/69024/1 diff --git a/templates/labsnfs/auto.master.erb b/templates/labsnfs/auto.master.erb index ee24175..65a5f83 100644 --- a/templates/labsnfs/auto.master.erb +++ b/templates/labsnfs/auto.master.erb @@ -1,5 +1,5 @@ # # Managed by PUPPET (role::labs-nfs-client) # -/- file:/etc/auto.space port=0,nfsvers=4,ro,hard,rsize=65536,wsize=65536,sec=sys +/- file:/etc/auto.space port=0,nfsvers=4,ro,hard,rsize=8192,wsize=8192,sec=sys #+auto.master -- To view, visit https://gerrit.wikimedia.org/r/69024 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd8d48667e955eddf8c4341c3d99803a4c80d5d0 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: coren mpellet...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] thumb_handler.php doesn't seem to extract path_info correctly - change (mediawiki/core)
Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/69025 Change subject: thumb_handler.php doesn't seem to extract path_info correctly .. thumb_handler.php doesn't seem to extract path_info correctly Set $wgArticlePath so that it works the way that [[Manual:Thumb.php]] claims it does. Change-Id: I35b4ab73e1d84dad10503d3a098ee154e8d58d8a --- M thumb.php 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/25/69025/1 diff --git a/thumb.php b/thumb.php index 4a0c9fb..b9826a7 100644 --- a/thumb.php +++ b/thumb.php @@ -62,9 +62,15 @@ # Set action base paths so that WebRequest::getPathInfo() # recognizes the X as the 'title' in ../thumb_handler.php/X urls. - $wgArticlePath = false; # Don't let a /* article path clober our action path + # Note: If Custom per-extension repo paths are set, this may break. + $repo = RepoGroup::singleton()-getLocalRepo(); + $oldArticlePath = $wgArticlePath; + $wgArticlePath = $repo-getZoneUrl( 'thumb' ) . '/$1'; $matches = WebRequest::getPathInfo(); + + $wgArticlePath = $oldArticlePath; + if ( !isset( $matches['title'] ) ) { wfThumbError( 404, 'Could not determine the name of the requested thumbnail.' ); return; -- To view, visit https://gerrit.wikimedia.org/r/69025 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I35b4ab73e1d84dad10503d3a098ee154e8d58d8a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Brian Wolff bawolff...@gmail.com Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] LabsNFS: switch to 8k transmit size - change (operations/puppet)
coren has submitted this change and it was merged. Change subject: LabsNFS: switch to 8k transmit size .. LabsNFS: switch to 8k transmit size Works around a possible kernel bug: https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/879334 Change-Id: Ibd8d48667e955eddf8c4341c3d99803a4c80d5d0 --- M templates/labsnfs/auto.master.erb 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Ryan Lane: Looks good to me, approved jenkins-bot: Verified diff --git a/templates/labsnfs/auto.master.erb b/templates/labsnfs/auto.master.erb index ee24175..65a5f83 100644 --- a/templates/labsnfs/auto.master.erb +++ b/templates/labsnfs/auto.master.erb @@ -1,5 +1,5 @@ # # Managed by PUPPET (role::labs-nfs-client) # -/- file:/etc/auto.space port=0,nfsvers=4,ro,hard,rsize=65536,wsize=65536,sec=sys +/- file:/etc/auto.space port=0,nfsvers=4,ro,hard,rsize=8192,wsize=8192,sec=sys #+auto.master -- To view, visit https://gerrit.wikimedia.org/r/69024 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibd8d48667e955eddf8c4341c3d99803a4c80d5d0 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: coren mpellet...@wikimedia.org Gerrit-Reviewer: Ryan Lane rl...@wikimedia.org Gerrit-Reviewer: coren mpellet...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add whitespace before {{DEFAULTSORT}} calls - change (mediawiki...Parsoid)
MarkTraceur has uploaded a new change for review. https://gerrit.wikimedia.org/r/69026 Change subject: Add whitespace before {{DEFAULTSORT}} calls .. Add whitespace before {{DEFAULTSORT}} calls MarkTraceur reunion tour commit. James_F owes me lunch. Bug: 49635 Bug: 48557 Change-Id: Ib37ccaca5ff83950742ced8f4ec3af13e81fbfab --- M js/lib/mediawiki.WikitextSerializer.js 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/26/69026/1 diff --git a/js/lib/mediawiki.WikitextSerializer.js b/js/lib/mediawiki.WikitextSerializer.js index 6ae99d8..514dd53 100644 --- a/js/lib/mediawiki.WikitextSerializer.js +++ b/js/lib/mediawiki.WikitextSerializer.js @@ -2195,9 +2195,15 @@ } }, before: function(node, otherNode) { - var type = node.getAttribute('typeof'); + var type = node.getAttribute( 'typeof' ) || node.getAttribute( 'property' ); if (type type.match(/mw:Includes\//)) { return {max:0}; +} else if ( type type.match( /mw:PageProp\/categorydefaultsort/ ) ) { +if ( otherNode.nodeName.toLowerCase() === 'p' ) { +return { min: 2 }; +} else { +return { min: 1 }; +} } else { return {}; } -- To view, visit https://gerrit.wikimedia.org/r/69026 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib37ccaca5ff83950742ced8f4ec3af13e81fbfab Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: MarkTraceur mtrac...@member.fsf.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updated parser tests blacklist - more tests pass due to 2502... - change (mediawiki...Parsoid)
MarkTraceur has submitted this change and it was merged. Change subject: Updated parser tests blacklist - more tests pass due to 2502b4b92 .. Updated parser tests blacklist - more tests pass due to 2502b4b92 Change-Id: I6f4d7713f65ca7c31bbc2c6a1caf04bf8a1fe46a --- M js/tests/parserTests-blacklist.js 1 file changed, 0 insertions(+), 23 deletions(-) Approvals: MarkTraceur: Looks good to me, approved jenkins-bot: Verified diff --git a/js/tests/parserTests-blacklist.js b/js/tests/parserTests-blacklist.js index a8ee8c2..47de0c9 100644 --- a/js/tests/parserTests-blacklist.js +++ b/js/tests/parserTests-blacklist.js @@ -465,18 +465,7 @@ add(wt2html, Language parser function); add(wt2html, Special parser function); add(wt2html, 1. SOL-sensitive wikitext tokens as template-args); -add(wt2html, Ref: 5. body should accept generic wikitext); -add(wt2html, Ref: 6. indent-pres should not be output in ref-body); -add(wt2html, Ref: 6. No p-wrapping in ref-body); -add(wt2html, Ref: 8. transclusion wikitext has lower precedence); add(wt2html, Ref: 9. unclosed comments should not leak out of ref-body); -add(wt2html, Ref: 10. Unclosed HTML tags should not leak out of ref-body); -add(wt2html, Ref: 14. A nested ref-tag should be emitted as plain text); -add(wt2html, Ref: 15. ref-tags with identical names should get identical indexes); -add(wt2html, References: 2. references tag with group only outputs references from that group); -add(wt2html, References: 3. ref list should be cleared after processing references); -add(wt2html, References: 4. only referenced group should be cleared after processing references); -add(wt2html, References: 5. ref tags in references should be processed while ignoring all other content); add(wt2html, Headings: 2. Outside heading nest on a single line h1foo/h1*bar); add(wt2html, Tables: 1b. No escaping needed); add(wt2html, Tables: 1c. No escaping needed); @@ -1069,18 +1058,6 @@ add(html2html, Gallery override link with absolute external link (bug 34852)); add(html2html, Gallery override link with malicious javascript (bug 34852)); add(html2html, Gallery with invalid title as link (bug 43964)); -add(html2html, Ref: 5. body should accept generic wikitext); -add(html2html, Ref: 6. indent-pres should not be output in ref-body); -add(html2html, Ref: 6. No p-wrapping in ref-body); -add(html2html, Ref: 8. transclusion wikitext has lower precedence); -add(html2html, Ref: 9. unclosed comments should not leak out of ref-body); -add(html2html, Ref: 10. Unclosed HTML tags should not leak out of ref-body); -add(html2html, Ref: 14. A nested ref-tag should be emitted as plain text); -add(html2html, Ref: 15. ref-tags with identical names should get identical indexes); -add(html2html, References: 2. references tag with group only outputs references from that group); -add(html2html, References: 3. ref list should be cleared after processing references); -add(html2html, References: 4. only referenced group should be cleared after processing references); -add(html2html, References: 5. ref tags in references should be processed while ignoring all other content); add(html2html, Headings: 2. Outside heading nest on a single line h1foo/h1*bar); add(html2html, Links 1. Quote marks in link text); add(html2html, Links 2. WikiLinks: Escapes needed); -- To view, visit https://gerrit.wikimedia.org/r/68849 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6f4d7713f65ca7c31bbc2c6a1caf04bf8a1fe46a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: Subramanya Sastry ssas...@wikimedia.org Gerrit-Reviewer: MarkTraceur mtrac...@member.fsf.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Pretty-print when stdout is a tty; drop 'util' - change (mediawiki...EventLogging)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/69030 Change subject: Pretty-print when stdout is a tty; drop 'util' .. Pretty-print when stdout is a tty; drop 'util' This change removes `eventlogging.util` (it was never quite substantial enough to merit being its own module) and makes `stdout_writer` pretty-print its output when stdout is an interactive terminal. Change-Id: I5e549dbd448db227d8c16f56c8442ded65600460 --- M server/eventlogging/__init__.py M server/eventlogging/factory.py M server/eventlogging/handlers.py D server/eventlogging/util.py M server/tests/__init__.py D server/tests/test_util.py 6 files changed, 18 insertions(+), 63 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging refs/changes/30/69030/1 diff --git a/server/eventlogging/__init__.py b/server/eventlogging/__init__.py index 989a7b9..759e244 100644 --- a/server/eventlogging/__init__.py +++ b/server/eventlogging/__init__.py @@ -23,7 +23,6 @@ from .parse import * from .schema import * from .stream import * -from .util import * # The fact that schema validation is entrusted to a third-party module # is an implementation detail that a consumer of this package's API diff --git a/server/eventlogging/factory.py b/server/eventlogging/factory.py index 9aeb0b5..43df016 100644 --- a/server/eventlogging/factory.py +++ b/server/eventlogging/factory.py @@ -9,8 +9,7 @@ import inspect import json -from .util import get_uri_scheme, get_uri_params -from .compat import items +from .compat import items, parse_qsl __all__ = ('writes', 'reads', 'get_writer', 'get_reader') @@ -18,6 +17,12 @@ _writers = {} _readers = {} _mappers = {} + + +def deparam(uri): +Parse query string from URI into a dict. +qs = uri.rsplit('?', 1)[-1] +return dict(parse_qsl(qs)) def call(f, kwargs): @@ -56,8 +61,9 @@ def get_writer(uri): Given a writer URI (representing, for example, a database connection), invoke and initialize the appropriate handler. -writer = _writers[get_uri_scheme(uri)] -params = dict(get_uri_params(uri), uri=uri) +uri_scheme = uri.split('://', 1)[0] +writer = _writers[uri_scheme] +params = dict(deparam(uri), uri=uri) coroutine = call(writer, params) next(coroutine) return coroutine @@ -67,8 +73,9 @@ Given a reader URI (representing the address of an input stream), invoke and initialize a generator that will yield values from that stream. -reader = _readers[get_uri_scheme(uri)] -params = dict(get_uri_params(uri), uri=uri) +uri_scheme = uri.split('://', 1)[0] +reader = _readers[uri_scheme] +params = dict(deparam(uri), uri=uri) mappers = params.pop('mappers', None) iterator = call(reader, params) if mappers is not None: diff --git a/server/eventlogging/handlers.py b/server/eventlogging/handlers.py index c77d72a..62dd8cd 100644 --- a/server/eventlogging/handlers.py +++ b/server/eventlogging/handlers.py @@ -25,7 +25,6 @@ from .factory import writes, reads, mapper from .compat import urlparse from .jrm import store_sql_event -from .util import strip_qs # Mappers @@ -95,9 +94,11 @@ @writes('stdout') def stdout_writer(): +kwargs = {} +if sys.stdout.isatty(): +kwargs.update(sort_keys=True, indent=2) while 1: -event = (yield) -print(json.dumps(event, sort_keys=True, indent=4)) +print(json.dumps((yield), **kwargs)) @reads('stdin') @@ -113,7 +114,7 @@ sub = context.socket(zmq.SUB) if socket_id is not None: sub.setsockopt(zmq.IDENTITY, socket_id.encode('utf8')) -sub.connect(strip_qs(uri)) +sub.connect(url[:url.find('?')]) sub.setsockopt(zmq.SUBSCRIBE, topic.encode('utf8')) while 1: diff --git a/server/eventlogging/util.py b/server/eventlogging/util.py deleted file mode 100644 index 0303cc1..000 --- a/server/eventlogging/util.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- - - eventlogging.util - ~ - - This module provides a set of discrete and generic helper functions. - - -from .compat import parse_qsl - - -__all__ = ('get_uri_scheme', 'get_uri_params', 'strip_qs') - - -def get_uri_scheme(uri): -return uri.split('://', 1)[0] - - -def get_uri_params(uri): -qs = uri.rsplit('?', 1)[-1] -return dict(parse_qsl(qs)) - - -def strip_qs(uri): -return uri.rsplit('?', 1)[0] diff --git a/server/tests/__init__.py b/server/tests/__init__.py index b181adc..eb0bb27 100644 --- a/server/tests/__init__.py +++ b/server/tests/__init__.py @@ -12,4 +12,3 @@ from .test_parser import * from .test_schema import * from .test_handlers import * -from .test_util import * diff --git a/server/tests/test_util.py b/server/tests/test_util.py deleted file mode 100644 index 34a6b62..000 --- a/server/tests/test_util.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf8 -*- -
[MediaWiki-commits] [Gerrit] Default output URI should be 'stdout://' - change (mediawiki...EventLogging)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/69029 Change subject: Default output URI should be 'stdout://' .. Default output URI should be 'stdout://' Setting the default output URI to 'stdout://' means that invoking eventlogger with only an input URI can be used for debugging and piping. Change-Id: I8935a957d300ee828bf25d5f518b73a8f5af7466 --- M server/bin/eventlogger M server/eventlogging/jrm.py 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging refs/changes/29/69029/1 diff --git a/server/bin/eventlogger b/server/bin/eventlogger index 052d7eb..9001b47 100755 --- a/server/bin/eventlogger +++ b/server/bin/eventlogger @@ -34,7 +34,7 @@ ap = argparse.ArgumentParser(description='EventLogger') ap.add_argument('input', help='URI of raw input stream') -ap.add_argument('output', help='URI of output stream') +ap.add_argument('output', help='URI of output stream', default='stdout://') args = ap.parse_args() log.info('Driving %s - %s..', args.input, args.output) diff --git a/server/eventlogging/jrm.py b/server/eventlogging/jrm.py index f7df5f6..dc3984e 100644 --- a/server/eventlogging/jrm.py +++ b/server/eventlogging/jrm.py @@ -187,13 +187,13 @@ def _property_getter(item): Mapper function for :func:`flatten` that extracts properties and their types from schema. -(key, val) = item +key, val = item if isinstance(val, dict): if 'properties' in val: val = val['properties'] elif 'type' in val: val = typecast(val) -return (key, val) +return key, val def flatten(d, sep='_', f=None): -- To view, visit https://gerrit.wikimedia.org/r/69029 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8935a957d300ee828bf25d5f518b73a8f5af7466 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EventLogging Gerrit-Branch: master Gerrit-Owner: Ori.livneh o...@wikimedia.org Gerrit-Reviewer: Ori.livneh o...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Validate imeId before rendering - change (mediawiki...UniversalLanguageSelector)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/69028 Change subject: Validate imeId before rendering .. Validate imeId before rendering Fix: TypeError: $.ime.sources[imeId] is undefined Bug: 49584 Change-Id: I9f5615d8b6729d76feae04e195a5ec6f26676bda --- M resources/js/ext.uls.inputsettings.js 1 file changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/28/69028/1 diff --git a/resources/js/ext.uls.inputsettings.js b/resources/js/ext.uls.inputsettings.js index 9d4cf46..313020b 100644 --- a/resources/js/ext.uls.inputsettings.js +++ b/resources/js/ext.uls.inputsettings.js @@ -161,8 +161,21 @@ this.$parent.position(); }, + /* +* For the given input method id, render the selection option. +* +* @param {string} imeId Input method id +* @param {boolean} selected Whether the input is the currently selected one. +* @return {Object} jQuery object corresponding to the input method item. +*/ renderInputmethodOption: function ( imeId, selected ) { var $imeLabel, name, description, inputmethod, $inputMethodItem; + + if ( imeId !== 'system' !$.ime.sources[imeId] ) { + // imeId not known for jquery.ime. + // It is very rare, but still validate it. + return $(); + } $imeLabel = $( 'label' ).attr( { 'for': imeId, @@ -184,7 +197,8 @@ } else { inputmethod = $.ime.inputmethods[imeId]; if ( !inputmethod ) { - // Delay in registration? + // The input method definition(rules) not loaded. + // We will show the name from $.ime.sources name = $.ime.sources[imeId].name; description = ''; } else { -- To view, visit https://gerrit.wikimedia.org/r/69028 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f5615d8b6729d76feae04e195a5ec6f26676bda Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make thumb_handler.php use MediaHandler::parseParamString - change (mediawiki/core)
Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/69027 Change subject: Make thumb_handler.php use MediaHandler::parseParamString .. Make thumb_handler.php use MediaHandler::parseParamString Use MediaHandler::parseParamString to parse the parameter string of a thumbnail. This seems to make much more sense given the design of the Handler class. Also mark ExtractThumbParameters hook as deprecated. This should be reviewed by someone familar with the 404 thumbnailing infrastructure. I'm unclear if there was a reason that this file was constructed this way. Bug: 49629 Change-Id: I43a0e7d6f0e45536e4e24b72140157791f5f027f --- M RELEASE-NOTES-1.22 M docs/hooks.txt M includes/media/MediaHandler.php M thumb.php 4 files changed, 77 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/27/69027/1 diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index 1b434d9..907bb89 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -235,6 +235,8 @@ will no longer be output and OutputPage::addKeyword no longer exists. * Methods Title::userCanEditCssSubpage and Title::userCanEditJsSubpage, deprecated since 1.19, have been removed. +* (bug 49629) The hook ExtractThumbParamaters has been deprecated in favour + of media handler overriding MediaHandler::parseParamString. == Compatibility == diff --git a/docs/hooks.txt b/docs/hooks.txt index ff0a864..bebc5d1 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1071,6 +1071,7 @@ 'ExtractThumbParameters': Called when extracting thumbnail parameters from a thumbnail file name. +DEPRECATED: Media handler should override MediaHandler::parseParamString instead. $thumbname: the base name of the thumbnail file $params: the currently extracted params (has source name, temp or archived zone) diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index fd576e0..3a23968 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -79,13 +79,15 @@ * Merge a parameter array into a string appropriate for inclusion in filenames * * @param $params array +* @return String */ abstract function makeParamString( $params ); /** * Parse a param string made with makeParamString back into an array * -* @param $str string +* @param $str string The parameter string without file name (e.g. 122px) +* @return Array|Boolean Array of parameters or false on failure. */ abstract function parseParamString( $str ); diff --git a/thumb.php b/thumb.php index 4a0c9fb..6dab01d 100644 --- a/thumb.php +++ b/thumb.php @@ -62,7 +62,7 @@ # Set action base paths so that WebRequest::getPathInfo() # recognizes the X as the 'title' in ../thumb_handler.php/X urls. - $wgArticlePath = false; # Don't let a /* article path clober our action path + $wgArticlePath = ''; # Don't let a /* article path clober our action path $matches = WebRequest::getPathInfo(); if ( !isset( $matches['title'] ) ) { @@ -93,17 +93,6 @@ $headers = array(); // HTTP headers to send $fileName = isset( $params['f'] ) ? $params['f'] : ''; - unset( $params['f'] ); - - // Backwards compatibility parameters - if ( isset( $params['w'] ) ) { - $params['width'] = $params['w']; - unset( $params['w'] ); - } - if ( isset( $params['p'] ) ) { - $params['page'] = $params['p']; - } - unset( $params['r'] ); // ignore 'r' because we unconditionally pass File::RENDER // Is this a thumb of an archived file? $isOld = ( isset( $params['archived'] ) $params['archived'] ); @@ -190,6 +179,25 @@ return; } } + + // Do rendering parameters extraction. + $params = wfConvertThumbNameToParams( $img, $params ); + if ( $params == null ) { + wfThumbError( 400, 'The specified thumbnail parameters are not recognized.' ); + return; + } + + // Backwards compatibility parameters + if ( isset( $params['w'] ) ) { + $params['width'] = $params['w']; + unset( $params['w'] ); + } + if ( isset( $params['p'] ) ) { + $params['page'] = $params['p']; + } + unset( $params['r'] ); // ignore 'r' because we unconditionally pass File::RENDER + unset( $params['f'] ); // We're done with 'f' parameter. + // Get the normalized thumbnail name from the parameters... try { @@ -287,7 +295,9 @@ /** * Extract the required params for thumb.php from the thumbnail request URI. - * At least 'width' and 'f' should be set if the result is an array. + * + * 'f' will be set, however transform parameters
[MediaWiki-commits] [Gerrit] Default output URI should be 'stdout://' - change (mediawiki...EventLogging)
jenkins-bot has submitted this change and it was merged. Change subject: Default output URI should be 'stdout://' .. Default output URI should be 'stdout://' Setting the default output URI to 'stdout://' means that invoking eventlogger with only an input URI can be used for debugging and piping. Change-Id: I8935a957d300ee828bf25d5f518b73a8f5af7466 --- M server/bin/eventlogger M server/eventlogging/jrm.py 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/server/bin/eventlogger b/server/bin/eventlogger index 052d7eb..9001b47 100755 --- a/server/bin/eventlogger +++ b/server/bin/eventlogger @@ -34,7 +34,7 @@ ap = argparse.ArgumentParser(description='EventLogger') ap.add_argument('input', help='URI of raw input stream') -ap.add_argument('output', help='URI of output stream') +ap.add_argument('output', help='URI of output stream', default='stdout://') args = ap.parse_args() log.info('Driving %s - %s..', args.input, args.output) diff --git a/server/eventlogging/jrm.py b/server/eventlogging/jrm.py index f7df5f6..dc3984e 100644 --- a/server/eventlogging/jrm.py +++ b/server/eventlogging/jrm.py @@ -187,13 +187,13 @@ def _property_getter(item): Mapper function for :func:`flatten` that extracts properties and their types from schema. -(key, val) = item +key, val = item if isinstance(val, dict): if 'properties' in val: val = val['properties'] elif 'type' in val: val = typecast(val) -return (key, val) +return key, val def flatten(d, sep='_', f=None): -- To view, visit https://gerrit.wikimedia.org/r/69029 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8935a957d300ee828bf25d5f518b73a8f5af7466 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EventLogging Gerrit-Branch: master Gerrit-Owner: Ori.livneh o...@wikimedia.org Gerrit-Reviewer: Ori.livneh o...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Cleanup ext.uls.languagesettings.js - change (mediawiki...UniversalLanguageSelector)
jenkins-bot has submitted this change and it was merged. Change subject: Cleanup ext.uls.languagesettings.js .. Cleanup ext.uls.languagesettings.js Change-Id: Ied12c6bf2022c0c291d7e5edc213340e6a159f77 --- M resources/js/ext.uls.languagesettings.js 1 file changed, 24 insertions(+), 21 deletions(-) Approvals: Santhosh: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/js/ext.uls.languagesettings.js b/resources/js/ext.uls.languagesettings.js index e91e204..c8cbc86 100644 --- a/resources/js/ext.uls.languagesettings.js +++ b/resources/js/ext.uls.languagesettings.js @@ -62,26 +62,24 @@ this.hide(); }, + // Register all event listeners to the ULS language settings here. listen: function () { - var langSettings = this; - // Register all event listeners to the ULS language settings here. - langSettings.$element.on( 'click', $.proxy( langSettings.click, langSettings ) ); - langSettings.$window.find( '#languagesettings-close' ) - .on( 'click', $.proxy( langSettings.close, langSettings ) ); - + this.$element.on( 'click', $.proxy( this.click, this ) ); + this.$window.find( '#languagesettings-close' ) + .on( 'click', $.proxy( this.close, this ) ); }, render: function () { - var modules, defaultModule, moduleName; + var moduleName, + defaultModule = this.options.defaultModule; // Get the name of all registered modules and list them in left side menu. - modules = $.fn.languagesettings.modules; - defaultModule = this.options.defaultModule; - for ( moduleName in modules ) { - if ( modules.hasOwnProperty( moduleName ) ) { + for ( moduleName in $.fn.languagesettings.modules ) { + if ( $.fn.languagesettings.modules.hasOwnProperty( moduleName ) ) { if ( !defaultModule ) { defaultModule = moduleName; } + // Call render function on the current setting module. this.renderModule( moduleName, defaultModule === moduleName ); } @@ -94,11 +92,11 @@ * @param active boolean Make this module active and show by default */ renderModule: function ( moduleName, active ) { - var $settingsMenuItems, module, $settingsText, $settingsTitle, $settingsLink, - languageSettings = this; + var $settingsTitle, $settingsText, $settingsLink, + languageSettings = this, + module = new $.fn.languagesettings.modules[moduleName]( languageSettings ), + $settingsMenuItems = languageSettings.$window.find( '.settings-menu-items' ); - $settingsMenuItems = languageSettings.$window.find( '.settings-menu-items' ); - module = new $.fn.languagesettings.modules[moduleName]( languageSettings ); $settingsTitle = $( 'div' ) .addClass( 'settings-title' ) .text( module.name ); @@ -109,19 +107,21 @@ .addClass( moduleName + '-settings-block menu-section' ) .prop( 'id', moduleName + '-settings-block' ) .data( 'module', module ) - .append( $settingsTitle ) - .append( $settingsText ); + .append( + $settingsTitle, + $settingsText + ); $settingsMenuItems.append( $settingsLink ); $settingsLink.on( 'click', function () { - var module = $( this ).data( 'module' ); + var $this = $( this ); - module.render(); + $this.data( 'module' ).render(); // re-position the window and scroll in to view if required. languageSettings.position(); $settingsMenuItems.find( '.menu-section' ).removeClass( 'active' ); -