[MediaWiki-commits] [Gerrit] Make unused variable optional in ChangesList::insertDiffHist - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269972 Change subject: Make unused variable optional in ChangesList::insertDiffHist .. Make unused variable optional in ChangesList::insertDiffHist $unpatrolled is unused in the method, so make it optional, and then uses of it can be removed. I realize it would do no harm to remove it completely, even if a few (2 that I know of) extensions still pass the variable to the method, but think this is nicer way. Change-Id: Idbe6f00e9eb40db6a28de76fca0aea7c17b75656 --- M includes/changes/ChangesList.php M includes/changes/OldChangesList.php 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/72/269972/1 diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index 73c7548..7329803 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -316,9 +316,9 @@ /** * @param string $s HTML to update * @param RecentChange $rc -* @param bool $unpatrolled +* @param bool|null $unpatrolled Unused variable. */ - public function insertDiffHist( &$s, &$rc, $unpatrolled ) { + public function insertDiffHist( &$s, &$rc, $unpatrolled = null ) { # Diff link if ( $rc->mAttribs['rc_type'] == RC_NEW || diff --git a/includes/changes/OldChangesList.php b/includes/changes/OldChangesList.php index 6f05dc4..2845c5c 100644 --- a/includes/changes/OldChangesList.php +++ b/includes/changes/OldChangesList.php @@ -92,7 +92,7 @@ } // Regular entries } else { - $this->insertDiffHist( $html, $rc, $unpatrolled ); + $this->insertDiffHist( $html, $rc ); # M, N, b and ! (minor, new, bot and unpatrolled) $html .= $this->recentChangesFlags( array( -- To view, visit https://gerrit.wikimedia.org/r/269972 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idbe6f00e9eb40db6a28de76fca0aea7c17b75656 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Exclude Sauce Labs IP ranges from rate limits on beta - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269944 Change subject: Exclude Sauce Labs IP ranges from rate limits on beta .. Exclude Sauce Labs IP ranges from rate limits on beta Some of the Wikibase browser tests are running into the limit and then failing. Bug: T126585 Change-Id: I5e09aa02ac15e958e5014375974a915539712945 --- M wmf-config/InitialiseSettings-labs.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/44/269944/1 diff --git a/wmf-config/InitialiseSettings-labs.php b/wmf-config/InitialiseSettings-labs.php index 1bd0e9f..e544121 100644 --- a/wmf-config/InitialiseSettings-labs.php +++ b/wmf-config/InitialiseSettings-labs.php @@ -553,7 +553,11 @@ ), 'wgRateLimitsExcludedIPs' => array( - 'default' => array( '198.73.209.0/24' ), // T87841 Office IP + 'default' => array( + '198.73.209.0/24', // T87841 Office IP + '162.222.72.0/21', // T126585 Sauce Labs IP range for browser tests + '66.85.48.0/21', // also Sauce Labs + ), ), 'wmgUseCapiunto' => array( -- To view, visit https://gerrit.wikimedia.org/r/269944 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5e09aa02ac15e958e5014375974a915539712945 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused imports in client tests - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269911 Change subject: Remove unused imports in client tests .. Remove unused imports in client tests Change-Id: Ibf182d0d9df32909600d99ab1d73aa975bfd2b4b --- M client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php M client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php M client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php M client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php M client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php M client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php 6 files changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/11/269911/1 diff --git a/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php b/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php index a5c6321..831a7df 100644 --- a/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php +++ b/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php @@ -2,7 +2,6 @@ namespace Wikibase\Client\Tests\DataAccess; -use DataValues\DataValue; use DataValues\StringValue; use Wikibase\Client\WikibaseClient; use Wikibase\DataModel\Entity\EntityIdValue; diff --git a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php index f4a3770..81a1d37 100644 --- a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php +++ b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php @@ -5,7 +5,6 @@ use PHPUnit_Framework_MockObject_Matcher_Invocation; use Wikibase\Client\Usage\Sql\EntityUsageTable; use Wikibase\Client\Usage\Sql\EntityUsageTableBuilder; -use Wikibase\Client\WikibaseClient; use Wikibase\DataModel\Entity\BasicEntityIdParser; use Wikibase\Lib\Reporting\ExceptionHandler; use Wikibase\Lib\Reporting\MessageReporter; diff --git a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php index 48365f9..91ffb23 100644 --- a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php +++ b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php @@ -6,7 +6,6 @@ use Wikibase\Client\Usage\EntityUsage; use Wikibase\Client\Usage\PageEntityUsages; use Wikibase\Client\Usage\Sql\EntityUsageTable; -use Wikibase\Client\WikibaseClient; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\BasicEntityIdParser; diff --git a/client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php b/client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php index a4881e9..838e214 100644 --- a/client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php +++ b/client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php @@ -4,7 +4,6 @@ use Wikibase\Client\Store\Sql\ConsistentReadConnectionManager; use Wikibase\Client\Usage\Sql\SqlSubscriptionManager; -use Wikibase\Client\WikibaseClient; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\PropertyId; diff --git a/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php b/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php index 00c995c..b1cc68d 100644 --- a/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php +++ b/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php @@ -7,7 +7,6 @@ use Wikibase\Client\Tests\Usage\UsageTrackerContractTester; use Wikibase\Client\Usage\Sql\EntityUsageTable; use Wikibase\Client\Usage\Sql\SqlUsageTracker; -use Wikibase\Client\WikibaseClient; use Wikibase\DataModel\Entity\BasicEntityIdParser; /** diff --git a/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php b/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php index 577c5ca..34dc320 100644 --- a/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php +++ b/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php @@ -6,7 +6,6 @@ use Wikibase\Client\Store\Sql\BulkSubscriptionUpdater; use Wikibase\Client\Store\Sql\ConsistentReadConnectionManager; use Wikibase\Client\Usage\Sql\EntityUsageTable; -use Wikibase\Client\WikibaseClient; use Wikibase\DataModel\Entity\ItemId; use Wikibase\Lib\Reporting\ExceptionHandler; use Wikibase\Lib\Reporting\MessageReporter; -- To view, visit https://gerrit.wikimedia.org/r/269911 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf182d0d9df32909600d99ab1d73aa975bfd2b4b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude
[MediaWiki-commits] [Gerrit] Rename variable to use camelCase - change (mediawiki...ORES)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269676 Change subject: Rename variable to use camelCase .. Rename variable to use camelCase camelCase is preferred in MediaWiki. (and generally in php) Change-Id: Ia40c9818d0fa1f8c6c0b68f8e9f6183b0fcc32f2 --- M includes/Cache.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES refs/changes/76/269676/1 diff --git a/includes/Cache.php b/includes/Cache.php index 7765583..adb7d88 100644 --- a/includes/Cache.php +++ b/includes/Cache.php @@ -6,10 +6,10 @@ class Cache { static protected $modelIds; - protected $ClassMap; + protected $classMap; public function __construct() { - $this->ClassMap = array( 'true' => 1, 'false' => 0, + $this->classMap = array( 'true' => 1, 'false' => 0, 'B' => 0, 'C' => 1, 'FA' => 2, 'GA' => 3, 'Start' => 4, 'Stub' => 5 ); } @@ -41,7 +41,7 @@ $modelId = $this->getModelId( $model ); foreach ( $modelOutputs['probability'] as $class => $probability ) { $ores_is_predicted = $prediction === $class; - $class = $this->ClassMap[$class]; + $class = $this->classMap[$class]; if ( $class === 0 ) { continue; } -- To view, visit https://gerrit.wikimedia.org/r/269676 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia40c9818d0fa1f8c6c0b68f8e9f6183b0fcc32f2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ORES Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove some unnecessary slashes and rename variable - change (mediawiki...ORES)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269663 Change subject: Remove some unnecessary slashes and rename variable .. Remove some unnecessary slashes and rename variable renamed variable to use camelCase, which is preferred in MediaWiki. Change-Id: Ibb95480043a79928991ccdc7731a6f2bd8bcded6 --- M includes/Cache.php M includes/Hooks.php 2 files changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES refs/changes/63/269663/1 diff --git a/includes/Cache.php b/includes/Cache.php index 7765583..1069514 100644 --- a/includes/Cache.php +++ b/includes/Cache.php @@ -6,10 +6,10 @@ class Cache { static protected $modelIds; - protected $ClassMap; + protected $classMap; public function __construct() { - $this->ClassMap = array( 'true' => 1, 'false' => 0, + $this->classMap = array( 'true' => 1, 'false' => 0, 'B' => 0, 'C' => 1, 'FA' => 2, 'GA' => 3, 'Start' => 4, 'Stub' => 5 ); } @@ -41,7 +41,7 @@ $modelId = $this->getModelId( $model ); foreach ( $modelOutputs['probability'] as $class => $probability ) { $ores_is_predicted = $prediction === $class; - $class = $this->ClassMap[$class]; + $class = $this->classMap[$class]; if ( $class === 0 ) { continue; } @@ -56,7 +56,7 @@ } } - \wfGetDB( DB_MASTER )->insert( 'ores_classification', $dbData, __METHOD__ ); + wfGetDB( DB_MASTER )->insert( 'ores_classification', $dbData, __METHOD__ ); } /** @@ -72,8 +72,8 @@ * Note that this function runs multiple batches, until all records are deleted. */ public function purge( $model, $isEverything, $batchSize = 1000 ) { - $dbr = \wfGetDB( DB_SLAVE ); - $dbw = \wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_SLAVE ); + $dbw = wfGetDB( DB_MASTER ); $join_conds = array( 'ores_model' => array( 'LEFT JOIN', 'oresm_id = oresc_model' ) ); @@ -112,7 +112,7 @@ return self::$modelIds[$model]; } - $modelId = \wfGetDB( DB_SLAVE )->selectField( 'ores_model', + $modelId = wfGetDB( DB_SLAVE )->selectField( 'ores_model', 'oresm_id', array( 'oresm_name' => $model, 'oresm_is_current' => 1 ), __METHOD__ @@ -126,7 +126,7 @@ } public function getModels() { - $models = \wfGetDB( DB_SLAVE )->selectFieldValues( 'ores_model', + $models = wfGetDB( DB_SLAVE )->selectFieldValues( 'ores_model', 'oresm_name', array(), __METHOD__ diff --git a/includes/Hooks.php b/includes/Hooks.php index b2d88f5..ce2ad79 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -111,7 +111,7 @@ // Filter out non-damaging edits. $conds[] = 'ores_is_predicted = 1'; $conds[] = 'ores_probability > ' - . \wfGetDB( DB_SLAVE )->addQuotes( $threshold ); + . wfGetDB( DB_SLAVE )->addQuotes( $threshold ); } return true; -- To view, visit https://gerrit.wikimedia.org/r/269663 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibb95480043a79928991ccdc7731a6f2bd8bcded6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ORES Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused imports - change (mediawiki...ORES)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269662 Change subject: Remove unused imports .. Remove unused imports Change-Id: I4234c1edb0c0ec5a82d2384106b61e6ed857634a --- M includes/Api.php M includes/FetchScoreJob.php M includes/Hooks.php 3 files changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES refs/changes/62/269662/1 diff --git a/includes/Api.php b/includes/Api.php index c4ebf38..f4ca69f 100644 --- a/includes/Api.php +++ b/includes/Api.php @@ -5,7 +5,6 @@ use FormatJson; use MediaWiki\Logger\LoggerFactory; use MWHttpRequest; -use Psr\Log\LoggerInterface; use RuntimeException; /** diff --git a/includes/FetchScoreJob.php b/includes/FetchScoreJob.php index ebd7b5a..30f31d1 100644 --- a/includes/FetchScoreJob.php +++ b/includes/FetchScoreJob.php @@ -4,7 +4,6 @@ use Job; use MediaWiki\Logger\LoggerFactory; -use Psr\Log\LoggerInterface; use Title; class FetchScoreJob extends Job { diff --git a/includes/Hooks.php b/includes/Hooks.php index 3b13097..b2d88f5 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -8,7 +8,6 @@ use DatabaseUpdater; use EnhancedChangesList; use FormOptions; -use Html; use JobQueueGroup; use MediaWiki\Logger\LoggerFactory; use OutputPage; -- To view, visit https://gerrit.wikimedia.org/r/269662 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4234c1edb0c0ec5a82d2384106b61e6ed857634a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ORES Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add label search field for Elastic [WIP] - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269633 Change subject: Add label search field for Elastic [WIP] .. Add label search field for Elastic [WIP] Change-Id: Ie1b28315a4285014ca324e01df3fd0a0da43fa72 --- A repo/includes/Search/Elastic/Fields/LabelField.php 1 file changed, 87 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/33/269633/1 diff --git a/repo/includes/Search/Elastic/Fields/LabelField.php b/repo/includes/Search/Elastic/Fields/LabelField.php new file mode 100644 index 000..043aef8 --- /dev/null +++ b/repo/includes/Search/Elastic/Fields/LabelField.php @@ -0,0 +1,87 @@ + + */ +class LabelField implements SearchIndexField { + + /** +* @var string[] +*/ + private $languageCodes; + + /** +* @param string[] $languageCodes +*/ + public function __construct( array $languageCodes ) { + $this->languageCodes = $languageCodes; + } + + /** +* @return array +*/ + public function getMapping() { + return array( + 'type' => 'nested', + 'properties' => $this->getTermFieldProperties() + ); + } + + /** +* @param EntityDocument $entity +* +* @return array +*/ + public function getFieldData( EntityDocument $entity ) { + $terms = $entity->getFingerprint(); + + return $this->buildTermsData( $terms->getLabels() ); + } + + /** +* @return string +*/ + protected function getPrefix() { + return 'label'; + } + + /** +* @return array +*/ + protected function getTermFieldProperties() { + $prefix = $this->getPrefix(); + $fields = array(); + + foreach ( $this->languageCodes as $languageCode ) { + $fields[$prefix . '_' . $languageCode] = array( + 'type' => 'string' + ); + } + + return $fields; + } + + /** +* @param TermList $terms +* +* @return array +*/ + protected function buildTermsData( TermList $terms ) { + $prefix = $this->getPrefix(); + $termsArray = array(); + + foreach ( $terms->toTextArray() as $languageCode => $term ) { + $termsArray[$prefix . '_' . $languageCode] = $term; + } + + return $termsArray; + } + +} -- To view, visit https://gerrit.wikimedia.org/r/269633 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1b28315a4285014ca324e01df3fd0a0da43fa72 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make some public member variables private - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269623 Change subject: Make some public member variables private .. Make some public member variables private Change-Id: I46e8aff1496cdbc929c7fa9e5502a44a4c3b9fbc --- M lib/includes/LanguageFallbackChainFactory.php M lib/tests/phpunit/formatters/AutoCommentFormatterTest.php M lib/tests/phpunit/store/CachingPropertyInfoStoreTest.php M lib/tests/phpunit/store/MockPropertyInfoStoreTest.php M lib/tests/phpunit/store/Sql/PropertyInfoTableTest.php M repo/tests/phpunit/includes/ChangePrunerTest.php 6 files changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/23/269623/1 diff --git a/lib/includes/LanguageFallbackChainFactory.php b/lib/includes/LanguageFallbackChainFactory.php index 5f1bae2..b97c090 100644 --- a/lib/includes/LanguageFallbackChainFactory.php +++ b/lib/includes/LanguageFallbackChainFactory.php @@ -42,17 +42,17 @@ /** * @var array[] */ - public $languageCache; + private $languageCache; /** * @var array[] */ - public $userLanguageCache; + private $userLanguageCache; /** * @var bool */ - public $anonymousPageViewCached; + private $anonymousPageViewCached; /** * @param bool $anonymousPageViewCached Whether full page outputs are cached for anons, so some diff --git a/lib/tests/phpunit/formatters/AutoCommentFormatterTest.php b/lib/tests/phpunit/formatters/AutoCommentFormatterTest.php index eb4dc25..779976f 100644 --- a/lib/tests/phpunit/formatters/AutoCommentFormatterTest.php +++ b/lib/tests/phpunit/formatters/AutoCommentFormatterTest.php @@ -20,7 +20,7 @@ /** * @var Language */ - public $language; + private $language; /** * @var string LEFT-TO-RIGHT MARK, commonly abbreviated LRM from Language.php diff --git a/lib/tests/phpunit/store/CachingPropertyInfoStoreTest.php b/lib/tests/phpunit/store/CachingPropertyInfoStoreTest.php index 414cca3..5264963 100644 --- a/lib/tests/phpunit/store/CachingPropertyInfoStoreTest.php +++ b/lib/tests/phpunit/store/CachingPropertyInfoStoreTest.php @@ -23,7 +23,7 @@ /** * @var PropertyInfoStoreTestHelper */ - public $helper; + private $helper; public function __construct( $name = null, $data = array(), $dataName = '' ) { parent::__construct( $name, $data, $dataName ); diff --git a/lib/tests/phpunit/store/MockPropertyInfoStoreTest.php b/lib/tests/phpunit/store/MockPropertyInfoStoreTest.php index 1a4d1b7..da2db84 100644 --- a/lib/tests/phpunit/store/MockPropertyInfoStoreTest.php +++ b/lib/tests/phpunit/store/MockPropertyInfoStoreTest.php @@ -22,7 +22,7 @@ /** * @var PropertyInfoStoreTestHelper */ - public $helper; + private $helper; public function __construct( $name = null, $data = array(), $dataName = '' ) { parent::__construct( $name, $data, $dataName ); diff --git a/lib/tests/phpunit/store/Sql/PropertyInfoTableTest.php b/lib/tests/phpunit/store/Sql/PropertyInfoTableTest.php index 223dd8f..7585a23 100644 --- a/lib/tests/phpunit/store/Sql/PropertyInfoTableTest.php +++ b/lib/tests/phpunit/store/Sql/PropertyInfoTableTest.php @@ -23,7 +23,7 @@ /** * @var PropertyInfoStoreTestHelper */ - public $helper; + private $helper; public function __construct( $name = null, $data = array(), $dataName = '' ) { parent::__construct( $name, $data, $dataName ); diff --git a/repo/tests/phpunit/includes/ChangePrunerTest.php b/repo/tests/phpunit/includes/ChangePrunerTest.php index 455a2f2..1b81652 100644 --- a/repo/tests/phpunit/includes/ChangePrunerTest.php +++ b/repo/tests/phpunit/includes/ChangePrunerTest.php @@ -21,7 +21,7 @@ */ class ChangePrunerTest extends MediaWikiTestCase { - public $messages = array(); + private $messages = array(); public function testConstructorWithInvalidBatchSize() { $this->setExpectedException( 'InvalidArgumentException' ); -- To view, visit https://gerrit.wikimedia.org/r/269623 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I46e8aff1496cdbc929c7fa9e5502a44a4c3b9fbc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use $this for private, non-static Searcher methods - change (mediawiki...CirrusSearch)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269446 Change subject: Use $this for private, non-static Searcher methods .. Use $this for private, non-static Searcher methods instead of using self:: Change-Id: I50eaea87ca3579137dc44adac235eaf306b365a5 --- M includes/Searcher.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch refs/changes/46/269446/1 diff --git a/includes/Searcher.php b/includes/Searcher.php index 966d25d..c80d725 100644 --- a/includes/Searcher.php +++ b/includes/Searcher.php @@ -275,7 +275,7 @@ * @return Status status containing results defined by resultsType on success */ public function nearMatchTitleSearch( $search ) { - self::checkTitleSearchRequestLength( $search ); + $this->checkTitleSearchRequestLength( $search ); // Elasticsearch seems to have trouble extracting the proper terms to highlight // from the default query we make so we feed it exactly the right query to highlight. @@ -304,7 +304,7 @@ * @return Status status containing results defined by resultsType on success */ public function prefixSearch( $search ) { - self::checkTitleSearchRequestLength( $search ); + $this->checkTitleSearchRequestLength( $search ); if ( $search ) { if ( $this->config->get( 'CirrusSearchPrefixSearchStartsWithAnyWord' ) ) { @@ -351,7 +351,7 @@ * @return Status status containing results defined by resultsType on success */ public function searchText( $term, $showSuggestion ) { - $checkLengthStatus = self::checkTextSearchRequestLength( $term ); + $checkLengthStatus = $this->checkTextSearchRequestLength( $term ); if ( !$checkLengthStatus->isOk() ) { return $checkLengthStatus; } -- To view, visit https://gerrit.wikimedia.org/r/269446 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I50eaea87ca3579137dc44adac235eaf306b365a5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix fatal error in updateSearchIndex.php script - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269407 Change subject: Fix fatal error in updateSearchIndex.php script .. Fix fatal error in updateSearchIndex.php script setDescription does not exist as a method, but there is addDescription. Change-Id: Ifeb89d7b59a21c3028350837924963134081cd36 --- M maintenance/updateSearchIndex.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/07/269407/1 diff --git a/maintenance/updateSearchIndex.php b/maintenance/updateSearchIndex.php index b2f2577..756de27 100644 --- a/maintenance/updateSearchIndex.php +++ b/maintenance/updateSearchIndex.php @@ -39,7 +39,7 @@ public function __construct() { parent::__construct(); - $this->setDescription( 'Script for periodic off-peak updating of the search index' ); + $this->addDescription( 'Script for periodic off-peak updating of the search index' ); $this->addOption( 's', 'starting timestamp', false, true ); $this->addOption( 'e', 'Ending timestamp', false, true ); $this->addOption( -- To view, visit https://gerrit.wikimedia.org/r/269407 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifeb89d7b59a21c3028350837924963134081cd36 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move rcShowChangedSize up to constructor in EnhancedChangesList - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269116 Change subject: Move rcShowChangedSize up to constructor in EnhancedChangesList .. Move rcShowChangedSize up to constructor in EnhancedChangesList Instead of obtaining it from config in multiple places in the class. Change-Id: If9d9f3360140e7103a16aee251a49b88288969b9 --- M includes/changes/EnhancedChangesList.php 1 file changed, 12 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/16/269116/1 diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php index 1c49545..1a1b0d0 100644 --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@ -33,6 +33,11 @@ protected $rc_cache; /** +* @var bool +*/ + private $rcShowChangedSize; + + /** * @param IContextSource|Skin $obj * @throws MWException */ @@ -56,6 +61,8 @@ $context, $this->message ); + + $this->rcShowChangedSize = $this->getConfig()->get( 'RCShowChangedSize' ); } /** @@ -185,7 +192,7 @@ # Some catalyst variables... $namehidden = true; $allLogs = true; - $RCShowChangedSize = $this->getConfig()->get( 'RCShowChangedSize' ); + $collectedRcFlags = array( // All are by bots? 'bot' => true, @@ -196,6 +203,7 @@ // Contains an unpatrolled edit? 'unpatrolled' => false, ); + foreach ( $block as $rcObj ) { if ( $rcObj->mAttribs['rc_type'] == RC_NEW ) { $collectedRcFlags['newpage'] = true; @@ -284,7 +292,7 @@ # Character difference (does not apply if only log items) $charDifference = false; - if ( $RCShowChangedSize && !$allLogs ) { + if ( $this->rcShowChangedSize === true && !$allLogs ) { $last = 0; $first = count( $block ) - 1; # Some events (like logs) have an "empty" size, so we need to skip those... @@ -336,8 +344,6 @@ * @throws MWException */ protected function getLineData( array $block, RCCacheEntry $rcObj, array $queryParams = array() ) { - $RCShowChangedSize = $this->getConfig()->get( 'RCShowChangedSize' ); - # Classes to apply -- TODO implement $classes = array(); $type = $rcObj->mAttribs['rc_type']; @@ -395,7 +401,7 @@ $data['separatorAfterCurrentAndLastLinks'] = $separator; # Character diff - if ( $RCShowChangedSize ) { + if ( $this->rcShowChangedSize === true ) { $cd = $this->formatCharacterDifference( $rcObj ); if ( $cd !== '' ) { $data['characterDiff'] = $cd; @@ -610,7 +616,7 @@ $data['separatorAfterLinks'] = ' . . '; # Character diff - if ( $this->getConfig()->get( 'RCShowChangedSize' ) ) { + if ( $this->rcShowChangedSize === true ) { $cd = $this->formatCharacterDifference( $rcObj ); if ( $cd !== '' ) { $data['characterDiff'] = $cd; -- To view, visit https://gerrit.wikimedia.org/r/269116 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If9d9f3360140e7103a16aee251a49b88288969b9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aude Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Enable ArticlePlaceholder on test wikis - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269399 Change subject: Enable ArticlePlaceholder on test wikis .. Enable ArticlePlaceholder on test wikis This enables ArticlePlaceholder on test.wikipedia, test2.wikipedia and test.wikidata. Bug: T125901 Change-Id: I0756764c6f10387f677a1f8358ceac88792493c9 --- M wmf-config/InitialiseSettings.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/99/269399/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 9110841..18f3aca 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -15544,6 +15544,9 @@ 'wmgUseArticlePlaceholder' => array( 'default' => false, + 'testwiki' => true, + 'test2wiki' => true, + 'testwikidatawiki' => true, ), 'wmgWikibaseSiteGroup' => array( -- To view, visit https://gerrit.wikimedia.org/r/269399 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0756764c6f10387f677a1f8358ceac88792493c9 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Enable math data type on Wikidata and everywhere - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269398 Change subject: Enable math data type on Wikidata and everywhere .. Enable math data type on Wikidata and everywhere Bug: T124931 Change-Id: I350eda24631a28e89d22e985bfd513a772b4de8e --- M wmf-config/InitialiseSettings-labs.php M wmf-config/InitialiseSettings.php 2 files changed, 0 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/98/269398/1 diff --git a/wmf-config/InitialiseSettings-labs.php b/wmf-config/InitialiseSettings-labs.php index 1bd0e9f..8dac9f6 100644 --- a/wmf-config/InitialiseSettings-labs.php +++ b/wmf-config/InitialiseSettings-labs.php @@ -581,10 +581,6 @@ 'private' => false, ), - 'wgMathEnableWikibaseDataType' => array( - 'default' => true, - ), - 'wmgUseArticlePlaceholder' => array( 'default' => false, 'wikidataclient' => true, diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 9110841..2cef434 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -15520,13 +15520,6 @@ 'wikidatawiki' => 500, ), -'wgMathEnableWikibaseDataType' => array( - 'default' => false, - 'testwikidatawiki' => true, - 'test2wiki' => true, - 'testwiki' => true, -), - 'wmgUseWikibaseRepo' => array( 'default' => false, 'wikidata' => true, -- To view, visit https://gerrit.wikimedia.org/r/269398 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I350eda24631a28e89d22e985bfd513a772b4de8e Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] New deployment build: wmf/1.27.0-wmf.13 - change (mediawiki...Wikidata)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269396 Change subject: New deployment build: wmf/1.27.0-wmf.13 .. New deployment build: wmf/1.27.0-wmf.13 adds ArticlePlaceholder, which we want to enable on the test wikis. Change-Id: Ia6cc31c92f6d044c9cccfaf9ec3a3f9805bf2e2e --- M composer.json M composer.lock A extensions/ArticlePlaceholder/.gitignore A extensions/ArticlePlaceholder/.gitreview A extensions/ArticlePlaceholder/.jscsrc A extensions/ArticlePlaceholder/.jshintignore A extensions/ArticlePlaceholder/.jshintrc A extensions/ArticlePlaceholder/ArticlePlaceholder.alias.php A extensions/ArticlePlaceholder/ArticlePlaceholder.php A extensions/ArticlePlaceholder/Gruntfile.js A extensions/ArticlePlaceholder/Specials/SpecialAboutTopic.php A extensions/ArticlePlaceholder/composer.json A extensions/ArticlePlaceholder/i18n/ast.json A extensions/ArticlePlaceholder/i18n/cs.json A extensions/ArticlePlaceholder/i18n/de.json A extensions/ArticlePlaceholder/i18n/en.json A extensions/ArticlePlaceholder/i18n/eo.json A extensions/ArticlePlaceholder/i18n/es.json A extensions/ArticlePlaceholder/i18n/eu.json A extensions/ArticlePlaceholder/i18n/fr.json A extensions/ArticlePlaceholder/i18n/gl.json A extensions/ArticlePlaceholder/i18n/it.json A extensions/ArticlePlaceholder/i18n/ja.json A extensions/ArticlePlaceholder/i18n/jv.json A extensions/ArticlePlaceholder/i18n/ko.json A extensions/ArticlePlaceholder/i18n/ksh.json A extensions/ArticlePlaceholder/i18n/ku-latn.json A extensions/ArticlePlaceholder/i18n/lb.json A extensions/ArticlePlaceholder/i18n/lt.json A extensions/ArticlePlaceholder/i18n/mk.json A extensions/ArticlePlaceholder/i18n/mr.json A extensions/ArticlePlaceholder/i18n/ms.json A extensions/ArticlePlaceholder/i18n/oc.json A extensions/ArticlePlaceholder/i18n/om.json A extensions/ArticlePlaceholder/i18n/pl.json A extensions/ArticlePlaceholder/i18n/ps.json A extensions/ArticlePlaceholder/i18n/qqq.json A extensions/ArticlePlaceholder/i18n/ru.json A extensions/ArticlePlaceholder/i18n/sd.json A extensions/ArticlePlaceholder/i18n/sr-ec.json A extensions/ArticlePlaceholder/i18n/sr-el.json A extensions/ArticlePlaceholder/i18n/su.json A extensions/ArticlePlaceholder/i18n/sv.json A extensions/ArticlePlaceholder/i18n/tr.json A extensions/ArticlePlaceholder/i18n/tt-cyrl.json A extensions/ArticlePlaceholder/i18n/yi.json A extensions/ArticlePlaceholder/i18n/zh-hans.json A extensions/ArticlePlaceholder/i18n/zh-hant.json A extensions/ArticlePlaceholder/includes/Hooks.php A extensions/ArticlePlaceholder/includes/Lua/Identifier.lua A extensions/ArticlePlaceholder/includes/Lua/Scribunto_LuaArticlePlaceholderLibrary.php A extensions/ArticlePlaceholder/includes/Lua/mw.ext.articlePlaceholder.entityRenderer.lua A extensions/ArticlePlaceholder/includes/SearchHookHandler.php A extensions/ArticlePlaceholder/includes/Template/aboutTopic-template-module.xml A extensions/ArticlePlaceholder/modules/ext.articleplaceholder.createArticle.js A extensions/ArticlePlaceholder/modules/ext.articleplaceholder.defaultDisplay.css A extensions/ArticlePlaceholder/modules/ext.articleplaceholder.defaultDisplaySmall.css A extensions/ArticlePlaceholder/package.json A extensions/ArticlePlaceholder/phpcs.xml A extensions/ArticlePlaceholder/tests/phpunit/Specials/SpecialAboutTopicTest.php A extensions/ArticlePlaceholder/tests/phpunit/includes/HooksTest.php A extensions/ArticlePlaceholder/tests/phpunit/includes/SearchHookHandlerTest.php M vendor/composer/installed.json 63 files changed, 2,346 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata refs/changes/96/269396/1 diff --git a/composer.json b/composer.json index 56225ec..4b6f089 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,7 @@ ], "require": { "php": ">=5.3.0", +"mediawiki/article-placeholder": "dev-master", "propertysuggester/property-suggester": "~2.4.2", "wikibase/wikibase": "dev-wmf/1.27.0-wmf.12", "wikibase/wikimedia-badges": "dev-master", @@ -53,4 +54,4 @@ "classmap-authoritative": true, "preferred-install": "dist" } -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index 2b74ad9..396150c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file";, "This file is @generated automatically" ], -"hash": "79f06d4a6277edaa1ec67ee83b6f4e0d", -"content-hash": "eb15b534279575172797aeb34570b551", +"hash": "5c3a1d30068cbc37c03c3fa26784fdbf", +"content-hash": "6ef12e3509d6635a2efc6f8578b7dd4b", "packages": [ { "name": "composer/installers", @@ -773,6 +773,38 @@ "time": "2015-03-17 15:21:21" }, { +"name": "mediawiki/article-placehol
[MediaWiki-commits] [Gerrit] Introduce $wgMFSearchUseDisplayTitle - change (mediawiki...MobileFrontend)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/269258 Change subject: Introduce $wgMFSearchUseDisplayTitle .. Introduce $wgMFSearchUseDisplayTitle For multilingual wikis like Wikidata, display title is undesirable since it is set in one language only. (e.g. on Wikidata, people viewing Special:Nearby in may see the display title (e.g. "No label defined (Q4497296)") even if their language is set to something other than English.) In I736a8e3, we tried setting Wikidata's setting to something different that omits requesting pageprops. However, for array-based settings, extension registration applies array_merge to combine what is set in LocalSettings.php with the default. This works for adding to the default or replacing part of the default array, but not to unset part of the default array. Extension registration supports something called attributes (used in VisualEditor to register additional modules), but that does array_merge_recursive and I don't think would work for this. With this change, use of display title in search is separated out into another setting and prop module pageprops and ppprop => displaytitle are added if the setting is set to true. (the default) Bug: T120197 Change-Id: I4f71d116b74866027252be5a380b6d9df59b03bf --- M extension.json M includes/MobileFrontend.hooks.php 2 files changed, 17 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/58/269258/3 diff --git a/extension.json b/extension.json index 7315c12..734fbe5 100644 --- a/extension.json +++ b/extension.json @@ -1988,12 +1988,9 @@ "MFNearbyRange": 1, "MFNearby": false, "MFNearbyEndpoint": "", - "MFSearchAPIParams": { - "ppprop": "displaytitle" - }, - "MFQueryPropModules": [ - "pageprops" - ], + "MFSearchUseDisplayTitle": true, + "MFSearchAPIParams": [], + "MFQueryPropModules": [], "MFSearchGenerator": { "name": "prefixsearch", "prefix": "ps" diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index 812fd21..18dedb8 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -360,11 +360,20 @@ $context = MobileContext::singleton(); $config = $context->getMFConfig(); - $pageProps = $config->get( 'MFQueryPropModules' ); + $propModules = $config->get( 'MFQueryPropModules' ); $searchParams = $config->get( 'MFSearchAPIParams' ); + + if ( $config->get( 'MFSearchUseDisplayTitle' ) === true ) { + if ( !in_array( 'pageprops', $propModules ) ) { + $propModules[] = 'pageprops'; + } + + $searchParams['ppprop'][] = 'displaytitle'; + } + // Avoid API warnings and allow integration with optional extensions. if ( defined( 'PAGE_IMAGES_INSTALLED' ) ) { - $pageProps[] = 'pageimages'; + $propModules[] = 'pageimages'; $searchParams = array_merge_recursive( $searchParams, array( 'piprop' => 'thumbnail', 'pithumbsize' => MobilePage::SMALL_IMAGE_WIDTH, @@ -385,8 +394,8 @@ // When set turn on Wikidata descriptions // https://phabricator.wikimedia.org/T101719 if ( $useDescriptions && $displayDescriptions ) { - if ( !in_array( 'pageterms', $pageProps ) ) { - $pageProps[] = 'pageterms'; + if ( !in_array( 'pageterms', $propModules ) ) { + $propModules[] = 'pageterms'; } $searchParams = array_merge_recursive( $searchParams, array( 'wbptterms' => 'description', @@ -397,7 +406,7 @@ $wgMFUploadLicense = MobileFrontendSkinHooks::getLicense( 'upload' ); $vars += array( 'wgMFSearchAPIParams' => $searchParams, - 'wgMFQueryPropModules' => $pageProps, + 'wgMFQueryPropModules' => $propModules, 'wgMFSearchGenerator' => $config->get( 'MFSearchGenerator' ), 'wgMFNearbyEndpoint' => $config->get( 'MFNearbyEndpoint' ), 'wgMFThumbnailSizes' => array( -- To view, visit https://gerrit.wikimedia.org/r/269258 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f71d116b
[MediaWiki-commits] [Gerrit] Add wbc_entity_usage table if wiki is in wikidataclient.dblist - change (mediawiki...WikimediaMaintenance)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268710 Change subject: Add wbc_entity_usage table if wiki is in wikidataclient.dblist .. Add wbc_entity_usage table if wiki is in wikidataclient.dblist Checking wikidataclient.dblist is probably more reliable way of determining if a wiki should have wbc_entity_usage added. Bug: T122512 Change-Id: I8fced5b30ab61720eeb30b10cc7511afe8055bab --- M addWiki.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance refs/changes/10/268710/1 diff --git a/addWiki.php b/addWiki.php index 7dc3966..380ab32 100644 --- a/addWiki.php +++ b/addWiki.php @@ -128,7 +128,7 @@ break; } - if ( $site !== 'wikimedia' ) { + if ( in_array( $dbName, MWWikiversions::readDbListFile( 'wikidataclient' ) ) { $dbw->sourceFile( "$IP/extensions/Wikidata/extensions/Wikibase/client/sql/entity_usage.sql" ); } -- To view, visit https://gerrit.wikimedia.org/r/268710 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8fced5b30ab61720eeb30b10cc7511afe8055bab Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMaintenance Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Invalidate PropertyInfoStore when rebuilding PropertyInfoTable - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268690 Change subject: Invalidate PropertyInfoStore when rebuilding PropertyInfoTable .. Invalidate PropertyInfoStore when rebuilding PropertyInfoTable when changing a property's data type, this allows the property info cache to be invalidated and the changes be reflected more immediately in places like wbgetentities. Bug: T125996 Change-Id: I517fe40ba812fa75de12a6be5b86d74561d55157 --- M repo/includes/store/sql/DatabaseSchemaUpdater.php M repo/includes/store/sql/PropertyInfoTableBuilder.php M repo/maintenance/rebuildPropertyInfo.php M repo/tests/phpunit/includes/store/sql/PropertyInfoTableBuilderTest.php 4 files changed, 31 insertions(+), 24 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/90/268690/1 diff --git a/repo/includes/store/sql/DatabaseSchemaUpdater.php b/repo/includes/store/sql/DatabaseSchemaUpdater.php index 7bc632c..fdc6fa9 100644 --- a/repo/includes/store/sql/DatabaseSchemaUpdater.php +++ b/repo/includes/store/sql/DatabaseSchemaUpdater.php @@ -4,16 +4,11 @@ use DatabaseBase; use DatabaseUpdater; -use HashBagOStuff; use MWException; use Wikibase\Store; use Wikibase\PropertyInfoTable; use Wikibase\PropertyInfoTableBuilder; use Wikibase\Lib\Reporting\ObservableMessageReporter; -use Wikibase\Lib\Store\CachingEntityRevisionLookup; -use Wikibase\Lib\Store\RevisionBasedEntityLookup; -use Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup; -use Wikibase\Lib\Store\WikiPageEntityRevisionLookup; use Wikibase\Repo\WikibaseRepo; /** @@ -190,22 +185,15 @@ } ); - $table = new PropertyInfoTable( false ); $wikibaseRepo = WikibaseRepo::getDefaultInstance(); - $contentCodec = $wikibaseRepo->getEntityContentDataCodec(); - $propertyInfoBuilder = $wikibaseRepo->newPropertyInfoBuilder(); - - $wikiPageEntityLookup = new WikiPageEntityRevisionLookup( - $contentCodec, - new WikiPageEntityMetaDataLookup( $wikibaseRepo->getEntityIdParser() ), - false + $builder = new PropertyInfoTableBuilder( + new PropertyInfoTable( false ), + $wikibaseRepo->getEntityLookup(), + $wikibaseRepo->getPropertyInfoBuilder(), + $wikibaseRepo->getStore()->getPropertyInfoStore() ); - $cachingEntityLookup = new CachingEntityRevisionLookup( $wikiPageEntityLookup, new HashBagOStuff() ); - $entityLookup = new RevisionBasedEntityLookup( $cachingEntityLookup ); - - $builder = new PropertyInfoTableBuilder( $table, $entityLookup, $propertyInfoBuilder ); $builder->setReporter( $reporter ); $builder->setUseTransactions( false ); diff --git a/repo/includes/store/sql/PropertyInfoTableBuilder.php b/repo/includes/store/sql/PropertyInfoTableBuilder.php index cf623e2..b07af5c 100644 --- a/repo/includes/store/sql/PropertyInfoTableBuilder.php +++ b/repo/includes/store/sql/PropertyInfoTableBuilder.php @@ -7,6 +7,7 @@ use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\Lib\Reporting\MessageReporter; +use Wikibase\PropertyInfoStore; /** * Utility class for rebuilding the wb_property_info table. @@ -32,6 +33,11 @@ * @var PropertyInfoBuilder */ private $propertyInfoBuilder; + + /** +* @var PropertyInfoStore +*/ + private $propertyInfoStore; /** * @var MessageReporter|null @@ -68,15 +74,18 @@ * @param PropertyInfoTable $propertyInfoTable * @param EntityLookup $entityLookup * @param PropertyInfoBuilder $propertyInfoBuilder +* @param PropertyInfoStore $propertyInfoStore */ public function __construct( PropertyInfoTable $propertyInfoTable, EntityLookup $entityLookup, - PropertyInfoBuilder $propertyInfoBuilder + PropertyInfoBuilder $propertyInfoBuilder, + PropertyInfoStore $propertyInfoStore ) { $this->propertyInfoTable = $propertyInfoTable; $this->entityLookup = $entityLookup; $this->propertyInfoBuilder = $propertyInfoBuilder; + $this->propertyInfoStore = $propertyInfoStore; } /** @@ -254,7 +263,8 @@ $info = $this->propertyInfoBuilder->buildPropertyInfo( $property ); - $this->propertyInfoTable->setPropertyInfo( + // update PropertyInfoStore, which might have caching that needs invalidation. + $this->propertyInfoStore->setPropertyInfo( $property->get
[MediaWiki-commits] [Gerrit] Set $wgArticlePlaceholderImageProperty for beta - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268592 Change subject: Set $wgArticlePlaceholderImageProperty for beta .. Set $wgArticlePlaceholderImageProperty for beta as well, went ahead and set it for test.wikidata and wikidata, though the setting is currently unused there. Change-Id: I828171da4247346b10337672ae4d7e5fcfbdb4a6 --- M wmf-config/Wikibase-labs.php M wmf-config/Wikibase-production.php 2 files changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/92/268592/1 diff --git a/wmf-config/Wikibase-labs.php b/wmf-config/Wikibase-labs.php index e2e425e..1b3c963 100644 --- a/wmf-config/Wikibase-labs.php +++ b/wmf-config/Wikibase-labs.php @@ -43,4 +43,6 @@ $wgWBClientSettings['repoConceptBaseUri'] = 'http://wikidata.beta.wmflabs.org/entity/'; $wgWikimediaBadgesCommonsCategoryProperty = 'P725'; + + $wgArticlePlaceholderImageProperty = 'P964'; } diff --git a/wmf-config/Wikibase-production.php b/wmf-config/Wikibase-production.php index 8c5f24a..45046f9 100644 --- a/wmf-config/Wikibase-production.php +++ b/wmf-config/Wikibase-production.php @@ -83,8 +83,11 @@ $wgWBClientSettings['repoDatabase'] = 'testwikidatawiki'; $wgWBClientSettings['repoUrl'] = "//test.wikidata.org"; $wgWBClientSettings['repoConceptBaseUri'] = 'http://test.wikidata.org/entity/'; + + $wgArticlePlaceholderImageProperty = 'P47'; } else { $wgWBClientSettings['disabledDataTypes'] = array( 'external-id' ); + $wgArticlePlaceholderImageProperty = 'P18'; } $wgWBClientSettings['badgeClassNames'] = array( -- To view, visit https://gerrit.wikimedia.org/r/268592 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I828171da4247346b10337672ae4d7e5fcfbdb4a6 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove addToSites.php script - change (mediawiki...WikimediaMaintenance)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268586 Change subject: Remove addToSites.php script .. Remove addToSites.php script This was needed at one point but don't think we need it again and it's not maintained. Change-Id: Id31b16b9522a689e9a8fcf2e01925c49dedbc222 --- D addToSites.php 1 file changed, 0 insertions(+), 86 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance refs/changes/86/268586/1 diff --git a/addToSites.php b/addToSites.php deleted file mode 100644 index 83b9277..000 --- a/addToSites.php +++ /dev/null @@ -1,86 +0,0 @@ -mDescription = 'Adds Wikidata to the sites table'; - } - - function execute() { - $siteStore = SiteSQLStore::newInstance(); - - $sites = array(); - - $sites[] = $this->getNewSite( - 'wikidatawiki', 'wikidata', 'en', 'http://www.wikidata.org' - ); - - $sites[] = $this->getNewSite( - 'testwikidatawiki', 'testwikidata', 'en', 'http://test.wikidata.org' - ); - - foreach( $sites as $site ) { - $globalId = $site->getGlobalId(); - $this->clearSiteIfExists( $globalId ); - $siteStore->saveSite( $site ); - - $this->output( "added $globalId to sites table\n" ); - } - - // clear caches - $siteStore->reset(); - - $this->output( "done\n" ); - } - - function clearSiteIfExists( $globalId ) { - $dbw = wfGetDB( DB_MASTER ); - - $site = $dbw->selectRow( - 'sites', - array( 'site_global_key' ), - array( 'site_global_key' => $globalId ), - __METHOD__ - ); - - if ( $site ) { - $dbw->delete( - 'sites', - array( 'site_global_key' => $globalId ), - __METHOD__ - ); - - $this->output( "cleared $globalId from sites table\n" ); - } - } - - function getNewSite( $globalId, $group, $langCode, $baseUrl ) { - $site = MediaWikiSite::newFromGlobalId( $globalId ); - $site->setGroup( $group ); - $site->setLanguageCode( $langCode ); - - $extra = array( 'paths' => - array( - 'file_path' => "$baseUrl/w/$1", - 'page_path' => "$baseUrl/wiki/$1" - ) - ); - - $site->setExtraData( $extra ); - - return $site; - } - -} - -$maintClass = 'AddToSites'; -require_once RUN_MAINTENANCE_IF_MAIN; -- To view, visit https://gerrit.wikimedia.org/r/268586 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id31b16b9522a689e9a8fcf2e01925c49dedbc222 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMaintenance Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add path argument to runChild for populateSitesTable - change (mediawiki...WikimediaMaintenance)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268585 Change subject: Add path argument to runChild for populateSitesTable .. Add path argument to runChild for populateSitesTable might not be super elegant but runChild supports this and think it works. tried it out with https://phabricator.wikimedia.org/P2571 Bug: T122513 Change-Id: I3affd6b0a8bc0820743de1d7537e9040fdf6fdca --- M addWiki.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance refs/changes/85/268585/1 diff --git a/addWiki.php b/addWiki.php index a639bef..7dc3966 100644 --- a/addWiki.php +++ b/addWiki.php @@ -195,7 +195,11 @@ $searchIndex->execute(); # Populate sites table - $sitesPopulation = $this->runChild( 'Wikibase\PopulateSitesTable' ); + $sitesPopulation = $this->runChild( + 'Wikibase\PopulateSitesTable', + __DIR__ . '/../Wikidata/extensions/Wikibase/lib/maintenance/populateSitesTable.php' + ); + $sitesPopulation->mOptions[ 'site-group' ] = $site; $sitesPopulation->mOptions[ 'force-protocol' ] = 'https'; $sitesPopulation->execute(); -- To view, visit https://gerrit.wikimedia.org/r/268585 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3affd6b0a8bc0820743de1d7537e9040fdf6fdca Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMaintenance Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove WB_EXPERIMENTAL_FEATURES (was labs only) setting - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268472 Change subject: Remove WB_EXPERIMENTAL_FEATURES (was labs only) setting .. Remove WB_EXPERIMENTAL_FEATURES (was labs only) setting This is no longer used or exists in Wikibase and is not needed in our settings. Change-Id: Ia4f7bd0e01d97fe062aa0ef888de370f7d7a3a95 --- M wmf-config/Wikibase.php 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/72/268472/1 diff --git a/wmf-config/Wikibase.php b/wmf-config/Wikibase.php index 990e2c4..dfa901e 100644 --- a/wmf-config/Wikibase.php +++ b/wmf-config/Wikibase.php @@ -1,9 +1,5 @@ https://gerrit.wikimedia.org/r/268472 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia4f7bd0e01d97fe062aa0ef888de370f7d7a3a95 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Enable ArticlePlaceholder extension in beta only - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268471 Change subject: Enable ArticlePlaceholder extension in beta only .. Enable ArticlePlaceholder extension in beta only Security review is complete (T118268) and now we are ready to enable this on beta. The extension is loaded in the Wikidata.php entry point (Ic71af2a) only if $wmgUseArticlePlaceholder is set and is true. Change-Id: Idee71838836904703e975e4f742a61d8c6b88a33 --- M wmf-config/InitialiseSettings-labs.php M wmf-config/InitialiseSettings.php 2 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/71/268471/1 diff --git a/wmf-config/InitialiseSettings-labs.php b/wmf-config/InitialiseSettings-labs.php index 157a663..0fee96d 100644 --- a/wmf-config/InitialiseSettings-labs.php +++ b/wmf-config/InitialiseSettings-labs.php @@ -578,12 +578,19 @@ 'wmgMediaViewerUseThumbnailGuessing' => array( 'default' => false, # T69651 ), + 'wmgUseUrlShortener' => array( 'default' => true, 'private' => false, ), + 'wgMathEnableWikibaseDataType' => array( 'default' => true, ), + + 'wmgUseArticlePlaceholder' => array( + 'default' => false, + 'wikidataclient' => true, + ), ); } # wmflLabsSettings() diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 64cea71..b34d156 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -15505,6 +15505,10 @@ 'wikidataclient' => true, ), +'wmgUseArticlePlaceholder' => array( + 'default' => false, +), + 'wmgWikibaseSiteGroup' => array( 'wikipedia' => 'wikipedia', 'wikibooks' => 'wikibooks', -- To view, visit https://gerrit.wikimedia.org/r/268471 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idee71838836904703e975e4f742a61d8c6b88a33 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Run npm test for wikidata/build-resources - change (integration/config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268436 Change subject: Run npm test for wikidata/build-resources .. Run npm test for wikidata/build-resources Bug: T125837 Depends-On: Ic436e319222cca6955824ba2a093c49cadc21c68 Change-Id: I7e1a62f586a8353c8e834d9f2df5ad77cbc1cc8f --- M zuul/layout.yaml 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/36/268436/1 diff --git a/zuul/layout.yaml b/zuul/layout.yaml index bade260..9febace 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -7741,8 +7741,10 @@ - mwext-qunit-composer - name: wikidata/build-resources -check-voter: - - noop +template: + - name: npm +check: + - npm gate-and-submit: - - noop + - npm -- To view, visit https://gerrit.wikimedia.org/r/268436 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e1a62f586a8353c8e834d9f2df5ad77cbc1cc8f Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add grunt task for tests [WIP] - change (wikidata/build-resources)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268421 Change subject: Add grunt task for tests [WIP] .. Add grunt task for tests [WIP] Bug: T125837 Change-Id: Ic436e319222cca6955824ba2a093c49cadc21c68 --- M Gruntfile.js M package.json 2 files changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/build-resources refs/changes/21/268421/1 diff --git a/Gruntfile.js b/Gruntfile.js index d3fd93e..6eed8db 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -2,7 +2,16 @@ module.exports = function ( grunt ) { + grunt.loadNpmTasks( 'grunt-contrib-clean' ); + grunt.loadNpmTasks( 'grunt-exec' ); + grunt.loadNpmTasks( 'grunt-jsonlint' ); + grunt.initConfig( { + jsonlint: { + all: [ + '*.json' + ] + }, clean: { build: { src: [ @@ -27,10 +36,9 @@ } } ); - grunt.loadNpmTasks( 'grunt-exec' ); - grunt.loadNpmTasks( 'grunt-contrib-clean' ); grunt.loadTasks( 'build/tasks' ); + grunt.registerTask( 'test', [ 'jsonlint' ] ); grunt.registerTask( 'uninstall', [ 'clean:build' ] ); grunt.registerTask( 'install', [ 'clean:build', 'exec:install' ] ); grunt.registerTask( 'branch', [ 'uninstall', 'updatecomposer', 'exec:install' ] ); diff --git a/package.json b/package.json index d67613b..76e11e4 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,9 @@ }, "devDependencies": { "grunt": "~0.4.5", -"grunt-contrib-clean": "~0.6.0", "grunt-cli": "~0.1.13", -"grunt-exec": "~0.4.6" +"grunt-contrib-clean": "~0.6.0", +"grunt-exec": "~0.4.6", +"grunt-jsonlint": "^1.0.7" } } -- To view, visit https://gerrit.wikimedia.org/r/268421 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic436e319222cca6955824ba2a093c49cadc21c68 Gerrit-PatchSet: 1 Gerrit-Project: wikidata/build-resources Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Unify handling of extension credits - change (wikidata/build-resources)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268397 Change subject: Unify handling of extension credits .. Unify handling of extension credits Change-Id: I36b1955549d00ff57782698d036726253ca701d0 --- A COPYING A Wikidata.credits.php M Wikidata.localisation.php M Wikidata.php 4 files changed, 367 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/build-resources refs/changes/97/268397/1 diff --git a/COPYING b/COPYING new file mode 100644 index 000..7d2552f --- /dev/null +++ b/COPYING @@ -0,0 +1,347 @@ +The license text below "" applies to all files within this distribution, other +than those that are in a directory which contains files named "LICENSE" or +"COPYING", or a subdirectory thereof. For those files, the license text contained in +said file overrides any license information contained in directories of smaller depth. +Alternative licenses are typically used for software that is provided by external +parties, and merely packaged with the Wikibase release for convenience. + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the
[MediaWiki-commits] [Gerrit] Add ArticlePlaceholder to the build - change (wikidata/build-resources)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268396 Change subject: Add ArticlePlaceholder to the build .. Add ArticlePlaceholder to the build PS: I think having this in the build will help to keep it in sync with Wikibase (especially in terms of deployments) when there are breaking changes in Wikibase that affect ArticlePlaceholder. Change-Id: Ic71af2a09428bf281c634ccd255399ddfa63ed2c --- M Wikidata.localisation.php M Wikidata.php M composer.json 3 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/build-resources refs/changes/96/268396/1 diff --git a/Wikidata.localisation.php b/Wikidata.localisation.php index a0ce8b0..c9271c3 100644 --- a/Wikidata.localisation.php +++ b/Wikidata.localisation.php @@ -22,6 +22,7 @@ require_once "$wgWikidataBaseDir/extensions/Wikibase/client/WikibaseClient.php"; require_once "$wgWikidataBaseDir/extensions/Quality/WikibaseQuality.php"; require_once "$wgWikidataBaseDir/extensions/Constraints/WikibaseQualityConstraints.php"; +require_once "$wgWikidataBaseDir/extensions/ArticlePlaceholder/ArticlePlaceholder.php"; $wgExtensionCredits['wikibase'][] = array( 'path' => __DIR__, diff --git a/Wikidata.php b/Wikidata.php index 23597f6..fa0f420 100644 --- a/Wikidata.php +++ b/Wikidata.php @@ -9,6 +9,7 @@ $wmgUseWikibaseClient = true; $wmgUseWikibaseQuality = true; $wmgUseWikibaseQualityExternalValidation = true; + $wmgUseArticlePlaceholder = true; } // no magic, use wmf configs instead to control which entry points to load @@ -46,6 +47,10 @@ if ( !empty( $wmgUseWikibaseClient ) ) { include_once "$wgWikidataBaseDir/extensions/Wikibase/client/WikibaseClient.php"; + + if ( !empty( $wmgUseArticlePlaceholder ) ) { + include_once "$wgWikidataBaseDir/extensions/ArticlePlaceholder/ArticlePlaceholder.php"; + } } if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { diff --git a/composer.json b/composer.json index 6e34412..607a12e 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,7 @@ ], "require": { "php": ">=5.3.0", +"mediawiki/article-placeholder": "dev-master", "propertysuggester/property-suggester": "~2.4.2", "wikibase/wikibase": "dev-master", "wikibase/wikimedia-badges": "dev-master", -- To view, visit https://gerrit.wikimedia.org/r/268396 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic71af2a09428bf281c634ccd255399ddfa63ed2c Gerrit-PatchSet: 1 Gerrit-Project: wikidata/build-resources Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make special page name sentence case - change (mediawiki...ArticlePlaceholder)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268374 Change subject: Make special page name sentence case .. Make special page name sentence case This is consistent with how special pages are generally named. Change-Id: I7fc06a5c3632ef72502626ab447c4cb6961b8ba2 --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder refs/changes/74/268374/1 diff --git a/i18n/en.json b/i18n/en.json index ff5251a..c612e53 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -5,7 +5,7 @@ ] }, "articleplaceholder-desc": "Provides a special page with {{WBREPONAME}} information about a certain topic, with invitation to create an article for the topic", - "articleplaceholder-abouttopic": "About Topic", + "articleplaceholder-abouttopic": "About topic", "articleplaceholder-abouttopic-intro": "This special page generates a content page about a certain topic with {{WBREPONAME}} information", "articleplaceholder-abouttopic-entityid": "Enter an entity id to get an auto-generated article placeholder.", "articleplaceholder-abouttopic-submit": "craft", -- To view, visit https://gerrit.wikimedia.org/r/268374 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7fc06a5c3632ef72502626ab447c4cb6961b8ba2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ArticlePlaceholder Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add getDescription method to special page - change (mediawiki...ArticlePlaceholder)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268373 Change subject: Add getDescription method to special page .. Add getDescription method to special page This is needed in order to correctly display the name of the special page in Special:Specialpages. Change-Id: Ia5666208b702cbac11df0257763b6f09f9360f0e --- M Specials/SpecialAboutTopic.php 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder refs/changes/73/268373/1 diff --git a/Specials/SpecialAboutTopic.php b/Specials/SpecialAboutTopic.php index 4503fc3..109aacc 100644 --- a/Specials/SpecialAboutTopic.php +++ b/Specials/SpecialAboutTopic.php @@ -331,4 +331,13 @@ return null; } + /** +* @see SpecialPage::getDescription +* +* @return string +*/ + public function getDescription() { + return $this->msg( 'articleplaceholder-abouttopic' )->text(); + } + } -- To view, visit https://gerrit.wikimedia.org/r/268373 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia5666208b702cbac11df0257763b6f09f9360f0e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ArticlePlaceholder Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't request pageprops for mobile search/nearby on wikidata - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268208 Change subject: Don't request pageprops for mobile search/nearby on wikidata .. Don't request pageprops for mobile search/nearby on wikidata If we include pageprops but don't specify which ones we want, then we get them all, including displaytitle. afaik, removing for wikidata it is unproblematic. Bug: T120197 Change-Id: I736a8e3361e35c8bfd63ff9880f8cb73afcc20dc --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/08/268208/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 3d9e893..15fa949 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -13585,7 +13585,7 @@ 'wmgMFQueryPropModules' => array( // workaround for T125672 'default' => array( 'pageprops' ), - 'wikidata' => array( 'pageprops', 'pageterms' ), + 'wikidata' => array( 'pageterms' ), ), 'wmgMFSearchAPIParams' => array( // workaround for T125672, though also fixes T120197 -- To view, visit https://gerrit.wikimedia.org/r/268208 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I736a8e3361e35c8bfd63ff9880f8cb73afcc20dc Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Re-enable math data type on beta - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268199 Change subject: Re-enable math data type on beta .. Re-enable math data type on beta Change-Id: I3c34110eada34cf3dcc3278750de30e0002aa266 --- M wmf-config/InitialiseSettings-labs.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/99/268199/1 diff --git a/wmf-config/InitialiseSettings-labs.php b/wmf-config/InitialiseSettings-labs.php index b23f23c..8f1ed43 100644 --- a/wmf-config/InitialiseSettings-labs.php +++ b/wmf-config/InitialiseSettings-labs.php @@ -582,5 +582,8 @@ 'default' => true, 'private' => false, ), + 'wgMathEnableWikibaseDataType' => array( + 'default' => true, + ), ); } # wmflLabsSettings() -- To view, visit https://gerrit.wikimedia.org/r/268199 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3c34110eada34cf3dcc3278750de30e0002aa266 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Put $wgMFQueryPropModules and $wgMFSearchApiModules in Initi... - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268182 Change subject: Put $wgMFQueryPropModules and $wgMFSearchApiModules in InitialiseSettings.php .. Put $wgMFQueryPropModules and $wgMFSearchApiModules in InitialiseSettings.php Explicitly define a default and the setting for Wikidata. Also, displaytitle does not work so well on Wikidata, displaytitle is not multilingual and is just stored in pageprops. For Wikidata, that's not helpful. Removing displaytitle will probably fix T120197. Bug: T120197 Bug: T125672 Change-Id: I16e61d02c4f2cf827875ec9c59da2ce6064a0bd0 --- M wmf-config/InitialiseSettings.php M wmf-config/mobile.php 2 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/82/268182/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index c8ff50e..e20ddf8 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -13582,6 +13582,18 @@ 'wmgMobileFrontend' => array( 'default' => true, ), +'wmgMFQueryPropModules' => array( + 'default' => array( 'pageprops' ), + 'wikidata' => array( 'pageprops', 'pageterms' ), +), +'wmgMFSearchAPIParams' => array( + 'default' => array( + 'ppprop' => 'displaytitle' + ), + 'wikidata' => array( + 'wbptterms' => 'label' + ) +), 'wmgUseGather' => array( 'default' => false, 'testwiki' => true, diff --git a/wmf-config/mobile.php b/wmf-config/mobile.php index c1bccce..3f44f6b 100644 --- a/wmf-config/mobile.php +++ b/wmf-config/mobile.php @@ -99,6 +99,9 @@ // enable editing for unregistered users $wgMFEditorOptions = $wmgMFEditorOptions; + $wgMFQueryPropModules = $wmgMFQueryPropModules; + $wgMFSearchAPIParams = $wmgMFSearchAPIParams; + $wgMFUseWikibaseDescription = true; // Alpha experiment // Turn on volunteer recruitment -- To view, visit https://gerrit.wikimedia.org/r/268182 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16e61d02c4f2cf827875ec9c59da2ce6064a0bd0 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update Wikidata submodule - change (mediawiki...release)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268101 Change subject: Update Wikidata submodule .. Update Wikidata submodule Change-Id: I3deecaf0ede22770c2d763aee52572062e73eb96 --- M make-wmf-branch/config.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/release refs/changes/01/268101/1 diff --git a/make-wmf-branch/config.json b/make-wmf-branch/config.json index 1087f68..301efcf 100644 --- a/make-wmf-branch/config.json +++ b/make-wmf-branch/config.json @@ -167,7 +167,7 @@ "@": "Set a string for the specific commit, branch, or tag", "special_extensions": { "CentralNotice": "wmf_deploy", - "Wikidata": "wmf/1.27.0-wmf.10", + "Wikidata": "wmf/1.27.0-wmf.12", "SemanticMediaWiki": "1.8.x", "SemanticResultFormats": "1.8.x", "Validator": "0.5.x" -- To view, visit https://gerrit.wikimedia.org/r/268101 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3deecaf0ede22770c2d763aee52572062e73eb96 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/tools/release Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update Wikidata submodule - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268100 Change subject: Update Wikidata submodule .. Update Wikidata submodule Wikidata submodule was pointing at master or something cut from master, which is not how this should work. We have a new branch anyway to deploy and updating the submodule to that. Change-Id: I31880b2d8299ea3ff21bf2bd4afaa0d662a0ced4 --- M extensions/Wikidata 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/00/268100/1 diff --git a/extensions/Wikidata b/extensions/Wikidata index 8f7c3f8..b7f60db 16 --- a/extensions/Wikidata +++ b/extensions/Wikidata -Subproject commit 8f7c3f887c63e914c39cb82ac6c53616f7aa327d +Subproject commit b7f60db6b3f8f8c58ce83ef8b6fd73ac7640aeb1 -- To view, visit https://gerrit.wikimedia.org/r/268100 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I31880b2d8299ea3ff21bf2bd4afaa0d662a0ced4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.27.0-wmf.12 Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Enable math data type on test wikidata + test wikipedias - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/268086 Change subject: Enable math data type on test wikidata + test wikipedias .. Enable math data type on test wikidata + test wikipedias Change-Id: I20343497b1d5af15f1eb19ec3a3cc233294fe556 --- M wmf-config/InitialiseSettings.php M wmf-config/Wikibase-production.php 2 files changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/86/268086/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index cb4c687..156c66b 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -15457,6 +15457,13 @@ 'wikidatawiki' => 500, ), +'wgMathEnableWikibaseDataType' => array( + 'default' => false, + 'testwikidatawiki' => true, + 'test2wiki' => true, + 'testwiki' => true, +), + 'wmgUseWikibaseRepo' => array( 'default' => false, 'wikidata' => true, diff --git a/wmf-config/Wikibase-production.php b/wmf-config/Wikibase-production.php index cce7bf1..8c5f24a 100644 --- a/wmf-config/Wikibase-production.php +++ b/wmf-config/Wikibase-production.php @@ -1,8 +1,5 @@ https://gerrit.wikimedia.org/r/268086 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I20343497b1d5af15f1eb19ec3a3cc233294fe556 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove extra whitespace after license-name - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/267893 Change subject: Remove extra whitespace after license-name .. Remove extra whitespace after license-name Change-Id: I7f3e8311a71f30d65626786f9f9151bf29ccc8fe --- M client/WikibaseClient.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/93/267893/1 diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php index 46b1990..9a679e3 100644 --- a/client/WikibaseClient.php +++ b/client/WikibaseClient.php @@ -80,7 +80,7 @@ ), 'url' => 'https://www.mediawiki.org/wiki/Extension:Wikibase_Client', 'descriptionmsg' => 'wikibase-client-desc', - 'license-name' => 'GPL-2.0+' + 'license-name' => 'GPL-2.0+' ); $wgWBClientDataTypes = require ( __DIR__ . '/../lib/WikibaseLib.datatypes.php' ); -- To view, visit https://gerrit.wikimedia.org/r/267893 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f3e8311a71f30d65626786f9f9151bf29ccc8fe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] New deployment branch: wmf/1.27.0-wmf.12 - change (mediawiki...Wikidata)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/267892 Change subject: New deployment branch: wmf/1.27.0-wmf.12 .. New deployment branch: wmf/1.27.0-wmf.12 Change-Id: I645905941c9bd782741dc172c10c6af463003c7f --- M README.md M WikibaseClient.settings.php M WikibaseRepo.settings.php M composer.json M composer.lock M extensions/Constraints/WikibaseQualityConstraints.php M extensions/Constraints/i18n/nl.json M extensions/Constraints/includes/Constraint.php M extensions/Constraints/includes/ConstraintRepository.php M extensions/Constraints/maintenance/UpdateConstraintsTable.php M extensions/Constraints/tests/phpunit/ConstraintTest.php M extensions/Quality/extension.json A extensions/Quality/i18n/id.json M extensions/Quality/i18n/lki.json M extensions/Quality/i18n/nl.json M extensions/ValueView/.gitignore R extensions/ValueView/COPYING M extensions/ValueView/README.md M extensions/ValueView/RELEASE-NOTES.md M extensions/ValueView/ValueView.mw.php M extensions/ValueView/ValueView.php M extensions/ValueView/composer.json M extensions/ValueView/lib/jquery.event/jquery.event.special.eachchange.js M extensions/ValueView/lib/jquery.ui/jquery.ui.inputextender.js M extensions/ValueView/lib/jquery.ui/jquery.ui.languagesuggester.js M extensions/ValueView/lib/jquery.ui/jquery.ui.suggester.js M extensions/ValueView/lib/jquery.ui/jquery.ui.toggler.js M extensions/ValueView/lib/jquery.util/jquery.util.adaptlettercase.js M extensions/ValueView/lib/jquery/jquery.focusAt.js M extensions/ValueView/lib/jquery/jquery.inputautoexpand.js M extensions/ValueView/lib/util/util.highlightSubstring.js M extensions/ValueView/src/ExpertExtender/ExpertExtender.LanguageSelector.js M extensions/ValueView/src/experts/GlobeCoordinateInput.js M extensions/ValueView/src/experts/TimeInput.js M extensions/ValueView/src/jquery.valueview.ExpertStore.js M extensions/ValueView/tests/lib/jquery.event/jquery.event.special.eachchange.tests.js M extensions/ValueView/tests/lib/jquery.ui/jquery.ui.inputextender.tests.js M extensions/ValueView/tests/lib/jquery.ui/jquery.ui.listrotator.tests.js M extensions/ValueView/tests/lib/jquery.ui/jquery.ui.ooMenu.tests.js M extensions/ValueView/tests/lib/jquery.ui/jquery.ui.suggester.tests.js M extensions/ValueView/tests/lib/jquery.util/jquery.util.adaptlettercase.tests.js M extensions/ValueView/tests/lib/jquery.util/jquery.util.getscrollbarwidth.tests.js M extensions/ValueView/tests/lib/jquery/jquery.AnimationEvent.tests.js M extensions/ValueView/tests/lib/jquery/jquery.PurposedCallbacks.tests.js M extensions/ValueView/tests/lib/jquery/jquery.animateWithEvent.tests.js M extensions/ValueView/tests/lib/jquery/jquery.autocompletestring.tests.js M extensions/ValueView/tests/lib/jquery/jquery.focusAt.tests.js M extensions/ValueView/tests/lib/jquery/jquery.inputautoexpand.tests.js M extensions/ValueView/tests/lib/util/util.HashMessageProvider.tests.js M extensions/ValueView/tests/lib/util/util.Notifier.tests.js M extensions/ValueView/tests/lib/util/util.highlightSubstring.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.CalendarHint.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.Container.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.LanguageSelector.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.Listrotator.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.UnitSelector.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.tests.js M extensions/ValueView/tests/src/ExpertExtender/testExpertExtenderExtension.js M extensions/ValueView/tests/src/experts/GlobeCoordinateInput.tests.js M extensions/ValueView/tests/src/experts/QuantityInput.tests.js M extensions/ValueView/tests/src/jquery.valueview.ExpertStore.tests.js M extensions/ValueView/tests/src/jquery.valueview.tests.MockViewState.tests.js M extensions/ValueView/tests/src/jquery.valueview.tests.testExpert.js M extensions/ValueView/tests/src/jquery.valueview.valueview.tests.js M extensions/Wikibase/.jscsrc M extensions/Wikibase/README.md M extensions/Wikibase/client/WikibaseClient.php M extensions/Wikibase/client/i18n/be-tarask.json M extensions/Wikibase/client/i18n/bg.json M extensions/Wikibase/client/i18n/ckb.json M extensions/Wikibase/client/i18n/cu.json A extensions/Wikibase/client/i18n/fur.json M extensions/Wikibase/client/i18n/glk.json M extensions/Wikibase/client/i18n/gsw.json M extensions/Wikibase/client/i18n/id.json A extensions/Wikibase/client/i18n/jam.json M extensions/Wikibase/client/i18n/la.json M extensions/Wikibase/client/i18n/lki.json M extensions/Wikibase/client/i18n/lzh.json M extensions/Wikibase/client/i18n/mai.json M extensions/Wikibase/client/i18n/nl.json M extensions/Wikibase/client/i18n/pl.json M extensions/Wikibase/client/i18n/tt-cyrl.json M extensions/Wikibase/client/i18n/zh-hant.json M extensions/Wikibase/clie
[MediaWiki-commits] [Gerrit] Update WikidataBuildResources to use git repo on gerrit - change (mediawiki/vagrant)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/267864 Change subject: Update WikidataBuildResources to use git repo on gerrit .. Update WikidataBuildResources to use git repo on gerrit Bug: T73 Change-Id: If7ca7d7219c74ff00f527022431b214eac344dc2 --- M puppet/modules/role/manifests/wikidata.pp 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/64/267864/1 diff --git a/puppet/modules/role/manifests/wikidata.pp b/puppet/modules/role/manifests/wikidata.pp index 42f15c1..a5ebc76 100644 --- a/puppet/modules/role/manifests/wikidata.pp +++ b/puppet/modules/role/manifests/wikidata.pp @@ -11,7 +11,7 @@ ensure_resource('mediawiki::wiki', 'en') mediawiki::extension { 'WikidataBuildResources': -remote => 'https://github.com/wmde/WikidataBuildResources.git', +remote => 'https://gerrit.wikimedia.org/r/wikidata/build-resources', entrypoint => 'Wikidata.php', composer => true, needs_update => true, @@ -32,5 +32,6 @@ Mediawiki::Extension['WikidataBuildResources'], ], } + Mediawiki::Wiki<| |> ~> Exec['wikidata-populate-site-tables'] } -- To view, visit https://gerrit.wikimedia.org/r/267864 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7ca7d7219c74ff00f527022431b214eac344dc2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix long line in ConstraintRepository - change (mediawiki...WikibaseQualityConstraints)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/267315 Change subject: Fix long line in ConstraintRepository .. Fix long line in ConstraintRepository also use Property::newFromNumber here Change-Id: I6c2a5d6baf14210d8122cb45da1ee2570fc04510 --- M includes/ConstraintRepository.php 1 file changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints refs/changes/15/267315/1 diff --git a/includes/ConstraintRepository.php b/includes/ConstraintRepository.php index df66a75..69b6407 100644 --- a/includes/ConstraintRepository.php +++ b/includes/ConstraintRepository.php @@ -81,10 +81,15 @@ foreach( $results as $result ) { $constraintTypeQid = $result->constraint_type_qid; $constraintParameters = (array) json_decode( $result->constraint_parameters ); - $serializedPid = 'P' . $result->pid; - $constraints[] = new Constraint( $result->constraint_guid, new PropertyId( $serializedPid ), $constraintTypeQid, $constraintParameters ); + + $constraints[] = new Constraint( + $result->constraint_guid, + PropertyId::newFromNumber( $result->pid ), + $constraintTypeQid, + $constraintParameters + ); } return $constraints; } -} \ No newline at end of file +} -- To view, visit https://gerrit.wikimedia.org/r/267315 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c2a5d6baf14210d8122cb45da1ee2570fc04510 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Renamed $constraintClaimGuid -> $constraintStatementGuid - change (mediawiki...WikibaseQualityConstraints)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/267314 Change subject: Renamed $constraintClaimGuid -> $constraintStatementGuid .. Renamed $constraintClaimGuid -> $constraintStatementGuid also fixed some of the long lines and made the code more clear in places where Constraint is used. Change-Id: I0c53f33c24b365a228f9211e9d32a7f5c3547f7b --- M includes/Constraint.php M includes/ConstraintRepository.php M maintenance/UpdateConstraintsTable.php 3 files changed, 34 insertions(+), 24 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints refs/changes/14/267314/1 diff --git a/includes/Constraint.php b/includes/Constraint.php index 97ba8b0..f92fd06 100644 --- a/includes/Constraint.php +++ b/includes/Constraint.php @@ -4,7 +4,6 @@ use Wikibase\DataModel\Entity\PropertyId; - /** * Class Constraint * @@ -17,7 +16,12 @@ /** * @var string */ - private $constraintClaimGuid; + private $constraintStatementGuid; + + /** +* @var PropertyId +*/ + private $propertyId; /** * @var string @@ -30,33 +34,33 @@ private $constraintTypeQid; /** -* @var PropertyId -*/ - private $propertyId; - - /** -* @var array (variable length; key: string with parameter name (e.g. 'property'); value: string (e.g. 'P21') +* @var array (key: string with parameter name (e.g. 'property'); value: string (e.g. 'P21')) */ private $constraintParameters; /** -* @param string $constraintClaimGuid +* @param string $constraintStatementGuid * @param PropertyId $propertyId * @param string $constraintTypeQid * @param array $constraintParameters */ - public function __construct( $constraintClaimGuid, PropertyId $propertyId, $constraintTypeQid, $constraintParameters) { - $this->constraintClaimGuid = $constraintClaimGuid; - $this->constraintTypeQid = $constraintTypeQid; + public function __construct( + $constraintStatementGuid, + PropertyId $propertyId, + $constraintTypeQid, + array $constraintParameters + ) { + $this->constraintStatementGuid = $constraintStatementGuid; $this->propertyId = $propertyId; + $this->constraintTypeQid = $constraintTypeQid; $this->constraintParameters = $constraintParameters; } /** * @return string */ - public function getConstraintClaimGuid() { - return $this->constraintClaimGuid; + public function getConstraintStatementGuid() { + return $this->constraintStatementGuid; } /** @@ -87,10 +91,10 @@ } /** -* @return array (variable length; key: string with parameter name (e.g. 'property'); value: string (e.g. 'P21') +* @return array (key: string with parameter name (e.g. 'property'); value: string (e.g. 'P21')) */ public function getConstraintParameters() { return $this->constraintParameters; } -} \ No newline at end of file +} diff --git a/includes/ConstraintRepository.php b/includes/ConstraintRepository.php index df66a75..69b6407 100644 --- a/includes/ConstraintRepository.php +++ b/includes/ConstraintRepository.php @@ -81,10 +81,15 @@ foreach( $results as $result ) { $constraintTypeQid = $result->constraint_type_qid; $constraintParameters = (array) json_decode( $result->constraint_parameters ); - $serializedPid = 'P' . $result->pid; - $constraints[] = new Constraint( $result->constraint_guid, new PropertyId( $serializedPid ), $constraintTypeQid, $constraintParameters ); + + $constraints[] = new Constraint( + $result->constraint_guid, + PropertyId::newFromNumber( $result->pid ), + $constraintTypeQid, + $constraintParameters + ); } return $constraints; } -} \ No newline at end of file +} diff --git a/maintenance/UpdateConstraintsTable.php b/maintenance/UpdateConstraintsTable.php index e4bb6f5..058627e 100644 --- a/maintenance/UpdateConstraintsTable.php +++ b/maintenance/UpdateConstraintsTable.php @@ -51,10 +51,10 @@ } private function insertValues( $constraintRepo, $csvFile ) { - $i = 0; $db = wfGetDB( DB_MASTER ); $accumulator = array(); + while ( true ) { $data = fgetcsv( $csvFile );
[MediaWiki-commits] [Gerrit] Fix long lines in UpdateConstraintsTable script - change (mediawiki...WikibaseQualityConstraints)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/267304 Change subject: Fix long lines in UpdateConstraintsTable script .. Fix long lines in UpdateConstraintsTable script also removed the class_exists check for Maintenance, as we always need to include Maintenance here. Change-Id: I8cd145444f80752dcb6611dbf6d9bbc551120eb5 --- M maintenance/UpdateConstraintsTable.php 1 file changed, 21 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints refs/changes/04/267304/1 diff --git a/maintenance/UpdateConstraintsTable.php b/maintenance/UpdateConstraintsTable.php index 6d43759..e2294ca 100644 --- a/maintenance/UpdateConstraintsTable.php +++ b/maintenance/UpdateConstraintsTable.php @@ -6,11 +6,10 @@ use WikibaseQuality\ConstraintReport\Constraint; use WikibaseQuality\ConstraintReport\ConstraintReportFactory; -if( !class_exists( '\Maintenance' ) ) { - $basePath = getenv( "MW_INSTALL_PATH" ) !== false ? getenv( "MW_INSTALL_PATH" ) : __DIR__ . "/../../.."; - require_once $basePath . "/maintenance/Maintenance.php"; -} +$basePath = getenv( "MW_INSTALL_PATH" ) !== false + ? getenv( "MW_INSTALL_PATH" ) : __DIR__ . "/../../.."; +require_once $basePath . "/maintenance/Maintenance.php"; /** * Class UpdateConstraintsTable @@ -19,7 +18,9 @@ * * Fills constraint table with constraints given in a csv file passed to this. * Should be done once a week to keep constraint table up to date. - * csv-file is generated by https://github.com/WikidataQuality/ConstraintsFromTemplates/blob/master/csvScriptBuilder.py + * + * csv-file is generated by: + * https://github.com/WikidataQuality/ConstraintsFromTemplates/blob/master/csvScriptBuilder.py */ class UpdateConstraintsTable extends \Maintenance { @@ -27,7 +28,13 @@ parent::__construct(); $this->mDescription = "Reads csv file and writes its contents into constraints table"; - $this->addOption( 'csv-file', 'csv file that contains constraints parsed from the property talk pages.', true, true ); + $this->addOption( + 'csv-file', + 'csv file that contains constraints parsed from the property talk pages.', + true, + true + ); + $this->setBatchSize( 1000 ); } @@ -70,7 +77,13 @@ $constraintParameters = (array) json_decode( $data[3] ); $propertyId = new PropertyId( 'P' . $data[1] ); - $accumulator[] = new Constraint( $data[0], $propertyId, $data[2], $constraintParameters ); + + $accumulator[] = new Constraint( + $data[0], + new PropertyId( 'P', $data[1] ), + $data[2], + $constraintParameters + ); } } @@ -79,4 +92,4 @@ // @codeCoverageIgnoreStart $maintClass = 'WikibaseQuality\ConstraintReport\Maintenance\UpdateConstraintsTable'; require_once RUN_MAINTENANCE_IF_MAIN; -// @codeCoverageIgnoreEnd \ No newline at end of file +// @codeCoverageIgnoreEnd -- To view, visit https://gerrit.wikimedia.org/r/267304 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8cd145444f80752dcb6611dbf6d9bbc551120eb5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove SnakFactory / merge into SnakConstructionService - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/267264 Change subject: Remove SnakFactory / merge into SnakConstructionService .. Remove SnakFactory / merge into SnakConstructionService Once Id6cecd3 is merged, then SnakConstructionService is the only thing that uses SnakFactory and basically also is a factory for snaks. Change-Id: Ibda81311767ba9c588bc3e30d403416fa18a359b --- D lib/includes/SnakFactory.php D lib/tests/phpunit/SnakFactoryTest.php M repo/includes/SnakConstructionService.php M repo/includes/WikibaseRepo.php R repo/tests/phpunit/includes/SnakConstructionServiceTest.php 5 files changed, 47 insertions(+), 144 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/64/267264/1 diff --git a/lib/includes/SnakFactory.php b/lib/includes/SnakFactory.php deleted file mode 100644 index c6ccbb7..000 --- a/lib/includes/SnakFactory.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @author Daniel Kinzler - */ -class SnakFactory { - - /** -* Builds and returns a new snak from the provided property, snak type -* and optional snak value and value type. -* -* @since 0.4 -* -* @param PropertyId $propertyId -* @param string $snakType -* @param DataValue|null $value -* -* @return Snak -* @throws InvalidArgumentException -*/ - public function newSnak( PropertyId $propertyId, $snakType, DataValue $value = null ) { - switch ( $snakType ) { - case 'value': - if ( $value === null ) { - throw new InvalidArgumentException( "`value` snaks require a the $value parameter to be set!" ); - } - - $snak = new PropertyValueSnak( $propertyId, $value ); - break; - case 'novalue': - $snak = new PropertyNoValueSnak( $propertyId ); - break; - case 'somevalue': - $snak = new PropertySomeValueSnak( $propertyId ); - break; - default: - throw new InvalidArgumentException( "bad snak type: $snakType" ); - } - - return $snak; - } - -} diff --git a/lib/tests/phpunit/SnakFactoryTest.php b/lib/tests/phpunit/SnakFactoryTest.php deleted file mode 100644 index ca0de2e..000 --- a/lib/tests/phpunit/SnakFactoryTest.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ -class SnakFactoryTest extends \MediaWikiTestCase { - - public function testNoValueSnakConstruction() { - $factory = new SnakFactory(); - $snak = $factory->newSnak( new PropertyId( 'P1' ), 'novalue', null ); - - $this->assertEquals( - new PropertyNoValueSnak( 1 ), - $snak - ); - } - - public function testSomeValueSnakConstruction() { - $factory = new SnakFactory(); - $snak = $factory->newSnak( new PropertyId( 'P1' ), 'somevalue', null ); - - $this->assertEquals( - new PropertySomeValueSnak( 1 ), - $snak - ); - } - - public function testPropertyValueSnakConstruction() { - $factory = new SnakFactory(); - $snak = $factory->newSnak( new PropertyId( 'P1' ), 'value', new StringValue( 'foo' ) ); - - $this->assertEquals( - new PropertyValueSnak( 1, new StringValue( 'foo' ) ), - $snak - ); - } - - public function testGivenInvalidSnakType_exceptionIsThrown() { - $factory = new SnakFactory(); - - $this->setExpectedException( 'InvalidArgumentException' ); - $factory->newSnak( new PropertyId( 'P1' ), 'kittens', null ); - } - -} diff --git a/repo/includes/SnakConstructionService.php b/repo/includes/SnakConstructionService.php index 7f2198a..99ca6db 100644 --- a/repo/includes/SnakConstructionService.php +++ b/repo/includes/SnakConstructionService.php @@ -3,14 +3,17 @@ namespace Wikibase\Repo; use DataTypes\DataTypeFactory; +use DataValues\DataValue; use DataValues\DataValueFactory; use InvalidArgumentException; use OutOfBoundsException; use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookupException; +use Wikibase\DataModel\Snak\PropertyNoValueSnak; +use Wikibase\DataModel\Snak\PropertySomeValueSnak; +use Wikibase\DataModel\Snak\PropertyValueSnak; use Wikibase\DataModel\Snak\Snak; -use Wikibase\SnakFactory; /
[MediaWiki-commits] [Gerrit] Remove use of SnakFactory in WikibaseDataAccessTestItemSetUp... - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/267258 Change subject: Remove use of SnakFactory in WikibaseDataAccessTestItemSetUpHelper .. Remove use of SnakFactory in WikibaseDataAccessTestItemSetUpHelper SnakFactory is deprecated and don't think use of it was really so helpful here. Change-Id: Id6cecd3a7a05469b14e0ad2e7cf76f4029183513 --- M client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php 1 file changed, 7 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/58/267258/1 diff --git a/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php b/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php index ac147b3..a5c6321 100644 --- a/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php +++ b/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php @@ -12,11 +12,11 @@ use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\SiteLink; use Wikibase\DataModel\SiteLinkList; +use Wikibase\DataModel\Snak\PropertyValueSnak; use Wikibase\DataModel\Snak\Snak; use Wikibase\DataModel\Snak\SnakList; use Wikibase\DataModel\Statement\Statement; use Wikibase\DataModel\Statement\StatementList; -use Wikibase\SnakFactory; use Wikibase\Test\MockClientStore; use Wikibase\Test\MockRepository; @@ -54,7 +54,7 @@ $stringProperty = $this->getTestProperty( new PropertyId( 'P342' ), 'string', 'LuaTestStringProperty' ); $itemProperty = $this->getTestProperty( new PropertyId( 'P456' ), 'wikibase-item', 'LuaTestItemProperty' ); - $stringSnak = $this->getTestSnak( + $stringSnak = new PropertyValueSnak( $stringProperty->getId(), new StringValue( 'Lua :)' ) ); @@ -62,15 +62,15 @@ $statement1 = $this->getTestStatement( $stringSnak ); $statement1->setRank( Statement::RANK_PREFERRED ); - $qualifierSnak1 = $this->getTestSnak( + $qualifierSnak1 = new PropertyValueSnak( new PropertyId( 'P342' ), new StringValue( 'A qualifier Snak' ) ); - $qualifierSnak2 = $this->getTestSnak( + $qualifierSnak2 = new PropertyValueSnak( new PropertyId( 'P342' ), new StringValue( 'Moar qualifiers' ) ); - $referenceSnak = $this->getTestSnak( + $referenceSnak = new PropertyValueSnak( new PropertyId( 'P342' ), new StringValue( 'A reference' ) ); @@ -85,7 +85,7 @@ $this->siteLinkLookup->putEntity( $stringProperty ); $this->siteLinkLookup->putEntity( $itemProperty ); - $stringSnak2 = $this->getTestSnak( + $stringSnak2 = new PropertyValueSnak( $stringProperty->getId(), new StringValue( 'Lua is clearly superior to the parser function' ) ); @@ -93,7 +93,7 @@ $statement2 = $this->getTestStatement( $stringSnak2 ); $statement2->setRank( Statement::RANK_NORMAL ); - $itemSnak = $this->getTestSnak( + $itemSnak = new PropertyValueSnak( $itemProperty->getId(), new EntityIdValue( new ItemId( 'Q885588' ) ) ); @@ -164,19 +164,6 @@ $this->siteLinkLookup->putEntity( $item ); return $item; - } - - /** -* @param PropertyId $propertyId -* @param DataValue $value -* -* @return Snak -*/ - private function getTestSnak( PropertyId $propertyId, DataValue $value ) { - $snakFactory = new SnakFactory(); - $snak = $snakFactory->newSnak( $propertyId, 'value', $value ); - - return $snak; } /** -- To view, visit https://gerrit.wikimedia.org/r/267258 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id6cecd3a7a05469b14e0ad2e7cf76f4029183513 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use PHPUnit_Framework_TestCase in WikibaseLib tests - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/267249 Change subject: Use PHPUnit_Framework_TestCase in WikibaseLib tests .. Use PHPUnit_Framework_TestCase in WikibaseLib tests where possible and we have no good reason to need to use MediaWikiTestCase. Change-Id: Iad3bdcf59043310681d98a91c527d66a6bb83cca --- M lib/tests/phpunit/DataTypeDefinitionsTest.php M lib/tests/phpunit/MediaWikiContentLanguagesTest.php M lib/tests/phpunit/StaticContentLanguagesTest.php M lib/tests/phpunit/StringNormalizerTest.php M lib/tests/phpunit/TermIndexEntryTest.php M lib/tests/phpunit/UnionContentLanguagesTest.php 6 files changed, 12 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/49/267249/1 diff --git a/lib/tests/phpunit/DataTypeDefinitionsTest.php b/lib/tests/phpunit/DataTypeDefinitionsTest.php index c4aed4e..592ed6f 100644 --- a/lib/tests/phpunit/DataTypeDefinitionsTest.php +++ b/lib/tests/phpunit/DataTypeDefinitionsTest.php @@ -2,6 +2,7 @@ namespace Wikibase\Lib\Tests; +use PHPUnit_Framework_TestCase; use Wikibase\Lib\DataTypeDefinitions; /** @@ -14,7 +15,7 @@ * @licence GNU GPL v2+ * @author Daniel Kinzler */ -class DataTypeDefinitionsTest extends \MediaWikiTestCase { +class DataTypeDefinitionsTest extends PHPUnit_Framework_TestCase { private function getDefinitions() { return array( diff --git a/lib/tests/phpunit/MediaWikiContentLanguagesTest.php b/lib/tests/phpunit/MediaWikiContentLanguagesTest.php index 730180e..d31035e 100644 --- a/lib/tests/phpunit/MediaWikiContentLanguagesTest.php +++ b/lib/tests/phpunit/MediaWikiContentLanguagesTest.php @@ -2,7 +2,7 @@ namespace Wikibase\Lib\Test; -use MediaWikiTestCase; +use PHPUnit_Framework_TestCase; use Wikibase\Lib\MediaWikiContentLanguages; /** @@ -14,7 +14,7 @@ * @license GNU GPL v2+ * @author Marius Hoch < h...@online.de > */ -class MediaWikiContentLanguagesTest extends MediaWikiTestCase { +class MediaWikiContentLanguagesTest extends PHPUnit_Framework_TestCase { public function testGetLanguages() { $wbContentLanguages = new MediaWikiContentLanguages(); diff --git a/lib/tests/phpunit/StaticContentLanguagesTest.php b/lib/tests/phpunit/StaticContentLanguagesTest.php index e364c55..4e21e4f 100644 --- a/lib/tests/phpunit/StaticContentLanguagesTest.php +++ b/lib/tests/phpunit/StaticContentLanguagesTest.php @@ -2,6 +2,7 @@ namespace Wikibase\Lib\Test; +use PHPUnit_Framework_TestCase; use Wikibase\Lib\StaticContentLanguages; /** @@ -13,7 +14,7 @@ * @license GNU GPL v2+ * @author Adrian Heine < adrian.he...@wikimedia.de > */ -class StaticContentLanguagesTest extends \MediaWikiTestCase { +class StaticContentLanguagesTest extends PHPUnit_Framework_TestCase { /** * @dataProvider provideTestGetLanguages diff --git a/lib/tests/phpunit/StringNormalizerTest.php b/lib/tests/phpunit/StringNormalizerTest.php index 8e078d9..feb6859 100644 --- a/lib/tests/phpunit/StringNormalizerTest.php +++ b/lib/tests/phpunit/StringNormalizerTest.php @@ -2,6 +2,7 @@ namespace Wikibase\Test; +use PHPUnit_Framework_TestCase; use Wikibase\StringNormalizer; /** @@ -14,7 +15,7 @@ * @author John Erling Blad < jeb...@gmail.com > * @author Daniel Kinzler */ -class StringNormalizerTest extends \MediaWikiTestCase { +class StringNormalizerTest extends PHPUnit_Framework_TestCase { /** * @dataProvider providerTrimBadChars diff --git a/lib/tests/phpunit/TermIndexEntryTest.php b/lib/tests/phpunit/TermIndexEntryTest.php index 3ad5c85..f2068eb 100644 --- a/lib/tests/phpunit/TermIndexEntryTest.php +++ b/lib/tests/phpunit/TermIndexEntryTest.php @@ -2,6 +2,7 @@ namespace Wikibase\Test; +use PHPUnit_Framework_TestCase; use Wikibase\DataModel\LegacyIdInterpreter; use Wikibase\DataModel\Term\Term; use Wikibase\TermIndexEntry; @@ -16,7 +17,7 @@ * @licence GNU GPL v2+ * @author Daniel Kinzler */ -class TermIndexEntryTest extends \MediaWikiTestCase { +class TermIndexEntryTest extends PHPUnit_Framework_TestCase { public function provideConstructor() { return array( diff --git a/lib/tests/phpunit/UnionContentLanguagesTest.php b/lib/tests/phpunit/UnionContentLanguagesTest.php index c22a34d..1d35288 100644 --- a/lib/tests/phpunit/UnionContentLanguagesTest.php +++ b/lib/tests/phpunit/UnionContentLanguagesTest.php @@ -2,6 +2,7 @@ namespace Wikibase\Lib\Test; +use PHPUnit_Framework_TestCase; use Wikibase\Lib\ContentLanguages; use Wikibase\Lib\UnionContentLanguages; @@ -14,7 +15,7 @@ * @license GNU GPL v2+ * @author Adrian Heine < adrian.he...@wikimedia.de > */ -class UnionContentLanguagesTest extends \MediaWikiTestCase { +class UnionContentLanguagesTest extends PHPUnit_Framework_TestCase { /** * @dataProvider provideTestGetLanguages -- To v
[MediaWiki-commits] [Gerrit] Update WikidataBuildResources git source (github -> gerrit) - change (operations/puppet)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/267242 Change subject: Update WikidataBuildResources git source (github -> gerrit) .. Update WikidataBuildResources git source (github -> gerrit) Bug: T73 Change-Id: Iff725deaa0d2d5c64d3a80ff6402e07a3ff71ee9 --- M modules/wikidatabuilder/manifests/init.pp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/42/267242/1 diff --git a/modules/wikidatabuilder/manifests/init.pp b/modules/wikidatabuilder/manifests/init.pp index 945533b..e0d3738 100644 --- a/modules/wikidatabuilder/manifests/init.pp +++ b/modules/wikidatabuilder/manifests/init.pp @@ -85,7 +85,7 @@ git::clone { 'wikidatabuildresources': ensure=> latest, directory => '/data/wdbuilder/buildresources', -origin=> 'https://github.com/wmde/WikidataBuildResources.git', +origin=> 'https://gerrit.wikimedia.org/r/wikidata/build-resources', owner => 'wdbuilder', group => 'wdbuilder', require => [ -- To view, visit https://gerrit.wikimedia.org/r/267242 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff725deaa0d2d5c64d3a80ff6402e07a3ff71ee9 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update urls in README from github -> phabricator - change (wikidata/build-resources)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/267240 Change subject: Update urls in README from github -> phabricator .. Update urls in README from github -> phabricator Bug: T73 Change-Id: I370e3afb95e371b7c1667751519a1479bf5ad1df --- M README.md 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/build-resources refs/changes/40/267240/1 diff --git a/README.md b/README.md index 6dd5519..b1ac126 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Wikidata is using a build with Wikibase and its dependencies packaged into one git repo. -If you update the master branch of this repo it will likely be overwritten in the next 24 hours. To change things please see [here](https://github.com/wmde/WikidataBuildResources). +If you update the master branch of this repo it will likely be overwritten in the next 24 hours. To change things please instead make changes to wikidata/build-resources which is used for automated Wikidata builds. (see [here](https://phabricator.wikimedia.org/diffusion/WDBR/)). ## Installation @@ -90,4 +90,4 @@ ## Updating this README -This readme is located [here](https://github.com/wmde/WikidataBuildResources/blob/master/README.md). Any changes made to the README in the Wikidata build repo will be overwritten by this file daily. +This readme is located [here](https://phabricator.wikimedia.org/diffusion/WDBR/browse/master/README.md). Any changes made to the README in the Wikidata build repo will be overwritten by this file daily. -- To view, visit https://gerrit.wikimedia.org/r/267240 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I370e3afb95e371b7c1667751519a1479bf5ad1df Gerrit-PatchSet: 1 Gerrit-Project: wikidata/build-resources Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add wikibase rights to $wgGrantPermissions - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/265449 Change subject: Add wikibase rights to $wgGrantPermissions .. Add wikibase rights to $wgGrantPermissions grant restrictions are being moved from OAuth to core, and these now need to be set for authentication changes coming. see Ida2b686 and https://lists.wikimedia.org/pipermail/wikitech-l/2016-January/084501.html Bug: T124269 Change-Id: I549c07f99168c9bd47fc968e10b8545a578e656b --- M repo/Wikibase.php 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/49/265449/1 diff --git a/repo/Wikibase.php b/repo/Wikibase.php index 8c9d642..182f5a2 100644 --- a/repo/Wikibase.php +++ b/repo/Wikibase.php @@ -124,6 +124,12 @@ $wgAvailableRights[] = 'item-redirect'; $wgAvailableRights[] = 'property-create'; + $wgGrantPermissions['edit-page']['item-term']; + $wgGrantPermissions['edit-page']['item-redirect']; + $wgGrantPermissions['edit-page']['item-merge']; + $wgGrantPermissions['edit-page']['property-term']; + $wgGrantPermissions['createeditmovepage']['property-create']; + // i18n $wgMessagesDirs['Wikibase'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['WikibaseAlias'] = __DIR__ . '/Wikibase.i18n.alias.php'; -- To view, visit https://gerrit.wikimedia.org/r/265449 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I549c07f99168c9bd47fc968e10b8545a578e656b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused/no longer existing item-create oauth grant - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/265447 Change subject: Remove unused/no longer existing item-create oauth grant .. Remove unused/no longer existing item-create oauth grant this was removed from wikibase back in 2014. (Ibec11b1) Change-Id: If7b9e58812234620964efb8749a1cbed1729f423 --- M wmf-config/CommonSettings.php 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/47/265447/1 diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index 31e4ae3..802e227 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -557,7 +557,6 @@ $wgGrantPermissionGroups['checkuser'] = 'administration'; // Rights needed to interact with wikibase -$wgGrantPermissions['createeditmovepage']['item-create'] = true; $wgGrantPermissions['createeditmovepage']['property-create'] = true; $wgGrantPermissions['editpage']['item-term'] = true; $wgGrantPermissions['editpage']['item-merge'] = true; -- To view, visit https://gerrit.wikimedia.org/r/265447 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7b9e58812234620964efb8749a1cbed1729f423 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add data-values/* to wikidata-feed irc channel - change (labs...grrrit)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/264926 Change subject: Add data-values/* to wikidata-feed irc channel .. Add data-values/* to wikidata-feed irc channel Change-Id: Icbbe932955fb249787859cfa3b55cad9faf16460 --- M config.yaml 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/grrrit refs/changes/26/264926/1 diff --git a/config.yaml b/config.yaml index 29ea577..ccadc31 100644 --- a/config.yaml +++ b/config.yaml @@ -143,6 +143,7 @@ .*: branch: "betacluster" "#wikidata-feed": +data-values/.*: mediawiki/extensions/Wikibase.*: mediawiki/extensions/Wikidata.*: mediawiki/extensions/DataTypes: -- To view, visit https://gerrit.wikimedia.org/r/264926 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icbbe932955fb249787859cfa3b55cad9faf16460 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/grrrit Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix typos and expected test result in api EditEntityTest - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/264924 Change subject: Fix typos and expected test result in api EditEntityTest .. Fix typos and expected test result in api EditEntityTest Change-Id: I69b03ebd6446d72e23dee17c325c861732747284 --- M repo/tests/phpunit/includes/api/EditEntityTest.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/24/264924/1 diff --git a/repo/tests/phpunit/includes/api/EditEntityTest.php b/repo/tests/phpunit/includes/api/EditEntityTest.php index ff47170..27d3c8c 100644 --- a/repo/tests/phpunit/includes/api/EditEntityTest.php +++ b/repo/tests/phpunit/includes/api/EditEntityTest.php @@ -581,11 +581,11 @@ 'p' => array( 'site' => 'enwiki', 'title' => 'Berlin', - 'data' => '{"lables":{"BLUB":{"language":"BLUB","value":"ImaLabel"}}}' + 'data' => '{"labels":{"BLUB":{"language":"BLUB","value":"ImaLabel"}}}' ), 'e' => array( 'exception' => array( 'type' => 'UsageException', - 'code' => 'not-recognized' + 'code' => 'not-recognized-language' ) ) ), // @todo the error codes in the overly long string tests make no sense // and should be corrected... @@ -593,7 +593,7 @@ 'p' => array( 'site' => 'enwiki', 'title' => 'Berlin', - 'data' => '{"lables":{"en":{"language":"en","value":"' + 'data' => '{"labels":{"en":{"language":"en","value":"' . TermTestHelper::makeOverlyLongString() . '"}}}' ), 'e' => array( 'exception' => array( 'type' => 'UsageException' ) ) ), -- To view, visit https://gerrit.wikimedia.org/r/264924 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I69b03ebd6446d72e23dee17c325c861732747284 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix long lines in api EditEntityTest - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/264923 Change subject: Fix long lines in api EditEntityTest .. Fix long lines in api EditEntityTest Change-Id: I5500e5bf03e985b246dd005bea96fffcf16e0974 --- M repo/tests/phpunit/includes/api/EditEntityTest.php 1 file changed, 122 insertions(+), 32 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/23/264923/1 diff --git a/repo/tests/phpunit/includes/api/EditEntityTest.php b/repo/tests/phpunit/includes/api/EditEntityTest.php index 0a3417d..ff47170 100644 --- a/repo/tests/phpunit/includes/api/EditEntityTest.php +++ b/repo/tests/phpunit/includes/api/EditEntityTest.php @@ -92,11 +92,18 @@ 'p' => array( 'new' => 'property', 'data' => '{"datatype":"string"}' ), 'e' => array( 'type' => 'property' ) ), 'new property with data' => array( // this is our current example in the api doc - 'p' => array( 'new' => 'property', 'data' => '{"labels":{"en-gb":{"language":"en-gb","value":"Propertylabel"}},'. - '"descriptions":{"en-gb":{"language":"en-gb","value":"Propertydescription"}},"datatype":"string"}' ), + 'p' => array( + 'new' => 'property', + 'data' => '{"labels":{"en-gb":{"language":"en-gb","value":"Propertylabel"}},' + . '"descriptions":{"en-gb":{"language":"en-gb","value":"Propertydescription"}},' + . '"datatype":"string"}' + ), 'e' => array( 'type' => 'property' ) ), 'add a sitelink..' => array( // make sure if we pass in a valid id it is accepted - 'p' => array( 'data' => '{"sitelinks":{"dewiki":{"site":"dewiki","title":"TestPage!","badges":["%Q42%","%Q149%"]}}}' ), + 'p' => array( + 'data' => '{"sitelinks":{"dewiki":{"site":"dewiki",' + . '"title":"TestPage!","badges":["%Q42%","%Q149%"]}}}' + ), 'e' => array( 'sitelinks' => array( array( @@ -136,7 +143,10 @@ ), 'remove a sitelink..' => array( 'p' => array( 'data' => '{"sitelinks":{"dewiki":{"site":"dewiki","title":""}}}' ), - 'e' => array( 'labels' => array( 'en' => 'A Label' ), 'descriptions' => array( 'en' => 'DESC' ) ) ), + 'e' => array( + 'labels' => array( 'en' => 'A Label' ), + 'descriptions' => array( 'en' => 'DESC' ) ) + ), 'remove a label..' => array( 'p' => array( 'data' => '{"labels":{"en":{"language":"en","value":""}}}' ), 'e' => array( 'descriptions' => array( 'en' => 'DESC' ) ) ), @@ -144,7 +154,10 @@ 'p' => array( 'data' => '{"descriptions":{"en":{"language":"en","value":""}}}' ), 'e' => array( 'type' => 'item' ) ), 'clear an item with some new value' => array( - 'p' => array( 'data' => '{"sitelinks":{"dewiki":{"site":"dewiki","title":"page"}}}', 'clear' => '' ), + 'p' => array( + 'data' => '{"sitelinks":{"dewiki":{"site":"dewiki","title":"page"}}}', + 'clear' => '' + ), 'e' => array( 'type' => 'item', 'sitelinks' => array( @@ -195,7 +208,11 @@ ) ), 'unset a sitelink using the other sitelink' => array( - 'p' => array( 'site' => 'svwiki', 'title' => 'FOO', 'data' => '{"sitelinks":{"dewiki":{"site":"dewiki","title":""}}}' ), + 'p' => array( + 'site' => 'svwiki', + 'title' => 'FOO', + 'data' => '{"sitelinks":{"dewiki":{"site":"dewiki","title":""}}}' + ), 'e' => array( 'type' => 'item'
[MediaWiki-commits] [Gerrit] Fix typo in docs/constraints.wiki - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/264921 Change subject: Fix typo in docs/constraints.wiki .. Fix typo in docs/constraints.wiki Change-Id: I2bca46d703ed2458d4347598ebf0579c675428a2 --- M docs/constraints.wiki 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/21/264921/1 diff --git a/docs/constraints.wiki b/docs/constraints.wiki index 0d2ff90..36c0c78 100644 --- a/docs/constraints.wiki +++ b/docs/constraints.wiki @@ -69,7 +69,7 @@ Currently, the following hard global constraints are enforced for the standard entity types: -* The lables of Properties (but not Items) must be unique per language. +* The labels of Properties (but not Items) must be unique per language. * Site links are unique, that is, only one Item can contain a given sitelink. * Any Item can only contain one SiteLink for any given site. -- To view, visit https://gerrit.wikimedia.org/r/264921 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2bca46d703ed2458d4347598ebf0579c675428a2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add license-name to extension credits - change (mediawiki...WikibaseQualityExternalValidation)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/264554 Change subject: Add license-name to extension credits .. Add license-name to extension credits Change-Id: Ieb8c7dd5e6e46af5d64e0a040df81198d9022569 --- M WikibaseQualityExternalValidation.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation refs/changes/54/264554/1 diff --git a/WikibaseQualityExternalValidation.php b/WikibaseQualityExternalValidation.php index 4fe6a41..689354c 100644 --- a/WikibaseQualityExternalValidation.php +++ b/WikibaseQualityExternalValidation.php @@ -12,7 +12,8 @@ 'author' => 'BP2014N1', 'url' => 'https://www.mediawiki.org/wiki/Extension:WikibaseQualityExternalValidation', 'descriptionmsg' => 'wbqev-desc', - 'version' => '1.0.0' + 'version' => '1.0.0', + 'license-name' => 'GPL-2.0+' ); // Initialize localization and aliases -- To view, visit https://gerrit.wikimedia.org/r/264554 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb8c7dd5e6e46af5d64e0a040df81198d9022569 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add license-name to extension.json - change (mediawiki...Math)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/264553 Change subject: Add license-name to extension.json .. Add license-name to extension.json Change-Id: Iadec5b3253b13b9163140ac8ef1e27f10718dbd2 --- M extension.json 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math refs/changes/53/264553/1 diff --git a/extension.json b/extension.json index 23a3c5b..9a00606 100644 --- a/extension.json +++ b/extension.json @@ -9,6 +9,7 @@ ], "url": "https://www.mediawiki.org/wiki/Extension:Math";, "descriptionmsg": "math-desc", + "license-name": "GPL-2.0+", "callback": "MathHooks::registerExtension", "type": "parserhook", "AutoloadClasses": { -- To view, visit https://gerrit.wikimedia.org/r/264553 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iadec5b3253b13b9163140ac8ef1e27f10718dbd2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Math Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add license-name to extension credits - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/264552 Change subject: Add license-name to extension credits .. Add license-name to extension credits Change-Id: If54b0229c9aaa1bfe47d199ee684683aa4148d4d --- M client/WikibaseClient.php M lib/WikibaseLib.php M repo/Wikibase.php 3 files changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/52/264552/1 diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php index ef34602..46b1990 100644 --- a/client/WikibaseClient.php +++ b/client/WikibaseClient.php @@ -79,7 +79,8 @@ 'The Wikidata team', // TODO: link? ), 'url' => 'https://www.mediawiki.org/wiki/Extension:Wikibase_Client', - 'descriptionmsg' => 'wikibase-client-desc' + 'descriptionmsg' => 'wikibase-client-desc', + 'license-name' => 'GPL-2.0+' ); $wgWBClientDataTypes = require ( __DIR__ . '/../lib/WikibaseLib.datatypes.php' ); diff --git a/lib/WikibaseLib.php b/lib/WikibaseLib.php index b748967..7dbf3a7 100644 --- a/lib/WikibaseLib.php +++ b/lib/WikibaseLib.php @@ -63,7 +63,8 @@ 'The Wikidata team', // TODO: link? ), 'url' => 'https://www.mediawiki.org/wiki/Extension:WikibaseLib', - 'descriptionmsg' => 'wikibase-lib-desc' + 'descriptionmsg' => 'wikibase-lib-desc', + 'license-name' => 'GPL-2.0+' ); define( 'SUMMARY_MAX_LENGTH', 250 ); diff --git a/repo/Wikibase.php b/repo/Wikibase.php index 9d45271..8c9d642 100644 --- a/repo/Wikibase.php +++ b/repo/Wikibase.php @@ -102,7 +102,8 @@ 'The Wikidata team', ), 'url' => 'https://www.mediawiki.org/wiki/Extension:Wikibase', - 'descriptionmsg' => 'wikibase-desc' + 'descriptionmsg' => 'wikibase-desc', + 'license-name' => 'GPL-2.0+' ); // constants -- To view, visit https://gerrit.wikimedia.org/r/264552 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If54b0229c9aaa1bfe47d199ee684683aa4148d4d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add license-name to extension credits - change (mediawiki...WikibaseQualityConstraints)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/264551 Change subject: Add license-name to extension credits .. Add license-name to extension credits Change-Id: Ia4c6f2d50a1be1fd90c437146fb2f606bb763652 --- M WikibaseQualityConstraints.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints refs/changes/51/264551/1 diff --git a/WikibaseQualityConstraints.php b/WikibaseQualityConstraints.php index e539c35..3ed73ba 100644 --- a/WikibaseQualityConstraints.php +++ b/WikibaseQualityConstraints.php @@ -12,7 +12,8 @@ 'author' => 'BP2014N1', 'url' => 'https://www.mediawiki.org/wiki/Extension:WikibaseQualityConstraints', 'descriptionmsg' => 'wbqc-desc', - 'version' => '1.0.0' + 'version' => '1.0.0', + 'license-name' => 'GPL-2.0+' ); // Initialize localization and aliases -- To view, visit https://gerrit.wikimedia.org/r/264551 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia4c6f2d50a1be1fd90c437146fb2f606bb763652 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add license-name to extension.json - change (mediawiki...WikibaseQuality)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/264550 Change subject: Add license-name to extension.json .. Add license-name to extension.json Change-Id: I0c829e20c0c1ca6c46ff34a6582247b326bc0748 --- M extension.json 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQuality refs/changes/50/264550/1 diff --git a/extension.json b/extension.json index bdfdc94..c11640e 100644 --- a/extension.json +++ b/extension.json @@ -6,6 +6,7 @@ "descriptionmsg": "wbq-desc", "version": "1.0.0", "type": "wikibase", + "license-name": "GPL-2.0+", "MessageDirs": { "WikibaseQuality": [ "i18n" -- To view, visit https://gerrit.wikimedia.org/r/264550 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c829e20c0c1ca6c46ff34a6582247b326bc0748 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQuality Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix extension credits path (for license link) - change (mediawiki...WikimediaBadges)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/264548 Change subject: Fix extension credits path (for license link) .. Fix extension credits path (for license link) and remove unused global. @todo convert the extension to use extension registration also the extension url to github is outdated but don't think we have anything better right now to link to. Change-Id: Ibc3bddf4fd650613ff8176008d2399851ed30174 --- M WikimediaBadges.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaBadges refs/changes/48/264548/1 diff --git a/WikimediaBadges.php b/WikimediaBadges.php index fab7388..03c96ed 100644 --- a/WikimediaBadges.php +++ b/WikimediaBadges.php @@ -32,10 +32,10 @@ $GLOBALS['wgMessagesDirs']['WikimediaBadges'] = __DIR__ . '/i18n'; $GLOBALS['wgExtensionFunctions'][] = function() { - global $wgExtensionCredits, $wgMessagesDirs, $wgHooks, $wgResourceModules; + global $wgExtensionCredits, $wgHooks, $wgResourceModules; $wgExtensionCredits['wikibase'][] = array( - 'path' => __DIR__, + 'path' => __FILE__, 'name' => 'WikimediaBadges', 'version' => WIKIMEDIA_BADGES_VERSION, 'author' => '[https://www.mediawiki.org/wiki/User:Bene* Bene*]', -- To view, visit https://gerrit.wikimedia.org/r/264548 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibc3bddf4fd650613ff8176008d2399851ed30174 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaBadges Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix typo SpecialVersion::getCreditsForExtension comments - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/264547 Change subject: Fix typo SpecialVersion::getCreditsForExtension comments .. Fix typo SpecialVersion::getCreditsForExtension comments Change-Id: I069bb79e18d0c2ffc41a96d0ef71b1d90aee0b75 --- M includes/specials/SpecialVersion.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/47/264547/1 diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 80560be..569069e 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -707,7 +707,7 @@ * - The name of (name), and URL link to (url), the extension * - Official version number (version) and if available version control system *revision (path), link, and date -* - If available the short name of the license (license-name) and a linke +* - If available the short name of the license (license-name) and a link *to ((LICENSE)|(COPYING))(\.txt)? if it exists. * - Description of extension (descriptionmsg or description) * - List of authors (author) and link to a ((AUTHORS)|(CREDITS))(\.txt)? file if it exists -- To view, visit https://gerrit.wikimedia.org/r/264547 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I069bb79e18d0c2ffc41a96d0ef71b1d90aee0b75 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix undefined property notice in ChangesList - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263921 Change subject: Fix undefined property notice in ChangesList .. Fix undefined property notice in ChangesList This comes from ApiQueryWatchlist, which calls ChangesList::isUnpatrolled with recent change row entries. Since If71af587, rc_log_type is now needed along with rc_patrolled. Bug: T123542 Change-Id: If6507121e59c53df925998f383c9bdf8f2936e37 --- M includes/api/ApiQueryWatchlist.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/21/263921/1 diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 75fc33e..9faf5b8 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -106,6 +106,7 @@ $this->addFieldsIf( 'rc_user_text', $this->fld_user ); $this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment ); $this->addFieldsIf( 'rc_patrolled', $this->fld_patrol ); + $this->addFieldsIf( 'rc_log_type', $this->fld_patrol ); $this->addFieldsIf( array( 'rc_old_len', 'rc_new_len' ), $this->fld_sizes ); $this->addFieldsIf( 'wl_notificationtimestamp', $this->fld_notificationtimestamp ); $this->addFieldsIf( -- To view, visit https://gerrit.wikimedia.org/r/263921 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If6507121e59c53df925998f383c9bdf8f2936e37 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix reference to old hooks class in database updates - change (mediawiki...GeoData)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263876 Change subject: Fix reference to old hooks class in database updates .. Fix reference to old hooks class in database updates Change-Id: I7bc63aaac26f8d25c6d343d2965f1d35591bb57e --- M includes/Hooks.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoData refs/changes/76/263876/1 diff --git a/includes/Hooks.php b/includes/Hooks.php index a876712..0ed9872 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -42,7 +42,7 @@ } else { $updater->addExtensionTable( 'geo_tags', "$dir/../sql/db-backed.sql" ); } - $updater->addExtensionUpdate( array( 'GeoDataHooks::upgradeToDecimal' ) ); + $updater->addExtensionUpdate( array( 'GeoData\Hooks::upgradeToDecimal' ) ); break; default: throw new MWException( 'GeoData extension currently supports only MySQL and SQLite' ); -- To view, visit https://gerrit.wikimedia.org/r/263876 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7bc63aaac26f8d25c6d343d2965f1d35591bb57e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GeoData Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix reference to old hooks class in database updates - change (mediawiki...GeoData)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263875 Change subject: Fix reference to old hooks class in database updates .. Fix reference to old hooks class in database updates Change-Id: I7bc63aaac26f8d25c6d343d2965f1d35591bb57e --- M includes/Hooks.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoData refs/changes/75/263875/1 diff --git a/includes/Hooks.php b/includes/Hooks.php index a876712..0ed9872 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -42,7 +42,7 @@ } else { $updater->addExtensionTable( 'geo_tags', "$dir/../sql/db-backed.sql" ); } - $updater->addExtensionUpdate( array( 'GeoDataHooks::upgradeToDecimal' ) ); + $updater->addExtensionUpdate( array( 'GeoData\Hooks::upgradeToDecimal' ) ); break; default: throw new MWException( 'GeoData extension currently supports only MySQL and SQLite' ); -- To view, visit https://gerrit.wikimedia.org/r/263875 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7bc63aaac26f8d25c6d343d2965f1d35591bb57e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GeoData Gerrit-Branch: wmf/1.27.0-wmf.10 Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update Wikidata - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263865 Change subject: Update Wikidata .. Update Wikidata allow disabling specific data types Change-Id: Iddd7554a123def3a0904a0dce69752fa37dd4cad --- M extensions/Wikidata 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/65/263865/1 diff --git a/extensions/Wikidata b/extensions/Wikidata index e1dd271..c7cf261 16 --- a/extensions/Wikidata +++ b/extensions/Wikidata -Subproject commit e1dd2715926a096c266f1f0a4fbb8737fa21339a +Subproject commit c7cf2617514d0c430bc368cb97a1b8c08db28b68 -- To view, visit https://gerrit.wikimedia.org/r/263865 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iddd7554a123def3a0904a0dce69752fa37dd4cad Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.27.0-wmf.10 Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update Wikidata - allow disabling data types - change (mediawiki...Wikidata)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263857 Change subject: Update Wikidata - allow disabling data types .. Update Wikidata - allow disabling data types e.g. external-identifiers that are not ready yet to deploy Change-Id: Ief437d4bf8054bfd1b27449b0f88e586be215935 --- M composer.lock M extensions/Wikibase/client/config/WikibaseClient.default.php M extensions/Wikibase/client/includes/WikibaseClient.php M extensions/Wikibase/docs/options.wiki M extensions/Wikibase/lib/config/WikibaseLib.default.php M extensions/Wikibase/lib/includes/DataTypeDefinitions.php M extensions/Wikibase/lib/tests/phpunit/DataTypeDefinitionsTest.php M extensions/Wikibase/repo/config/Wikibase.default.php M extensions/Wikibase/repo/includes/WikibaseRepo.php M vendor/composer/ClassLoader.php M vendor/composer/autoload_files.php M vendor/composer/autoload_real.php M vendor/composer/installed.json 13 files changed, 137 insertions(+), 76 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata refs/changes/57/263857/1 diff --git a/composer.lock b/composer.lock index c538093..6c47d7d 100644 --- a/composer.lock +++ b/composer.lock @@ -668,7 +668,7 @@ "version": "0.15.6", "source": { "type": "git", -"url": "https://github.com/wikimedia/data-values-value-view.git";, +"url": "https://gerrit.wikimedia.org/r/data-values/value-view";, "reference": "d4620fa54d0506f3319963592f9423473deca9d2" }, "dist": { @@ -1393,12 +1393,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";, -"reference": "06ee5284d4e0a378e40caf3498963dc576e836eb" +"reference": "0e38d250266d929976ac5b8aec810cda2447a75e" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/06ee5284d4e0a378e40caf3498963dc576e836eb";, -"reference": "06ee5284d4e0a378e40caf3498963dc576e836eb", +"url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/0e38d250266d929976ac5b8aec810cda2447a75e";, +"reference": "0e38d250266d929976ac5b8aec810cda2447a75e", "shasum": "" }, "require": { @@ -1469,7 +1469,7 @@ "wikibaserepo", "wikidata" ], -"time": "2016-01-11 21:20:36" +"time": "2016-01-13 08:06:44" }, { "name": "wikibase/wikimedia-badges", @@ -1511,7 +1511,7 @@ "support": { "irc": "irc://irc.freenode.net/wikidata" }, -"time": "2015-08-12 09:30:01" +"time": "2015-08-04 17:18:47" } ], "packages-dev": [], diff --git a/extensions/Wikibase/client/config/WikibaseClient.default.php b/extensions/Wikibase/client/config/WikibaseClient.default.php index 49c0dde..7c68e48 100644 --- a/extensions/Wikibase/client/config/WikibaseClient.default.php +++ b/extensions/Wikibase/client/config/WikibaseClient.default.php @@ -77,6 +77,18 @@ */ 'sharedCacheDuration' => 60 * 60, + /** +* List of data types (by data type id) not enabled on the wiki. +* This setting is intended to aid with deployment of new data types +* or on new Wikibase installs without items and properties yet. +* +* This setting should be consistent with the corresponding setting on the repo. +* +* WARNING: Disabling a data type after it is in use is dangerous +* and might break items. +*/ + 'disabledDataTypes' => array(), + // The type of object cache to use. Use CACHE_XXX constants. // This is both a repo and client setting, and should be set to the same value in // repo and clients for multiwiki setups. diff --git a/extensions/Wikibase/client/includes/WikibaseClient.php b/extensions/Wikibase/client/includes/WikibaseClient.php index c8ec0ab..29eb79f 100644 --- a/extensions/Wikibase/client/includes/WikibaseClient.php +++ b/extensions/Wikibase/client/includes/WikibaseClient.php @@ -485,10 +485,15 @@ $dataTypeDefinitions = $wgWBClientDataTypes; Hooks::run( 'WikibaseClientDataTypes', array( &$dataTypeDefinitions ) ); + $settings = new SettingsArray( $wgWBClientSettings ); + return new self( - new SettingsArray( $wgWBClientSettings ), + $settings, $wgContLang, -
[MediaWiki-commits] [Gerrit] Filter data type registrations with disabledDataTypes setting - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263800 Change subject: Filter data type registrations with disabledDataTypes setting .. Filter data type registrations with disabledDataTypes setting Removed the old (unused) dataTypes setting from lib and introduced a new 'disabledDataTypes' setting in client + repo. The disabledDataTypes setting can be used to define which data types are disabled for a wiki. Added documentation for the setting. The new data types registration system wasn't considering the dataTypes setting. We now have a hook to allow other extensions to add data types (e.g. math), so a setting that lists enabled types doesn't work so nicely with that. A setting that does the inverse can work for this. At least for Wikidata, we sometimes need to set this explicitly so we can deploy new data types in a more controlled way. The ability to enable only certain types might also be desired by some third party users. Bug: T123447 Change-Id: I07abc6bb5a785e2331bdc98412cf45a7160c5b9a --- M client/config/WikibaseClient.default.php M client/includes/WikibaseClient.php M docs/options.wiki M lib/config/WikibaseLib.default.php M lib/includes/DataTypeDefinitions.php M lib/tests/phpunit/DataTypeDefinitionsTest.php M repo/config/Wikibase.default.php M repo/includes/WikibaseRepo.php 8 files changed, 95 insertions(+), 28 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/00/263800/3 diff --git a/client/config/WikibaseClient.default.php b/client/config/WikibaseClient.default.php index 49c0dde..7c68e48 100644 --- a/client/config/WikibaseClient.default.php +++ b/client/config/WikibaseClient.default.php @@ -77,6 +77,18 @@ */ 'sharedCacheDuration' => 60 * 60, + /** +* List of data types (by data type id) not enabled on the wiki. +* This setting is intended to aid with deployment of new data types +* or on new Wikibase installs without items and properties yet. +* +* This setting should be consistent with the corresponding setting on the repo. +* +* WARNING: Disabling a data type after it is in use is dangerous +* and might break items. +*/ + 'disabledDataTypes' => array(), + // The type of object cache to use. Use CACHE_XXX constants. // This is both a repo and client setting, and should be set to the same value in // repo and clients for multiwiki setups. diff --git a/client/includes/WikibaseClient.php b/client/includes/WikibaseClient.php index c8ec0ab..29eb79f 100644 --- a/client/includes/WikibaseClient.php +++ b/client/includes/WikibaseClient.php @@ -485,10 +485,15 @@ $dataTypeDefinitions = $wgWBClientDataTypes; Hooks::run( 'WikibaseClientDataTypes', array( &$dataTypeDefinitions ) ); + $settings = new SettingsArray( $wgWBClientSettings ); + return new self( - new SettingsArray( $wgWBClientSettings ), + $settings, $wgContLang, - new DataTypeDefinitions( $dataTypeDefinitions ) + new DataTypeDefinitions( + $dataTypeDefinitions, + $settings->getSetting( 'disabledDataTypes' ) + ) ); } diff --git a/docs/options.wiki b/docs/options.wiki index aacf5d6..f574822 100644 --- a/docs/options.wiki +++ b/docs/options.wiki @@ -30,12 +30,10 @@ :'''Warning:''' do not change this if you already have Wikibase entities in your database, since they may become unreadable! ;useChangesTable: Whether to record changes in the database, so they can be pushed to clients. Boolean, defaults to true. May be set to false in situations where there are no clients to notify, to preserve space. '''Note''' that if this is true, the pruneChanges.php script should be run periodically to remove old changes from the database table. ;changeHandlers: Array mapping change type IDs to handler classes. May be used by extensions to register additional change classes. -;dataTypes: Array listing the available data types that can be used in snaks (and thus in claims and statements). The relevant data type identifiers are defined by the DataType extension. Default: +;disabledDataTypes: Array listing of disabled data types on a wiki. This setting is intended to be used a new Wikibase install without items yet, or to control deployment of new data types. This setting should be set the same in the client and repo settings. +Default: - array( - 'wikibase-item', - 'commonsMedia', - ) + array() ;maxSerialize
[MediaWiki-commits] [Gerrit] Explicitly define Wikibase data types - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263753 Change subject: Explicitly define Wikibase data types .. Explicitly define Wikibase data types we have new data types coming like external-identifier for which we want to deploy in a more coordinated manner than the train. (e.g. enable first on test.wikidata, then when enabled in production, ensure both clients + repo get it at the same time) Change-Id: I887a292874bdb503690560d3c2d67ee70928c569 --- M wmf-config/Wikibase-production.php 1 file changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/53/263753/1 diff --git a/wmf-config/Wikibase-production.php b/wmf-config/Wikibase-production.php index 553c9d7..82488e4 100644 --- a/wmf-config/Wikibase-production.php +++ b/wmf-config/Wikibase-production.php @@ -4,6 +4,20 @@ $wgMathEnableWikibaseDataType = false; if ( $wmgUseWikibaseRepo ) { + + // data types setting should be kept in sync with setting in client. + $wgWBRepoSettings['dataTypes'] = array( + 'commonsMedia', + 'globe-coordinate', + 'quantity', + 'monolingualtext', + 'string', + 'time', + 'url', + 'wikibase-item', + 'wikibase-property' + ); + if ( $wgDBname === 'testwikidatawiki' ) { $wgWBRepoSettings['formatterUrlProperty'] = 'P368'; @@ -97,4 +111,17 @@ 'Q20748092' => 'badge-proofread', 'Q20748093' => 'badge-validated' ); + + // dataTypes setting should be kept in sync with repo setting. + $wgWBClientSettings['dataTypes'] = array( + 'commonsMedia', + 'globe-coordinate', + 'quantity', + 'monolingualtext', + 'string', + 'time', + 'url', + 'wikibase-item', + 'wikibase-property', + ); } -- To view, visit https://gerrit.wikimedia.org/r/263753 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I887a292874bdb503690560d3c2d67ee70928c569 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused use statement in EntityDataSerializationServic... - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263574 Change subject: Remove unused use statement in EntityDataSerializationServiceTest .. Remove unused use statement in EntityDataSerializationServiceTest Change-Id: I2528547716d264aa7baede39c87cd2f26b2c2f70 --- M repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/74/263574/1 diff --git a/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php b/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php index cdca0ab..c0ac38e 100644 --- a/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php +++ b/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php @@ -14,7 +14,6 @@ use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\SerializerFactory; -use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\DataModel\Snak\PropertyValueSnak; use Wikibase\EntityRevision; use Wikibase\RedirectRevision; -- To view, visit https://gerrit.wikimedia.org/r/263574 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2528547716d264aa7baede39c87cd2f26b2c2f70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix param documentation in SqlChangeDispatchCoordinator - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263573 Change subject: Fix param documentation in SqlChangeDispatchCoordinator .. Fix param documentation in SqlChangeDispatchCoordinator Change-Id: Ib08b425c40ae2482dbf245c42a35ba0346861f1a --- M repo/includes/store/sql/SqlChangeDispatchCoordinator.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/73/263573/1 diff --git a/repo/includes/store/sql/SqlChangeDispatchCoordinator.php b/repo/includes/store/sql/SqlChangeDispatchCoordinator.php index aca8d36..2f31042 100644 --- a/repo/includes/store/sql/SqlChangeDispatchCoordinator.php +++ b/repo/includes/store/sql/SqlChangeDispatchCoordinator.php @@ -599,7 +599,7 @@ /** * Determines the name of the global lock that should be used to lock the given client. * -* @param string $siteID: The site ID of the wiki to lock +* @param string $siteID The site ID of the wiki to lock * * @return string the lock name to use. */ -- To view, visit https://gerrit.wikimedia.org/r/263573 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib08b425c40ae2482dbf245c42a35ba0346861f1a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Sort use statements in WikibaseRepo.php - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263569 Change subject: Sort use statements in WikibaseRepo.php .. Sort use statements in WikibaseRepo.php Change-Id: If78b2acc4a6b25bd6b68ef7d00e1a8118af2b1a8 --- M repo/includes/WikibaseRepo.php 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/69/263569/1 diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php index 3297c5f..8e9e0b7 100644 --- a/repo/includes/WikibaseRepo.php +++ b/repo/includes/WikibaseRepo.php @@ -19,39 +19,39 @@ use User; use ValueFormatters\FormatterOptions; use ValueFormatters\ValueFormatter; -use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\DataModel\Services\Lookup\InProcessCachingDataTypeLookup; -use Wikibase\Lib\DataTypeDefinitions; use Wikibase\ChangeOp\ChangeOpFactoryProvider; use Wikibase\DataModel\DeserializerFactory; -use Wikibase\DataModel\Entity\Item; -use Wikibase\DataModel\Entity\Property; -use Wikibase\DataModel\Services\Diff\EntityDiffer; use Wikibase\DataModel\Entity\BasicEntityIdParser; use Wikibase\DataModel\Entity\DispatchingEntityIdParser; use Wikibase\DataModel\Entity\EntityIdParser; +use Wikibase\DataModel\Entity\Item; +use Wikibase\DataModel\Entity\Property; +use Wikibase\DataModel\Entity\PropertyId; +use Wikibase\DataModel\Services\Diff\EntityDiffer; use Wikibase\DataModel\Services\EntityId\SuffixEntityIdParser; use Wikibase\DataModel\Services\Lookup\EntityLookup; use Wikibase\DataModel\Services\Lookup\EntityRetrievingDataTypeLookup; +use Wikibase\DataModel\Services\Lookup\InProcessCachingDataTypeLookup; use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup; use Wikibase\DataModel\Services\Lookup\TermLookup; use Wikibase\DataModel\Services\Statement\GuidGenerator; use Wikibase\DataModel\Services\Statement\StatementGuidParser; use Wikibase\DataModel\Services\Statement\StatementGuidValidator; +use Wikibase\DataModel\Services\Term\TermBuffer; use Wikibase\EditEntityFactory; use Wikibase\EntityFactory; -use Wikibase\Lib\WikibaseSnakFormatterBuilders; -use Wikibase\Repo\ParserOutput\EntityParserOutputGeneratorFactory; use Wikibase\InternalSerialization\DeserializerFactory as InternalDeserializerFactory; use Wikibase\InternalSerialization\SerializerFactory as InternalSerializerFactory; use Wikibase\LabelDescriptionDuplicateDetector; use Wikibase\LanguageFallbackChainFactory; use Wikibase\Lib\Changes\EntityChangeFactory; use Wikibase\Lib\ContentLanguages; +use Wikibase\Lib\DataTypeDefinitions; use Wikibase\Lib\EntityIdLinkFormatter; use Wikibase\Lib\EntityIdPlainLinkFormatter; use Wikibase\Lib\EntityIdValueFormatter; use Wikibase\Lib\FormatterLabelDescriptionLookupFactory; +use Wikibase\Lib\Interactors\TermIndexSearchInteractor; use Wikibase\Lib\LanguageNameLookup; use Wikibase\Lib\MediaWikiContentLanguages; use Wikibase\Lib\OutputFormatSnakFormatterFactory; @@ -66,10 +66,10 @@ use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory; use Wikibase\Lib\UnionContentLanguages; +use Wikibase\Lib\WikibaseSnakFormatterBuilders; use Wikibase\Lib\WikibaseValueFormatterBuilders; -use Wikibase\Lib\Interactors\TermIndexSearchInteractor; -use Wikibase\Rdf\ValueSnakRdfBuilderFactory; use Wikibase\PropertyInfoBuilder; +use Wikibase\Rdf\ValueSnakRdfBuilderFactory; use Wikibase\Repo\Api\ApiHelperFactory; use Wikibase\Repo\CachingCommonsMediaFileNameLookup; use Wikibase\Repo\Content\EntityContentFactory; @@ -89,6 +89,7 @@ use Wikibase\Repo\Notifications\ChangeTransmitter; use Wikibase\Repo\Notifications\DatabaseChangeTransmitter; use Wikibase\Repo\Notifications\HookChangeTransmitter; +use Wikibase\Repo\ParserOutput\EntityParserOutputGeneratorFactory; use Wikibase\Repo\Store\EntityPermissionChecker; use Wikibase\Repo\Validators\EntityConstraintProvider; use Wikibase\Repo\Validators\SnakValidator; @@ -100,7 +101,6 @@ use Wikibase\Store; use Wikibase\Store\BufferingTermLookup; use Wikibase\Store\EntityIdLookup; -use Wikibase\DataModel\Services\Term\TermBuffer; use Wikibase\StringNormalizer; use Wikibase\SummaryFormatter; use Wikibase\View\EntityViewFactory; -- To view, visit https://gerrit.wikimedia.org/r/263569 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If78b2acc4a6b25bd6b68ef7d00e1a8118af2b1a8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update watchers of target item when merging item into it - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263532 Change subject: Update watchers of target item when merging item into it .. Update watchers of target item when merging item into it Bug: T123226 Change-Id: I71d440541a0ace78e03920be64dc558649d32336 --- M repo/includes/Interactors/ItemMergeInteractor.php M repo/includes/WikibaseRepo.php M repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php M repo/tests/phpunit/includes/api/MergeItemsTest.php M repo/tests/phpunit/includes/specials/SpecialMergeItemsTest.php 5 files changed, 106 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/32/263532/3 diff --git a/repo/includes/Interactors/ItemMergeInteractor.php b/repo/includes/Interactors/ItemMergeInteractor.php index ffda49f..2257f4a 100644 --- a/repo/includes/Interactors/ItemMergeInteractor.php +++ b/repo/includes/Interactors/ItemMergeInteractor.php @@ -3,6 +3,7 @@ namespace Wikibase\Repo\Interactors; use User; +use WatchedItem; use Wikibase\ChangeOp\ChangeOpException; use Wikibase\ChangeOp\ChangeOpsMerge; use Wikibase\ChangeOp\MergeChangeOpsFactory; @@ -14,6 +15,7 @@ use Wikibase\EntityContent; use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\EntityStore; +use Wikibase\Lib\Store\EntityTitleLookup; use Wikibase\Lib\Store\StorageException; use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException; use Wikibase\Repo\Store\EntityPermissionChecker; @@ -66,6 +68,11 @@ private $interactorRedirect; /** +* @var EntityTitleLookup +*/ + private $entityTitleLookup; + + /** * @param MergeChangeOpsFactory $changeOpFactory * @param EntityRevisionLookup $entityRevisionLookup * @param EntityStore $entityStore @@ -73,6 +80,7 @@ * @param SummaryFormatter $summaryFormatter * @param User $user * @param RedirectCreationInteractor $interactorRedirect +* @param EntityTitleLookup $entityTitleLookup */ public function __construct( MergeChangeOpsFactory $changeOpFactory, @@ -81,7 +89,8 @@ EntityPermissionChecker $permissionChecker, SummaryFormatter $summaryFormatter, User $user, - RedirectCreationInteractor $interactorRedirect + RedirectCreationInteractor $interactorRedirect, + EntityTitleLookup $entityTitleLookup ) { $this->changeOpFactory = $changeOpFactory; @@ -91,6 +100,7 @@ $this->summaryFormatter = $summaryFormatter; $this->user = $user; $this->interactorRedirect = $interactorRedirect; + $this->entityTitleLookup = $entityTitleLookup; } /** @@ -182,6 +192,7 @@ } $result = $this->attemptSaveMerge( $fromItem, $toItem, $summary, $bot ); + $this->updateWatchlistEntries( $fromId, $toId ); $redirected = false; @@ -305,4 +316,22 @@ } } + /** +* @param ItemId $fromId +* @param ItemId $toId +* +* @throws ItemMergeException +*/ + private function updateWatchlistEntries( ItemId $fromId, ItemId $toId ) { + if ( $fromId->equals( $toId ) ) { + throw new ItemMergeException( 'Unable to update watchlist because new ItemId ' + . 'is same as old ItemId' ); + } + + $fromTitle = $this->entityTitleLookup->getTitleForId( $fromId ); + $toTitle = $this->entityTitleLookup->getTitleForId( $toId ); + + WatchedItem::duplicateEntries( $fromTitle, $toTitle ); + } + } diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php index 059ec9f..cb4ac11 100644 --- a/repo/includes/WikibaseRepo.php +++ b/repo/includes/WikibaseRepo.php @@ -1350,7 +1350,8 @@ $this->getEntityPermissionChecker(), $this->getSummaryFormatter(), $user, - $this->newRedirectCreationInteractor( $user, $context ) + $this->newRedirectCreationInteractor( $user, $context ), + $this->getEntityTitleLookup() ); } diff --git a/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php b/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php index c1efb0e..ab2773d 100644 --- a/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php +++ b/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php @@ -2,10 +2,12 @@ namespace Wikibase\Test\Interactors; +use ContentHandler; use HashSiteStore; use Status; use TestSites; use User; +use WatchedItem; use Wikiba
[MediaWiki-commits] [Gerrit] Use Title::equals in MovePage when updating watchlist entries - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263516 Change subject: Use Title::equals in MovePage when updating watchlist entries .. Use Title::equals in MovePage when updating watchlist entries Also, test for watchlist entries being updated in MovePageTest Change-Id: I91f9124e96cc9cad8e4fad4e00a0169693408ade --- M includes/MovePage.php M tests/phpunit/includes/MovePageTest.php 2 files changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/16/263516/1 diff --git a/includes/MovePage.php b/includes/MovePage.php index fb0ca8c..2d192cc 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -361,11 +361,7 @@ } # Update watchlists - $oldtitle = $this->oldTitle->getDBkey(); - $newtitle = $this->newTitle->getDBkey(); - $oldsnamespace = MWNamespace::getSubject( $this->oldTitle->getNamespace() ); - $newsnamespace = MWNamespace::getSubject( $this->newTitle->getNamespace() ); - if ( $oldsnamespace != $newsnamespace || $oldtitle != $newtitle ) { + if ( !$this->oldTitle->equals( $this->newTitle ) ) { WatchedItem::duplicateEntries( $this->oldTitle, $this->newTitle ); } diff --git a/tests/phpunit/includes/MovePageTest.php b/tests/phpunit/includes/MovePageTest.php index 0ef2fa6..6059248 100644 --- a/tests/phpunit/includes/MovePageTest.php +++ b/tests/phpunit/includes/MovePageTest.php @@ -52,6 +52,10 @@ WikiPage::factory( $newTitle )->getRevision() ); + $user = User::newFromName( 'UTSysop' ); + $watchedItem = WatchedItem::fromUserTitle( $user, $oldTitle ); + $watchedItem->addWatch(); + $this->assertTrue( $oldTitle->moveTo( $newTitle, false, 'test1', true ) ); $this->assertNotNull( WikiPage::factory( $oldTitle )->getRevision() @@ -59,5 +63,8 @@ $this->assertNotNull( WikiPage::factory( $newTitle )->getRevision() ); + + $newWatchedItem = WatchedItem::fromUserTitle( $user, $newTitle ); + $this->assertTrue( $newWatchedItem->isWatched(), 'Moved page is being watched' ); } } -- To view, visit https://gerrit.wikimedia.org/r/263516 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91f9124e96cc9cad8e4fad4e00a0169693408ade Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aude Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Require IContextSource as constructor param in EditFilterHoo... - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263433 Change subject: Require IContextSource as constructor param in EditFilterHookRunner .. Require IContextSource as constructor param in EditFilterHookRunner In places that I see, this always is provided already to the constructor. The hook expects IContextSource when it is run. Context is also always provided for WikibaseRepo::getApiHelperFactory, so we can remove the option of that being null there. WikibaseRepo::newEditEntityFactory sometimes has $context as null (from UpdateRepoOnDelete etc.) so we can allow that, and then default to RequestContext::getMain there. Change-Id: I3e82e8ff31d89930313c59a366214ea9faa2df53 --- M repo/includes/Hooks/EditFilterHookRunner.php M repo/includes/WikibaseRepo.php 2 files changed, 16 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/33/263433/1 diff --git a/repo/includes/Hooks/EditFilterHookRunner.php b/repo/includes/Hooks/EditFilterHookRunner.php index 0c482c0..07fe2a2 100644 --- a/repo/includes/Hooks/EditFilterHookRunner.php +++ b/repo/includes/Hooks/EditFilterHookRunner.php @@ -2,11 +2,9 @@ namespace Wikibase\Repo\Hooks; -use DerivativeContext; use Hooks; use IContextSource; use InvalidArgumentException; -use RequestContext; use RuntimeException; use Status; use Title; @@ -38,26 +36,20 @@ private $entityContentFactory; /** -* @var RequestContext|DerivativeContext +* @var IContextSource */ private $context; + /** +* @param EntityTitleLookup $titleLookup +* @param EntityContentFactory $entityContentFactory +* @param IContextSource $context +*/ public function __construct( EntityTitleLookup $titleLookup, EntityContentFactory $entityContentFactory, - $context = null + IContextSource $context ) { - if ( $context !== null - && !( $context instanceof RequestContext ) - && !( $context instanceof DerivativeContext ) ) { - throw new InvalidArgumentException( '$context must be an instance of RequestContext' - . ' or DerivativeContext' ); - } - - if ( $context === null ) { - $context = RequestContext::getMain(); - } - $this->titleLookup = $titleLookup; $this->entityContentFactory = $entityContentFactory; $this->context = $context; diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php index 3297c5f..cfe6ca3 100644 --- a/repo/includes/WikibaseRepo.php +++ b/repo/includes/WikibaseRepo.php @@ -12,6 +12,7 @@ use IContextSource; use Language; use MediaWiki\Site\MediaWikiPageNameNormalizer; +use RequestContext; use Serializers\Serializer; use SiteSQLStore; use SiteStore; @@ -520,11 +521,11 @@ } /** -* @param IContextSource|null $context +* @param IContextSource $context * * @return EditFilterHookRunner */ - private function newEditFilterHookRunner( IContextSource $context = null ) { + private function newEditFilterHookRunner( IContextSource $context ) { return new EditFilterHookRunner( $this->getEntityTitleLookup(), $this->getEntityContentFactory(), @@ -1296,11 +1297,11 @@ } /** -* @param IContextSource|null $context +* @param IContextSource $context * * @return ApiHelperFactory */ - public function getApiHelperFactory( IContextSource $context = null ) { + public function getApiHelperFactory( IContextSource $context ) { return new ApiHelperFactory( $this->getEntityTitleLookup(), $this->getExceptionLocalizer(), @@ -1319,6 +1320,10 @@ * @return EditEntityFactory */ public function newEditEntityFactory( IContextSource $context = null ) { + if ( $context === null ) { + $context = RequestContext::getMain(); + } + return new EditEntityFactory( $this->getEntityTitleLookup(), $this->getEntityRevisionLookup( 'uncached' ), -- To view, visit https://gerrit.wikimedia.org/r/263433 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e82e8ff31d89930313c59a366214ea9faa2df53 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing
[MediaWiki-commits] [Gerrit] Add newItemMergeInteractor method to WikibaseRepo factory - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263434 Change subject: Add newItemMergeInteractor method to WikibaseRepo factory .. Add newItemMergeInteractor method to WikibaseRepo factory instead of duplicating this twice, once in the api module and once for the special page. also add tests to WikibaseRepoTest Change-Id: I221b8500462d967605cac37c419be3f8e60a44ab --- M repo/includes/WikibaseRepo.php M repo/includes/api/MergeItems.php M repo/includes/specials/SpecialMergeItems.php M repo/tests/phpunit/includes/WikibaseRepoTest.php 4 files changed, 32 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/34/263434/1 diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php index cfe6ca3..059ec9f 100644 --- a/repo/includes/WikibaseRepo.php +++ b/repo/includes/WikibaseRepo.php @@ -77,6 +77,7 @@ use Wikibase\Repo\Content\ItemHandler; use Wikibase\Repo\Content\PropertyHandler; use Wikibase\Repo\Hooks\EditFilterHookRunner; +use Wikibase\Repo\Interactors\ItemMergeInteractor; use Wikibase\Repo\Interactors\RedirectCreationInteractor; use Wikibase\Repo\LinkedData\EntityDataFormatProvider; use Wikibase\Repo\Localizer\ChangeOpValidationExceptionLocalizer; @@ -1335,6 +1336,25 @@ } /** +* @param IContextSource $context +* +* @return ItemMergeInteractor +*/ + public function newItemMergeInteractor( IContextSource $context ) { + $user = $context->getUser(); + + return new ItemMergeInteractor( + $this->getChangeOpFactoryProvider()->getMergeChangeOpFactory(), + $this->getEntityRevisionLookup( 'uncached' ), + $this->getEntityStore(), + $this->getEntityPermissionChecker(), + $this->getSummaryFormatter(), + $user, + $this->newRedirectCreationInteractor( $user, $context ) + ); + } + + /** * @return EntityNamespaceLookup */ public function getEntityNamespaceLookup() { diff --git a/repo/includes/api/MergeItems.php b/repo/includes/api/MergeItems.php index 33c573a..083a4d2 100644 --- a/repo/includes/api/MergeItems.php +++ b/repo/includes/api/MergeItems.php @@ -65,15 +65,7 @@ $wikibaseRepo->getEntityIdParser(), $apiHelperFactory->getErrorReporter( $this ), $apiHelperFactory->getResultBuilder( $this ), - new ItemMergeInteractor( - $wikibaseRepo->getChangeOpFactoryProvider()->getMergeChangeOpFactory(), - $wikibaseRepo->getEntityRevisionLookup( 'uncached' ), - $wikibaseRepo->getEntityStore(), - $wikibaseRepo->getEntityPermissionChecker(), - $wikibaseRepo->getSummaryFormatter(), - $this->getUser(), - $wikibaseRepo->newRedirectCreationInteractor( $this->getUser(), $this->getContext() ) - ) + $wikibaseRepo->newItemMergeInteractor( $this->getContext() ) ); } diff --git a/repo/includes/specials/SpecialMergeItems.php b/repo/includes/specials/SpecialMergeItems.php index 47ec779..475622e 100644 --- a/repo/includes/specials/SpecialMergeItems.php +++ b/repo/includes/specials/SpecialMergeItems.php @@ -59,15 +59,7 @@ new TokenCheckInteractor( $this->getUser() ), - new ItemMergeInteractor( - $wikibaseRepo->getChangeOpFactoryProvider()->getMergeChangeOpFactory(), - $wikibaseRepo->getEntityRevisionLookup( 'uncached' ), - $wikibaseRepo->getEntityStore(), - $wikibaseRepo->getEntityPermissionChecker(), - $wikibaseRepo->getSummaryFormatter(), - $this->getUser(), - $wikibaseRepo->newRedirectCreationInteractor( $this->getUser(), $this->getContext() ) - ) + $wikibaseRepo->newItemMergeInteractor( $this->getContext() ) ); } diff --git a/repo/tests/phpunit/includes/WikibaseRepoTest.php b/repo/tests/phpunit/includes/WikibaseRepoTest.php index a8b71df..130254f 100644 --- a/repo/tests/phpunit/includes/WikibaseRepoTest.php +++ b/repo/tests/phpunit/includes/WikibaseRepoTest.php @@ -300,6 +300,16 @@ $this->assertInstanceOf( 'Wikibase\EditEntityFactory', $factory ); } + public function testNewEditEntityFact
[MediaWiki-commits] [Gerrit] Add Wikibase-labs.php and Wikibase-production.php to noc - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263370 Change subject: Add Wikibase-labs.php and Wikibase-production.php to noc .. Add Wikibase-labs.php and Wikibase-production.php to noc so these are also included in https://noc.wikimedia.org/conf/ Change-Id: I373e6e80bbb1026ab539751f1e901654ebea842d --- A docroot/noc/conf/Wikibase-labs.php.txt A docroot/noc/conf/Wikibase-production.php.txt 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/70/263370/1 diff --git a/docroot/noc/conf/Wikibase-labs.php.txt b/docroot/noc/conf/Wikibase-labs.php.txt new file mode 12 index 000..2e54341 --- /dev/null +++ b/docroot/noc/conf/Wikibase-labs.php.txt @@ -0,0 +1 @@ +../../../wmf-config/Wikibase-labs.php \ No newline at end of file diff --git a/docroot/noc/conf/Wikibase-production.php.txt b/docroot/noc/conf/Wikibase-production.php.txt new file mode 12 index 000..fe5d941 --- /dev/null +++ b/docroot/noc/conf/Wikibase-production.php.txt @@ -0,0 +1 @@ +../../../wmf-config/Wikibase-production.php \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/263370 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I373e6e80bbb1026ab539751f1e901654ebea842d Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update GeoData class reference (now that GeoData uses namesp... - change (mediawiki...MobileFrontend)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263366 Change subject: Update GeoData class reference (now that GeoData uses namespaces) .. Update GeoData class reference (now that GeoData uses namespaces) Change-Id: I46045fc2e05d3da4f541869dc92b2a8415122bdf Depends-On: I2a52a7f44f747cd13c34edd1ef19c96f66d548f0 --- M includes/skins/SkinMinerva.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/66/263366/1 diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index a3832f5..4474e35 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -443,7 +443,7 @@ // Nearby link (if supported) if ( $config->get( 'MFNearby' ) && - ( $config->get( 'MFNearbyEndpoint' ) || class_exists( 'GeoData' ) ) + ( $config->get( 'MFNearbyEndpoint' ) || class_exists( 'GeoData\GeoData' ) ) ) { $menu->insert( 'nearby', $isJSOnly = true ) ->addComponent( -- To view, visit https://gerrit.wikimedia.org/r/263366 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I46045fc2e05d3da4f541869dc92b2a8415122bdf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update references to GeoData classes (they now use namespaces) - change (mediawiki...MobileFrontend)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263365 Change subject: Update references to GeoData classes (they now use namespaces) .. Update references to GeoData classes (they now use namespaces) Change-Id: Ide0396d86576e6d83933e7efff24058dfea764b5 Depends-On: I2a52a7f44f747cd13c34edd1ef19c96f66d548f0 --- M includes/skins/SkinMinerva.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/65/263365/1 diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index a3832f5..4474e35 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -443,7 +443,7 @@ // Nearby link (if supported) if ( $config->get( 'MFNearby' ) && - ( $config->get( 'MFNearbyEndpoint' ) || class_exists( 'GeoData' ) ) + ( $config->get( 'MFNearbyEndpoint' ) || class_exists( 'GeoData\GeoData' ) ) ) { $menu->insert( 'nearby', $isJSOnly = true ) ->addComponent( -- To view, visit https://gerrit.wikimedia.org/r/263365 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide0396d86576e6d83933e7efff24058dfea764b5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set logos for mobile login page for Wikidata and Wikivoyage - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263201 Change subject: Set logos for mobile login page for Wikidata and Wikivoyage .. Set logos for mobile login page for Wikidata and Wikivoyage Changes the logo to the Wikidata and Wikivoyage logos, respectively, from the default Wikimedia logo on the mobile login page. (also sorted the list of site groups for this setting, so it's easier to notice ones missing) Bug: T123175 Change-Id: Ic9b15987c01aa6611bbd30f95885f10c0020c1e2 --- A images/mobile/wikidata.png A images/mobile/wikivoyage.png M wmf-config/InitialiseSettings.php 3 files changed, 11 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/01/263201/1 diff --git a/images/mobile/wikidata.png b/images/mobile/wikidata.png new file mode 100644 index 000..74f6e68 --- /dev/null +++ b/images/mobile/wikidata.png Binary files differ diff --git a/images/mobile/wikivoyage.png b/images/mobile/wikivoyage.png new file mode 100644 index 000..80c0bbd --- /dev/null +++ b/images/mobile/wikivoyage.png Binary files differ diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 2ab01b0..37acfeb 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -13548,18 +13548,21 @@ 'wmgMobileFrontendLogo' => array( 'default' => '/images/mobile/wikimedia.png', - 'mediawikiwiki' => '/images/mobile/mediawiki.png', - 'wikipedia' => '/images/mobile/W.png', - 'wikinews' => '/images/mobile/wikinews.png', - 'wiktionary' => '/images/mobile/wiktionary.png', - 'wikibooks' => '/images/mobile/wikibooks.png', - 'wikiversity' => '/images/mobile/wikiversity.png', - 'specieswiki' => '/images/mobile/wikispecies.png', 'commonswiki' => '/images/mobile/commons.png', - 'wikiquote' => '/images/mobile/wikiquote.png', + 'mediawikiwiki' => '/images/mobile/mediawiki.png', 'metawiki' => '/images/mobile/meta.png', + 'specieswiki' => '/images/mobile/wikispecies.png', + 'wikibooks' => '/images/mobile/wikibooks.png', + 'wikidata' => '/images/mobile/wikidata.png', + 'wikinews' => '/images/mobile/wikinews.png', + 'wikipedia' => '/images/mobile/W.png', + 'wikiquote' => '/images/mobile/wikiquote.png', 'wikisource' => '/images/mobile/wikisource.png', + 'wikiversity' => '/images/mobile/wikiversity.png', + 'wikivoyage' => '/images/mobile/wikivoyage.png', + 'wiktionary' => '/images/mobile/wiktionary.png', ), + 'wmgMobileUrlTemplate' => array( 'default' => '%h0.m.%h1.%h2', 'foundationwiki' => 'm.%h0.%h1', -- To view, visit https://gerrit.wikimedia.org/r/263201 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9b15987c01aa6611bbd30f95885f10c0020c1e2 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't run cirrus jobs in UsageTrackingIntegrationTest - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263150 Change subject: Don't run cirrus jobs in UsageTrackingIntegrationTest .. Don't run cirrus jobs in UsageTrackingIntegrationTest all this needs is to run refreshLinks this will probably help make these tests faster, as well. Bug: T123115 Change-Id: I449bab411efd69888a1cd8d8df1faf9c242a59c4 --- M client/tests/phpunit/includes/Usage/UsageTrackingIntegrationTest.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/50/263150/1 diff --git a/client/tests/phpunit/includes/Usage/UsageTrackingIntegrationTest.php b/client/tests/phpunit/includes/Usage/UsageTrackingIntegrationTest.php index bf951f4..c3ee1b8 100644 --- a/client/tests/phpunit/includes/Usage/UsageTrackingIntegrationTest.php +++ b/client/tests/phpunit/includes/Usage/UsageTrackingIntegrationTest.php @@ -67,7 +67,7 @@ $runner = new JobRunner(); $runner->run( array( - 'type' => false, + 'type' => 'refreshLinks', 'maxJobs' => false, 'maxTime' => false, 'throttle' => false, -- To view, visit https://gerrit.wikimedia.org/r/263150 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I449bab411efd69888a1cd8d8df1faf9c242a59c4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix long lines in WikiPageEntityStore - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263085 Change subject: Fix long lines in WikiPageEntityStore .. Fix long lines in WikiPageEntityStore and fixed a typo in one of the exception messages Change-Id: I2f3f18339dff3a414e9b23a18e43158c8b6e9b34 --- M repo/includes/store/sql/WikiPageEntityStore.php 1 file changed, 22 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/85/263085/1 diff --git a/repo/includes/store/sql/WikiPageEntityStore.php b/repo/includes/store/sql/WikiPageEntityStore.php index 746f024..e73aeed 100644 --- a/repo/includes/store/sql/WikiPageEntityStore.php +++ b/repo/includes/store/sql/WikiPageEntityStore.php @@ -119,7 +119,13 @@ * @throws StorageException * @return EntityRevision */ - public function saveEntity( EntityDocument $entity, $summary, User $user, $flags = 0, $baseRevId = false ) { + public function saveEntity( + EntityDocument $entity, + $summary, + User $user, + $flags = 0, + $baseRevId = false + ) { if ( $entity->getId() === null ) { if ( ( $flags & EDIT_NEW ) !== EDIT_NEW ) { throw new StorageException( Status::newFatal( 'edit-gone-missing' ) ); @@ -131,7 +137,11 @@ $content = $this->contentFactory->newFromEntity( $entity ); $revision = $this->saveEntityContent( $content, $summary, $user, $flags, $baseRevId ); - $entityRevision = new EntityRevision( $entity, $revision->getId(), $revision->getTimestamp() ); + $entityRevision = new EntityRevision( + $entity, + $revision->getId(), + $revision->getTimestamp() + ); $this->dispatcher->dispatch( 'entityUpdated', $entityRevision ); @@ -151,7 +161,13 @@ * @throws StorageException * @return int The new revision ID */ - public function saveRedirect( EntityRedirect $redirect, $summary, User $user, $flags = 0, $baseRevId = false ) { + public function saveRedirect( + EntityRedirect $redirect, + $summary, + User $user, + $flags = 0, + $baseRevId = false + ) { $content = $this->contentFactory->newFromRedirect( $redirect ); if ( !$content ) { @@ -264,7 +280,9 @@ $ok = $page->doDeleteArticle( $reason, false, 0, true, $error, $user ); if ( !$ok ) { - throw new StorageException( 'Faield to delete ' . $entityId->getSerialization(). ': ' . $error ); + throw new StorageException( + 'Failed to delete ' . $entityId->getSerialization(). ': ' . $error + ); } $this->dispatcher->dispatch( 'entityDeleted', $entityId ); -- To view, visit https://gerrit.wikimedia.org/r/263085 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f3f18339dff3a414e9b23a18e43158c8b6e9b34 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Optimize imports in SpecialConstraintReport.php - change (mediawiki...WikibaseQualityConstraints)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263025 Change subject: Optimize imports in SpecialConstraintReport.php .. Optimize imports in SpecialConstraintReport.php Change-Id: Id84de6d834aad1499a78fcde3474471c80fb8952 --- M specials/SpecialConstraintReport.php 1 file changed, 22 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints refs/changes/25/263025/1 diff --git a/specials/SpecialConstraintReport.php b/specials/SpecialConstraintReport.php index 6495c54..7d43083 100644 --- a/specials/SpecialConstraintReport.php +++ b/specials/SpecialConstraintReport.php @@ -2,37 +2,36 @@ namespace WikibaseQuality\ConstraintReport\Specials; -use UnexpectedValueException; -use InvalidArgumentException; -use SpecialPage; -use ValueFormatters\FormatterOptions; -use ValueFormatters\ValueFormatter; -use Wikibase\DataModel\Services\EntityId\EntityIdFormatter; -use HTMLForm; -use Wikibase\DataModel\Services\Lookup\EntityLookup; -use Wikibase\Lib\OutputFormatValueFormatterFactory; -use Wikibase\Lib\SnakFormatter; use DataValues; use DataValues\DataValue; +use HTMLForm; use Html; -use Wikibase\DataModel\Entity\Entity; -use Wikibase\DataModel\Entity\EntityId; -use Wikibase\DataModel\Entity\EntityIdParser; -use Wikibase\DataModel\Entity\EntityIdParsingException; -use Wikibase\DataModel\Entity\EntityIdValue; -use Wikibase\DataModel; -use Wikibase\DataModel\Entity\ItemId; -use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\Lib\Store\EntityTitleLookup; -use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory; -use Wikibase\Repo\EntityIdHtmlLinkFormatterFactory; -use Wikibase\Repo\EntityIdLabelFormatterFactory; -use Wikibase\Repo\WikibaseRepo; +use InvalidArgumentException; +use SpecialPage; +use UnexpectedValueException; +use ValueFormatters\FormatterOptions; +use ValueFormatters\ValueFormatter; use WikibaseQuality\ConstraintReport\ConstraintCheck\DelegatingConstraintChecker; use WikibaseQuality\ConstraintReport\ConstraintReportFactory; use WikibaseQuality\Html\HtmlTableBuilder; use WikibaseQuality\Html\HtmlTableCellBuilder; use WikibaseQuality\Html\HtmlTableHeaderBuilder; +use Wikibase\DataModel\Entity\Entity; +use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Entity\EntityIdParser; +use Wikibase\DataModel\Entity\EntityIdParsingException; +use Wikibase\DataModel\Entity\EntityIdValue; +use Wikibase\DataModel\Entity\ItemId; +use Wikibase\DataModel\Entity\PropertyId; +use Wikibase\DataModel\Services\EntityId\EntityIdFormatter; +use Wikibase\DataModel\Services\Lookup\EntityLookup; +use Wikibase\Lib\OutputFormatValueFormatterFactory; +use Wikibase\Lib\SnakFormatter; +use Wikibase\Lib\Store\EntityTitleLookup; +use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory; +use Wikibase\Repo\EntityIdHtmlLinkFormatterFactory; +use Wikibase\Repo\EntityIdLabelFormatterFactory; +use Wikibase\Repo\WikibaseRepo; /** * Class SpecialConstraintReport -- To view, visit https://gerrit.wikimedia.org/r/263025 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id84de6d834aad1499a78fcde3474471c80fb8952 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove reference to no longer existing class - change (mediawiki...WikibaseQualityConstraints)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/263026 Change subject: Remove reference to no longer existing class .. Remove reference to no longer existing class was removed in I52356dd Change-Id: Ibfd44615b12e4ec987d18672578b7c65035b1824 --- M specials/SpecialConstraintReport.php 1 file changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints refs/changes/26/263026/1 diff --git a/specials/SpecialConstraintReport.php b/specials/SpecialConstraintReport.php index 7d43083..64cbd0c 100644 --- a/specials/SpecialConstraintReport.php +++ b/specials/SpecialConstraintReport.php @@ -318,8 +318,6 @@ } /** -* @see SpecialCheckResultPage::executeCheck -* * @param Entity $entity * * @return CheckResult[] @@ -329,8 +327,6 @@ } /** -* @see SpecialCheckResultPage::buildResultTable -* * @param EntityId $entityId * @param array $results * @@ -715,8 +711,6 @@ } /** -* @see SpecialCheckResultPage::getStatusMapping -* * @return array */ private function getStatusMapping() { -- To view, visit https://gerrit.wikimedia.org/r/263026 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibfd44615b12e4ec987d18672578b7c65035b1824 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update usage of GeoData classes (which are being put in name... - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/262845 Change subject: Update usage of GeoData classes (which are being put in namespace) .. Update usage of GeoData classes (which are being put in namespace) Bug: T122339 Change-Id: Iaf4fd69ab2ad6171003b22f588badb5a970099cc Depends-On: I2a52a7f44f747cd13c34edd1ef19c96f66d548f0 --- M repo/includes/ParserOutput/EntityParserOutputGeneratorFactory.php M repo/includes/ParserOutput/GeoDataDataUpdater.php M repo/tests/phpunit/includes/ParserOutput/GeoDataDataUpdaterTest.php 3 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/45/262845/1 diff --git a/repo/includes/ParserOutput/EntityParserOutputGeneratorFactory.php b/repo/includes/ParserOutput/EntityParserOutputGeneratorFactory.php index d86123b..67cca21 100644 --- a/repo/includes/ParserOutput/EntityParserOutputGeneratorFactory.php +++ b/repo/includes/ParserOutput/EntityParserOutputGeneratorFactory.php @@ -179,7 +179,7 @@ $updaters[] = new PageImagesDataUpdater( $this->preferredPageImagesProperties ); } - if ( class_exists( 'GeoData' ) ) { + if ( class_exists( 'GeoData\GeoData' ) ) { $updaters[] = new GeoDataDataUpdater( $propertyDataTypeMatcher, $this->preferredGeoDataProperties, diff --git a/repo/includes/ParserOutput/GeoDataDataUpdater.php b/repo/includes/ParserOutput/GeoDataDataUpdater.php index 47a89fb..e4cc9e0 100644 --- a/repo/includes/ParserOutput/GeoDataDataUpdater.php +++ b/repo/includes/ParserOutput/GeoDataDataUpdater.php @@ -2,9 +2,9 @@ namespace Wikibase\Repo\ParserOutput; -use Coord; -use CoordinatesOutput; use DataValues\Geo\Values\GlobeCoordinateValue; +use GeoData\Coord; +use GeoData\CoordinatesOutput; use ParserOutput; use RuntimeException; use Wikibase\DataModel\Services\Entity\PropertyDataTypeMatcher; @@ -60,7 +60,7 @@ array $preferredPropertiesIds, array $globeUris ) { - if ( !class_exists( 'GeoData' ) ) { + if ( !class_exists( 'GeoData\GeoData' ) ) { throw new RuntimeException( 'GeoDataDataUpdater requires the GeoData extension ' . 'to be enabled' ); } diff --git a/repo/tests/phpunit/includes/ParserOutput/GeoDataDataUpdaterTest.php b/repo/tests/phpunit/includes/ParserOutput/GeoDataDataUpdaterTest.php index 5abd396..09ec66d 100644 --- a/repo/tests/phpunit/includes/ParserOutput/GeoDataDataUpdaterTest.php +++ b/repo/tests/phpunit/includes/ParserOutput/GeoDataDataUpdaterTest.php @@ -2,12 +2,12 @@ namespace Wikibase\Repo\Tests\ParserOutput; -use Coord; -use CoordinatesOutput; use DataValues\DataValue; use DataValues\Geo\Values\GlobeCoordinateValue; use DataValues\Geo\Values\LatLongValue; use DataValues\StringValue; +use GeoData\Coord; +use GeoData\CoordinatesOutput; use ParserOutput; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\PropertyId; @@ -33,7 +33,7 @@ class GeoDataDataUpdaterTest extends \MediaWikiTestCase { private function willSkipTests() { - if ( !class_exists( 'GeoData' ) ) { + if ( !class_exists( 'GeoData\GeoData' ) ) { return true; } return false; -- To view, visit https://gerrit.wikimedia.org/r/262845 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf4fd69ab2ad6171003b22f588badb5a970099cc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude 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 links and examples for api modules - change (mediawiki...CirrusSearch)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/262732 Change subject: Add links and examples for api modules .. Add links and examples for api modules so one can click the link from the apihelp pages Change-Id: I34c2d675f4f8a1bc63ebac24fc4333c324d1a75d --- M i18n/en.json M i18n/qqq.json M includes/Api/ConfigDump.php M includes/Api/MappingDump.php M includes/Api/SettingsDump.php 5 files changed, 40 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch refs/changes/32/262732/2 diff --git a/i18n/en.json b/i18n/en.json index 7e6ba48..976aea7 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -17,8 +17,11 @@ "cirrussearch-pref-label": "New search", "cirrussearch-pref-desc": "Try our new search which supports a greater number of languages, provides more up-to-date results, and can even find text inside of templates.", "apihelp-cirrus-config-dump-description": "Dump of CirrusSearch configuration.", + "apihelp-cirrus-config-dump-example": "Get a dump of CirrusSearch configuration.", "apihelp-cirrus-mapping-dump-description": "Dump of CirrusSearch mapping for this wiki.", + "apihelp-cirrus-mapping-dump-example": "Get a dump of the CirrusSearch mapping for this wiki.", "apihelp-cirrus-settings-dump-description": "Dump of CirrusSearch settings for this wiki.", + "apihelp-cirrus-settings-dump-example": "Get a dump of CirrusSearch settings for this wiki.", "apihelp-cirrus-suggest-description": "Suggest completions for search term.", "apihelp-cirrus-suggest-param-text": "Search term to provide completions for.", "apihelp-cirrus-suggest-param-limit": "How many results to return.", diff --git a/i18n/qqq.json b/i18n/qqq.json index 738e85c..9892d27 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -25,8 +25,11 @@ "cirrussearch-pref-label": "Preference label for option to enable CirrusSearch by default", "cirrussearch-pref-desc": "Description for option to enable CirrusSearch by default", "apihelp-cirrus-config-dump-description": "{{doc-apihelp-description|cirrus-config-dump}}", + "apihelp-cirrus-config-dump-example": "{{doc-apihelp-example|cirrus-config-dump}}", "apihelp-cirrus-mapping-dump-description": "{{doc-apihelp-description|cirrus-mapping-dump}}", + "apihelp-cirrus-mapping-dump-example": "{{doc-apihelp-example|cirrus-mapping-dump}}", "apihelp-cirrus-settings-dump-description": "{{doc-apihelp-description|cirrus-settings-dump}}", + "apihelp-cirrus-settings-dump-example": "{{doc-apihelp-example|cirrus-settings-dump}}", "apihelp-cirrus-suggest-description": "{{doc-apihelp-description|cirrus-suggest}}", "apihelp-cirrus-suggest-param-text": "{{doc-apihelp-param|cirrus-suggest|text}}", "apihelp-cirrus-suggest-param-limit": "{{doc-apihelp-param|cirrus-suggest|limit}}", diff --git a/includes/Api/ConfigDump.php b/includes/Api/ConfigDump.php index cf99198..f741ad5 100644 --- a/includes/Api/ConfigDump.php +++ b/includes/Api/ConfigDump.php @@ -48,4 +48,15 @@ public function getDescription() { return 'Dump of CirrusSearch configuration.'; } + + /** +* @see ApiBase::getExamplesMessages +*/ + protected function getExamplesMessages() { + return array( + 'action=cirrus-config-dump' => + 'apihelp-cirrus-config-dump-example' + ); + } + } diff --git a/includes/Api/MappingDump.php b/includes/Api/MappingDump.php index 4877f6c..3b38c32 100644 --- a/includes/Api/MappingDump.php +++ b/includes/Api/MappingDump.php @@ -40,4 +40,15 @@ public function getDescription() { return 'Dump of CirrusSearch mapping for this wiki.'; } + + /** +* @see ApiBase::getExamplesMessages +*/ + protected function getExamplesMessages() { + return array( + 'action=cirrus-mapping-dump' => + 'apihelp-cirrus-mapping-dump-example' + ); + } + } diff --git a/includes/Api/SettingsDump.php b/includes/Api/SettingsDump.php index 856c07a..67f8357 100644 --- a/includes/Api/SettingsDump.php +++ b/includes/Api/SettingsDump.php @@ -37,6 +37,17 @@ * @deprecated since MediaWiki core 1.25 */ public function getDescription() { - return 'Dump of CirrusSearch mapping for this wiki.'; + return 'Dump of CirrusSearch settings for this wiki.'; } + + /** +* @see ApiBase::getExamplesMessages +*/ + protected function getExamplesMessages() { + return array( + 'action=cirrus-settings-dump' => + 'apihelp-cirrus-settings-du
[MediaWiki-commits] [Gerrit] Fix comment typo in SearchIndexField interface - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/262715 Change subject: Fix comment typo in SearchIndexField interface .. Fix comment typo in SearchIndexField interface Change-Id: I86e4fd0a5720531ff7e3eacfb45853081d2b1a07 --- M repo/includes/Search/Elastic/Fields/SearchIndexField.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/15/262715/1 diff --git a/repo/includes/Search/Elastic/Fields/SearchIndexField.php b/repo/includes/Search/Elastic/Fields/SearchIndexField.php index 4365c59..eee59fc 100644 --- a/repo/includes/Search/Elastic/Fields/SearchIndexField.php +++ b/repo/includes/Search/Elastic/Fields/SearchIndexField.php @@ -5,7 +5,7 @@ use Wikibase\DataModel\Entity\EntityDocument; /** - * Each field is intended to be by CirrusSearch as an + * Each field is intended to be used by CirrusSearch as an * additional property of a page. * * The data returned by the field must match the field -- To view, visit https://gerrit.wikimedia.org/r/262715 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I86e4fd0a5720531ff7e3eacfb45853081d2b1a07 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused, deprecated ChangesList::usePatrol - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/262153 Change subject: Remove unused, deprecated ChangesList::usePatrol .. Remove unused, deprecated ChangesList::usePatrol Deprecated since 1.22 and not used in any extension hosted in Wikimedia git (and afaik elsewhere). Change-Id: I0974ba80b7ab21b056d7f16e936b5c564b562e6d --- M includes/changes/ChangesList.php 1 file changed, 0 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/53/262153/1 diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index 9567700..7eadcc8 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -482,20 +482,6 @@ } /** -* Check whether to enable recent changes patrol features -* -* @deprecated since 1.22 -* @return bool -*/ - public static function usePatrol() { - global $wgUser; - - wfDeprecated( __METHOD__, '1.22' ); - - return $wgUser->useRCPatrol(); - } - - /** * Returns the string which indicates the number of watching users * @param int $count Number of user watching a page * @return string -- To view, visit https://gerrit.wikimedia.org/r/262153 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0974ba80b7ab21b056d7f16e936b5c564b562e6d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix code style isses in SqlDumpMetInformationRepoTest - change (mediawiki...WikibaseQualityExternalValidation)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260732 Change subject: Fix code style isses in SqlDumpMetInformationRepoTest .. Fix code style isses in SqlDumpMetInformationRepoTest * for now, just convert spaces to tabs Change-Id: I4cad1ec9cd70f8da1384a5381ca60c6a59050e8d --- M tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php 1 file changed, 310 insertions(+), 310 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation refs/changes/32/260732/1 diff --git a/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php b/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php index 502bcc1..635aba3 100644 --- a/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php +++ b/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php @@ -22,279 +22,279 @@ */ class SqlDumpMetaInformationRepoTest extends \MediaWikiTestCase { -/** - * @var SqlDumpMetaInformationRepo - */ -private $dumpMetaInformationRepo; - -/** - * @var DumpMetaInformation[] - */ -private $dumpMetaInformation; - -public function __construct( $name = null, $data = array(), $dataName = null ) { -parent::__construct( $name, $data, $dataName ); - -// Create example dump meta information -$this->dumpMetaInformation = array( -'foo' => new DumpMetaInformation( -'foo', -new ItemId( 'Q1' ), -array( new PropertyId( 'P1' ) ), -'2015010100', -'en', -'http://www.foo.bar', -42, -new ItemId( 'Q6938433' ) -), -'bar' => new DumpMetaInformation( -'bar', -new ItemId( 'Q2' ), -array( new PropertyId( 'P2' ) ), -'20200101121212', -'de', -'http://www.fu.bar', -4242, -new ItemId( 'Q6938433' ) -), -'baz' => new DumpMetaInformation( -'baz', -new ItemId( 'Q3' ), -array( -new PropertyId( 'P2' ), -new PropertyId( 'P3' ) -), -'20250101131313', -'de', -'http://www.fu.baz', -424242, -new ItemId( 'Q6938433' ) -) -); -} - - protected function setUp() { -parent::setUp(); - -$this->tablesUsed[] = SqlDumpMetaInformationRepo::META_TABLE_NAME; -$this->tablesUsed[] = SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME; - -$this->dumpMetaInformationRepo = new SqlDumpMetaInformationRepo( new BasicEntityIdParser() ); -} - -public function tearDown() { -unset( $this->dumpMetaInformationRepo ); - -parent::tearDown(); -} - -/** - * Adds temporary test data to database - * - * @throws \DBUnexpectedError - */ -public function addDBData() { -$this->db->delete( -SqlDumpMetaInformationRepo::META_TABLE_NAME, -'*' -); -$this->db->delete( -SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME, -'*' -); - -foreach ( $this->dumpMetaInformation as $dumpMetaInformation ) { -$this->db->insert( -SqlDumpMetaInformationRepo::META_TABLE_NAME, -array( -'id' => $dumpMetaInformation->getDumpId(), -'source_qid' => $dumpMetaInformation->getSourceItemId()->getSerialization(), -'import_date' => $this->db->timestamp( $dumpMetaInformation->getImportDate() ), -'language' => $dumpMetaInformation->getLanguageCode(), -'source_url' => $dumpMetaInformation->getSourceUrl(), -'size' => $dumpMetaInformation->getSize(), -'license_qid' => $dumpMetaInformation->getLicenseItemId() -) -); -foreach ( $dumpMetaInformation->getIdentifierPropertyIds() as $propertyId ) { -$this->db->insert( - SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME, -array( -'dump_id' => $dumpMetaInformation->getDumpId(), -'identifier_pid' => $propertyId->getSerialization() -) -); -} -} -} + /** +* @var SqlDumpMetaInformationRepo +*/ + private $dumpMetaInformationRepo; /** - * @dataProvider getWithIdDataProvider - */ -public function testGetWithId( $dumpId, $expectedDumpMetaInformation, $expectedException = null ) { -
[MediaWiki-commits] [Gerrit] Fix long line in SerializerFactoryTest - change (mediawiki...WikibaseQualityExternalValidation)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260733 Change subject: Fix long line in SerializerFactoryTest .. Fix long line in SerializerFactoryTest Change-Id: I570b5036e38fe203616ca72fad563478d4611dbb --- M tests/phpunit/Serializer/SerializerFactoryTest.php 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation refs/changes/33/260733/1 diff --git a/tests/phpunit/Serializer/SerializerFactoryTest.php b/tests/phpunit/Serializer/SerializerFactoryTest.php index 80448d0..896c7f6 100644 --- a/tests/phpunit/Serializer/SerializerFactoryTest.php +++ b/tests/phpunit/Serializer/SerializerFactoryTest.php @@ -99,8 +99,11 @@ } private function buildSerializerFactory() { - $dataValueSerializer = new DataValueSerializer(); - return new SerializerFactory( $dataValueSerializer, new ReferenceSerializer( new SnakListSerializer( new SnakSerializer( $dataValueSerializer ), false ) ) ); + $referenceSerializer = new ReferenceSerializer( + new SnakListSerializer( new SnakSerializer( new DataValueSerializer() ), false ) + ); + + return new SerializerFactory( $dataValueSerializer, $referenceSeruakuzer (; } private function assertSerializesWithoutException( Serializer $serializer, $object ) { -- To view, visit https://gerrit.wikimedia.org/r/260733 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I570b5036e38fe203616ca72fad563478d4611dbb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix code style issues in SpecialExternalDbsTest - change (mediawiki...WikibaseQualityExternalValidation)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260730 Change subject: Fix code style issues in SpecialExternalDbsTest .. Fix code style issues in SpecialExternalDbsTest * convert spaces to tabs * fix spacing inside parenthesis Change-Id: I504e969cbbb0bac8a9a05529965ff38c47ba25d0 --- M tests/phpunit/Specials/SpecialExternalDbsTest.php 1 file changed, 164 insertions(+), 164 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation refs/changes/30/260730/1 diff --git a/tests/phpunit/Specials/SpecialExternalDbsTest.php b/tests/phpunit/Specials/SpecialExternalDbsTest.php index b4f2461..0dd5a16 100644 --- a/tests/phpunit/Specials/SpecialExternalDbsTest.php +++ b/tests/phpunit/Specials/SpecialExternalDbsTest.php @@ -26,14 +26,14 @@ */ class SpecialExternalDbsTest extends SpecialPageTestBase { -protected function setUp() { -parent::setUp(); + protected function setUp() { + parent::setUp(); -$this->tablesUsed[ ] = SqlDumpMetaInformationRepo::META_TABLE_NAME; -$this->tablesUsed[ ] = SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME; -} + $this->tablesUsed[ ] = SqlDumpMetaInformationRepo::META_TABLE_NAME; + $this->tablesUsed[ ] = SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME; + } -protected function newSpecialPage() { + protected function newSpecialPage() { $externalValidationFactory = ExternalValidationServices::getDefaultInstance(); $wikibaseRepo = WikibaseRepo::getDefaultInstance(); @@ -42,190 +42,190 @@ $wikibaseRepo->getEntityIdHtmlLinkFormatterFactory(), $externalValidationFactory->getDumpMetaInformationLookup() ); -} + } -/** - * Adds temporary test data to database - * @throws \DBUnexpectedError - */ -public function addDBData() { -// Truncate table -$this->db->delete( -SqlDumpMetaInformationRepo::META_TABLE_NAME, -'*' -); -$this->db->delete( -SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME, -'*' -); + /** +* Adds temporary test data to database +* @throws \DBUnexpectedError +*/ + public function addDBData() { + // Truncate table + $this->db->delete( + SqlDumpMetaInformationRepo::META_TABLE_NAME, + '*' + ); + $this->db->delete( + SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME, + '*' + ); -$this->db->insert( -SqlDumpMetaInformationRepo::META_TABLE_NAME, -array( -'id' => 'foobar', -'source_qid' => 'Q36578', -'import_date' => '2015010100', -'language' => 'en', -'source_url' => 'http://www.foo.bar', -'size' => 42, -'license_qid' => 'Q6938433' -) -); -$this->db->insert( -SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME, -array( -'dump_id' => 'foobar', -'identifier_pid' => 'P227' -) -); -} + $this->db->insert( + SqlDumpMetaInformationRepo::META_TABLE_NAME, + array( + 'id' => 'foobar', + 'source_qid' => 'Q36578', + 'import_date' => '2015010100', + 'language' => 'en', + 'source_url' => 'http://www.foo.bar', + 'size' => 42, + 'license_qid' => 'Q6938433' + ) + ); + $this->db->insert( + SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME, + array( + 'dump_id' => 'foobar', + 'identifier_pid' => 'P227' + ) + ); + } -/** - * @dataProvider executeProvider - */ -public function testExecute( $subPage, $request, $userLanguage, $matchers ) { -$request = new \FauxRequest( $request ); + /** +* @dataProvider executeProvider +*/ + public function testExecute( $subPage, $request, $userLanguage, $matchers ) { + $request = new \FauxRequest( $request ); -// Truncate table if checking for no database available -if ( isset( $matchers['no databases'] ) ) { -$this->db->delete( -
[MediaWiki-commits] [Gerrit] Fix code style issues in SpecialCrossCheckTest - change (mediawiki...WikibaseQualityExternalValidation)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260728 Change subject: Fix code style issues in SpecialCrossCheckTest .. Fix code style issues in SpecialCrossCheckTest * fix spacing between parenthesis * fix extra long lines * reorder/optimize imports Change-Id: Iaf8a9ec96b5a005d853d1c90193aab8a2925bd6e --- M tests/phpunit/Specials/SpecialCrossCheckTest.php 1 file changed, 77 insertions(+), 62 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation refs/changes/28/260728/1 diff --git a/tests/phpunit/Specials/SpecialCrossCheckTest.php b/tests/phpunit/Specials/SpecialCrossCheckTest.php index fbce139..ce9fad9 100644 --- a/tests/phpunit/Specials/SpecialCrossCheckTest.php +++ b/tests/phpunit/Specials/SpecialCrossCheckTest.php @@ -2,24 +2,25 @@ namespace WikibaseQuality\ExternalValidation\Tests\Specials\SpecialCrossCheck; +use FauxRequest; use SpecialPageTestBase; +use DataValues\StringValue; +use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\EntityIdValue; +use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; +use Wikibase\DataModel\Entity\Property; use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\DataModel\Services\Statement\V4GuidGenerator; +use Wikibase\DataModel\Snak\PropertyValueSnak; +use Wikibase\DataModel\Statement\Statement; use Wikibase\DataModel\Statement\StatementGuid; +use Wikibase\DataModel\Services\Statement\V4GuidGenerator; use Wikibase\Repo\EntityIdLabelFormatterFactory; +use Wikibase\Repo\WikibaseRepo; use WikibaseQuality\ExternalValidation\DumpMetaInformation\SqlDumpMetaInformationRepo; use WikibaseQuality\ExternalValidation\ExternalDataRepo; use WikibaseQuality\ExternalValidation\ExternalValidationServices; use WikibaseQuality\ExternalValidation\Specials\SpecialCrossCheck; -use DataValues\StringValue; -use Wikibase\DataModel\Entity\Item; -use Wikibase\DataModel\Entity\Property; -use Wikibase\DataModel\Snak\PropertyValueSnak; -use Wikibase\DataModel\Statement\Statement; -use Wikibase\Repo\WikibaseRepo; -use Wikibase\DataModel\Entity\EntityId; /** * @covers WikibaseQuality\ExternalValidation\Specials\SpecialCrossCheck @@ -94,70 +95,68 @@ * @throws \DBUnexpectedError */ public function addDBData() { - if (!self::$hasSetup) { + if ( !self::$hasSetup ) { $store = WikibaseRepo::getDefaultInstance()->getEntityStore(); - $propertyP1 = Property::newFromType('string'); - $store->saveEntity($propertyP1, 'TestEntityP1', $GLOBALS['wgUser'], EDIT_NEW); + $propertyP1 = Property::newFromType( 'string' ); + $store->saveEntity( $propertyP1, 'TestEntityP1', $GLOBALS['wgUser'], EDIT_NEW ); self::$idMap['P1'] = $propertyP1->getId(); - $propertyP2 = Property::newFromType('string'); - $store->saveEntity($propertyP2, 'TestEntityP2', $GLOBALS['wgUser'], EDIT_NEW); + $propertyP2 = Property::newFromType( 'string' ); + $store->saveEntity( $propertyP2, 'TestEntityP2', $GLOBALS['wgUser'], EDIT_NEW ); self::$idMap['P2'] = $propertyP2->getId(); - $propertyP3 = Property::newFromType('string'); - $store->saveEntity($propertyP3, 'TestEntityP3', $GLOBALS['wgUser'], EDIT_NEW); + $propertyP3 = Property::newFromType( 'string' ); + $store->saveEntity( $propertyP3, 'TestEntityP3', $GLOBALS['wgUser'], EDIT_NEW ); self::$idMap['P3'] = $propertyP3->getId(); - $propertyP4 = Property::newFromType('string'); - $store->saveEntity($propertyP4, 'TestEntityP4', $GLOBALS['wgUser'], EDIT_NEW); + $propertyP4 = Property::newFromType( 'string' ); + $store->saveEntity( $propertyP4, 'TestEntityP4', $GLOBALS['wgUser'], EDIT_NEW ); self::$idMap['P4'] = $propertyP4->getId(); $itemQ1 = new Item(); - $store->saveEntity($itemQ1, 'TestEntityQ1', $GLOBALS['wgUser'], EDIT_NEW); + $store->saveEntity( $itemQ1, 'TestEntityQ1', $GLOBALS['wgUser'], EDIT_NEW ); self::$idMap['Q1'] = $itemQ1->getId(); - $guidGenerator = new V4GuidGenerator(); + $dataValue = new EntityIdValue( new ItemId( IDENTIFIER_PROPERTY_QID ) ); + $snak = new PropertyValueSnak( new PropertyId( INSTANCE_OF_PID ), $dataValue ); + $guid = $this->makeStatementGuid( self::$idMap['P3'] ); + $propertyP3->getStatements()->addNewStatemen
[MediaWiki-commits] [Gerrit] Shorten long lines of code in RunCrossCheckTest - change (mediawiki...WikibaseQualityExternalValidation)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260726 Change subject: Shorten long lines of code in RunCrossCheckTest .. Shorten long lines of code in RunCrossCheckTest with small amount of refactoring of guid generation in the tests, to help with the long lines and improve the code. Change-Id: Icdcd8ff94ab5d266a3ff597bc3ad69d16bc81178 --- M tests/phpunit/Api/RunCrossCheckTest.php 1 file changed, 23 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation refs/changes/26/260726/1 diff --git a/tests/phpunit/Api/RunCrossCheckTest.php b/tests/phpunit/Api/RunCrossCheckTest.php index 3347625..e1f6e7b 100644 --- a/tests/phpunit/Api/RunCrossCheckTest.php +++ b/tests/phpunit/Api/RunCrossCheckTest.php @@ -91,29 +91,27 @@ $store->saveEntity( $itemQ1, 'TestEntityQ1', $GLOBALS['wgUser'], EDIT_NEW ); self::$idMap['Q1'] = $itemQ1->getId(); - $guidGenerator = new V4GuidGenerator(); - $dataValue = new EntityIdValue( new ItemId( IDENTIFIER_PROPERTY_QID ) ); $snak = new PropertyValueSnak( new PropertyId( INSTANCE_OF_PID ), $dataValue ); - $guid = self::$idMap['P3']->getSerialization() . StatementGuid::SEPARATOR . $guidGenerator->newGuid(); + $guid = $this->makeStatementGuid( self::$idMap['P3'] ); $propertyP3->getStatements()->addNewStatement( $snak, null, null, $guid ); $store->saveEntity( $propertyP3, 'TestEntityP3', $GLOBALS['wgUser'], EDIT_UPDATE ); $dataValue = new StringValue( 'foo' ); $snak = new PropertyValueSnak( self::$idMap['P1'], $dataValue ); - $guid = self::$idMap['Q1']->getSerialization() . StatementGuid::SEPARATOR . $guidGenerator->newGuid(); + $guid = $this->makeStatementGuid( self::$idMap['Q1'] ); self::$claimGuids['P1'] = $guid; $itemQ1->getStatements()->addNewStatement( $snak, null, null, $guid ); $dataValue = new StringValue( 'baz' ); $snak = new PropertyValueSnak( self::$idMap['P2'], $dataValue ); - $guid = self::$idMap['Q1']->getSerialization() . StatementGuid::SEPARATOR . $guidGenerator->newGuid(); + $guid = $this->makeStatementGuid( self::$idMap['Q1'] ); self::$claimGuids['P2'] = $guid; $itemQ1->getStatements()->addNewStatement( $snak, null, null, $guid ); $dataValue = new StringValue( '1234' ); $snak = new PropertyValueSnak( self::$idMap['P3'], $dataValue ); - $guid = self::$idMap['Q1']->getSerialization() . StatementGuid::SEPARATOR . $guidGenerator->newGuid(); + $guid = $this->makeStatementGuid( self::$idMap['Q1'] ); self::$claimGuids['P3'] = $guid; $itemQ1->getStatements()->addNewStatement( $snak, null, null, $guid ); @@ -175,13 +173,24 @@ ); } + private function makeStatementGuid( EntityId $id ) { + $guidGenerator = new V4GuidGenerator(); + + return $id->getSerialization() . StatementGuid::SEPARATOR . $guidGenerator->newGuid(); + } + public function testExecuteInvalidParams() { $params = array( 'action' => 'wbqevcrosscheck', 'entities' => 'Q1', 'claims' => 'randomClaimGuid' ); - $this->setExpectedException( 'UsageException', 'Either provide the ids of entities or ids of claims, that should be cross-checked.' ); + + $this->setExpectedException( + 'UsageException', + 'Either provide the ids of entities or ids of claims, that should be cross-checked.' + ); + $this->doApiRequest( $params ); } @@ -189,7 +198,13 @@ $params = array( 'action' => 'wbqevcrosscheck' ); - $this->setExpectedException( 'UsageException', 'A parameter that is required was missing (Either provide the ids of entities or ids of claims, that should be cross-checked.)' ); + + $this->setExpectedException( + 'UsageException', + 'A parameter that is required was missing (Either provide the ids of entities or ' + . 'ids of claims, that should be cross-checked.)' + ); + $this->doApiRequest( $params ); } -- To view, visit https://ge
[MediaWiki-commits] [Gerrit] Fix spacing in ExternalDataRepoTest - change (mediawiki...WikibaseQualityExternalValidation)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260725 Change subject: Fix spacing in ExternalDataRepoTest .. Fix spacing in ExternalDataRepoTest per MediaWiki code style Change-Id: Ib17306a261cd357b166bd0ee261fa96298b55e6b --- M tests/phpunit/ExternalDataRepoTest.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation refs/changes/25/260725/1 diff --git a/tests/phpunit/ExternalDataRepoTest.php b/tests/phpunit/ExternalDataRepoTest.php index daf525a..9df35a9 100644 --- a/tests/phpunit/ExternalDataRepoTest.php +++ b/tests/phpunit/ExternalDataRepoTest.php @@ -152,7 +152,7 @@ ), array( array( 42 ), - array('foo', 'bar'), + array( 'foo', 'bar' ), array( new PropertyId( 'P1' ), new PropertyId( 'P3' ) @@ -172,13 +172,13 @@ ), array( array(), - array('foo', 'bar'), + array( 'foo', 'bar' ), array(), null, 'InvalidArgumentException' ), array( - array('foo', 'bar'), + array( 'foo', 'bar' ), array(), array(), null, -- To view, visit https://gerrit.wikimedia.org/r/260725 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib17306a261cd357b166bd0ee261fa96298b55e6b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] New Wikidata build - 2015-12-23 - change (mediawiki...Wikidata)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260722 Change subject: New Wikidata build - 2015-12-23 .. New Wikidata build - 2015-12-23 Change-Id: Ia88df108097397ddb8f64920bf9e3761fef3 --- M Wikidata.php M composer.lock M extensions/Wikibase/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibrary.php M extensions/Wikibase/client/includes/Hooks/ParserFunctionRegistrant.php M extensions/Wikibase/client/tests/phpunit/includes/WikibaseClientTest.php M extensions/Wikibase/client/tests/phpunit/includes/recentchanges/ChangeLineFormatterTest.php M extensions/Wikibase/lib/i18n/gl.json M extensions/Wikibase/lib/tests/phpunit/store/ChunkCacheTest.php M extensions/Wikibase/repo/i18n/gl.json M extensions/Wikibase/repo/i18n/nap.json M extensions/Wikibase/repo/includes/Diff/ClaimDifference.php M extensions/Wikibase/repo/includes/Search/Elastic/Fields/WikibaseFieldDefinitions.php M extensions/Wikibase/repo/includes/api/EditEntity.php M extensions/Wikibase/repo/includes/api/ModifyEntity.php M extensions/Wikibase/repo/maintenance/dumpJson.php M extensions/Wikibase/repo/maintenance/dumpRdf.php M extensions/Wikibase/repo/maintenance/importProperties.php D extensions/Wikibase/repo/tests/browser A extensions/Wikibase/repo/tests/browser M extensions/Wikibase/repo/tests/phpunit/includes/Search/Elastic/Fields/LabelCountFieldTest.php M extensions/Wikibase/repo/tests/phpunit/includes/Search/Elastic/Fields/SiteLinkCountFieldTest.php M extensions/Wikibase/repo/tests/phpunit/includes/Search/Elastic/Fields/StatementCountFieldTest.php M extensions/Wikibase/repo/tests/phpunit/includes/Search/Elastic/Fields/WikibaseFieldDefinitionsTest.php M extensions/Wikibase/repo/tests/phpunit/includes/WikibaseRepoTest.php M extensions/Wikibase/repo/tests/phpunit/includes/api/EntitySavingHelperTest.php M extensions/Wikibase/repo/tests/phpunit/includes/api/MergeItemsTest.php M extensions/Wikibase/view/resources/jquery/wikibase/toolbar/controller/definitions/removetoolbar/referenceview.js M extensions/Wikibase/view/resources/wikibase/view/ViewFactory.js M extensions/Wikibase/view/src/Module/TemplateModule.php M vendor/composer/ClassLoader.php M vendor/composer/autoload_classmap.php M vendor/composer/autoload_files.php M vendor/composer/autoload_real.php M vendor/composer/installed.json 34 files changed, 279 insertions(+), 124 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata refs/changes/22/260722/1 diff --git a/Wikidata.php b/Wikidata.php index 49542c6..23597f6 100644 --- a/Wikidata.php +++ b/Wikidata.php @@ -5,11 +5,6 @@ // Jenkins stuff part1 if ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI == true ) { - // in future, run as non-experimental - if ( !defined( 'WB_EXPERIMENTAL_FEATURES' ) || !WB_EXPERIMENTAL_FEATURES ) { - define( 'WB_EXPERIMENTAL_FEATURES', true ); - } - $wmgUseWikibaseRepo = true; $wmgUseWikibaseClient = true; $wmgUseWikibaseQuality = true; diff --git a/composer.lock b/composer.lock index fedc1bf..266ada5 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,11 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", -"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file";, +"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file";, "This file is @generated automatically" ], "hash": "1e3a244861d7d7425e3d99bb856a9156", +"content-hash": "a0ce186486af5bfadffd8394542dcc35", "packages": [ { "name": "composer/installers", @@ -1448,12 +1449,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";, -"reference": "f010dd83c4a1f4f45b18a0ddf0ac66d228095bdd" +"reference": "c2ffce0da46eeea847a8f2ea5d6a686102b7158c" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/f010dd83c4a1f4f45b18a0ddf0ac66d228095bdd";, -"reference": "f010dd83c4a1f4f45b18a0ddf0ac66d228095bdd", +"url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/c2ffce0da46eeea847a8f2ea5d6a686102b7158c";, +"reference": "c2ffce0da46eeea847a8f2ea5d6a686102b7158c", "shasum": "" }, "require": { @@ -1524,7 +1525,7 @@ "wikibaserepo", "wikidata" ], -"time": "2015-12-21 21:07:44" +"time": "2015-12-23 08:26:16" }, { "name": "wikibase/wikimedia-badges", diff --git a/extensions/Wikibase/client/inc
[MediaWiki-commits] [Gerrit] Use common baserevid for label and description changes [WIP] - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260585 Change subject: Use common baserevid for label and description changes [WIP] .. Use common baserevid for label and description changes [WIP] I am not sure the reason we stored separate revision ids for different parts of the entity. Unless we have good reason, then I think RevisionStore should just store a single baserevid. Bug: T121395 Change-Id: Ie37188862505e4c363650e434f092b44bc678143 --- M view/resources/wikibase/entityChangers/DescriptionsChanger.js M view/resources/wikibase/entityChangers/LabelsChanger.js M view/resources/wikibase/wikibase.RevisionStore.js 3 files changed, 11 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/85/260585/1 diff --git a/view/resources/wikibase/entityChangers/DescriptionsChanger.js b/view/resources/wikibase/entityChangers/DescriptionsChanger.js index 3c73bd9..162de1d 100644 --- a/view/resources/wikibase/entityChangers/DescriptionsChanger.js +++ b/view/resources/wikibase/entityChangers/DescriptionsChanger.js @@ -48,7 +48,7 @@ this._api.setDescription( this._entity.getId(), - this._revisionStore.getDescriptionRevision(), + this._revisionStore.getBaseRevision(), description.getText(), language ) @@ -56,7 +56,7 @@ var savedDescription = result.entity.descriptions[language].value; // Update revision store: - self._revisionStore.setDescriptionRevision( result.entity.lastrevid ); + self._revisionStore.setBaseRevision( result.entity.lastrevid ); // FIXME: Maybe check API's return value? diff --git a/view/resources/wikibase/entityChangers/LabelsChanger.js b/view/resources/wikibase/entityChangers/LabelsChanger.js index f1d6b96..2d08332 100644 --- a/view/resources/wikibase/entityChangers/LabelsChanger.js +++ b/view/resources/wikibase/entityChangers/LabelsChanger.js @@ -48,7 +48,7 @@ this._api.setLabel( this._entity.getId(), - this._revisionStore.getLabelRevision(), + this._revisionStore.getBaseRevision(), label.getText(), language ) @@ -56,7 +56,7 @@ var savedLabel = result.entity.labels[language].value; // Update revision store: - self._revisionStore.setLabelRevision( result.entity.lastrevid ); + self._revisionStore.setBaseRevision( result.entity.lastrevid ); // FIXME: Maybe check API's return value? diff --git a/view/resources/wikibase/wikibase.RevisionStore.js b/view/resources/wikibase/wikibase.RevisionStore.js index 5f2bc7e..d464892 100644 --- a/view/resources/wikibase/wikibase.RevisionStore.js +++ b/view/resources/wikibase/wikibase.RevisionStore.js @@ -74,6 +74,13 @@ }, /** +* Saves the base revision id +*/ + setBaseRevision: function( rev ) { + this._revisions.baseRevision = rev; + }, + + /** * Saves the label revision id. */ setLabelRevision: function( rev ) { -- To view, visit https://gerrit.wikimedia.org/r/260585 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie37188862505e4c363650e434f092b44bc678143 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update autoload.php - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260337 Change subject: Update autoload.php .. Update autoload.php with new classes introduced in I9518a52 Change-Id: I971a4a0c4e2cceff67072398960321c1a5dbf549 --- M autoload.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/37/260337/1 diff --git a/autoload.php b/autoload.php index f546201..8c5ec81 100644 --- a/autoload.php +++ b/autoload.php @@ -329,6 +329,7 @@ 'DeletedContributionsPage' => __DIR__ . '/includes/specials/SpecialDeletedContributions.php', 'DependencyWrapper' => __DIR__ . '/includes/cache/CacheDependency.php', 'DeprecatedGlobal' => __DIR__ . '/includes/DeprecatedGlobal.php', + 'DeprecatedInterfaceFinder' => __DIR__ . '/maintenance/findDeprecated.php', 'DerivativeContext' => __DIR__ . '/includes/context/DerivativeContext.php', 'DerivativeRequest' => __DIR__ . '/includes/WebRequest.php', 'DerivativeResourceLoaderContext' => __DIR__ . '/includes/resourceloader/DerivativeResourceLoaderContext.php', @@ -423,6 +424,7 @@ 'FewestrevisionsPage' => __DIR__ . '/includes/specials/SpecialFewestrevisions.php', 'Field' => __DIR__ . '/includes/db/DatabaseUtility.php', 'File' => __DIR__ . '/includes/filerepo/file/File.php', + 'FileAwareNodeVisitor' => __DIR__ . '/maintenance/findDeprecated.php', 'FileBackend' => __DIR__ . '/includes/filebackend/FileBackend.php', 'FileBackendDBRepoWrapper' => __DIR__ . '/includes/filerepo/FileBackendDBRepoWrapper.php', 'FileBackendError' => __DIR__ . '/includes/filebackend/FileBackend.php', @@ -445,6 +447,7 @@ 'FileOpBatch' => __DIR__ . '/includes/filebackend/FileOpBatch.php', 'FileRepo' => __DIR__ . '/includes/filerepo/FileRepo.php', 'FileRepoStatus' => __DIR__ . '/includes/filerepo/FileRepoStatus.php', + 'FindDeprecated' => __DIR__ . '/maintenance/findDeprecated.php', 'FindHooks' => __DIR__ . '/maintenance/findHooks.php', 'FindMissingFiles' => __DIR__ . '/maintenance/findMissingFiles.php', 'FindOrphanedFiles' => __DIR__ . '/maintenance/findOrphanedFiles.php', -- To view, visit https://gerrit.wikimedia.org/r/260337 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I971a4a0c4e2cceff67072398960321c1a5dbf549 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Simplify generation of test items for term conflict tests - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260239 Change subject: Simplify generation of test items for term conflict tests .. Simplify generation of test items for term conflict tests Change-Id: I1d13970847bbdb3659ce33040236bea8cba8c2e0 --- M lib/tests/phpunit/store/TermIndexTest.php 1 file changed, 16 insertions(+), 27 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/39/260239/2 diff --git a/lib/tests/phpunit/store/TermIndexTest.php b/lib/tests/phpunit/store/TermIndexTest.php index 45e14f0..9592e74 100644 --- a/lib/tests/phpunit/store/TermIndexTest.php +++ b/lib/tests/phpunit/store/TermIndexTest.php @@ -500,25 +500,13 @@ } private function getTermConflictEntities() { - $deFooBar1 = new Item( new ItemId( 'Q1' ) ); - $deFooBar1->setLabel( 'de', 'Foo' ); - $deFooBar1->setDescription( 'de', 'Bar' ); - - $deBarFoo2 = new Item( new ItemId( 'Q2' ) ); - $deBarFoo2->setLabel( 'de', 'Bar' ); - $deBarFoo2->setDescription( 'de', 'Foo' ); - - $enFooBar3 = new Item( new ItemId( 'Q3' ) ); - $enFooBar3->setLabel( 'en', 'Foo' ); - $enFooBar3->setDescription( 'en', 'Bar' ); - - $enBarFoo4 = new Item( new ItemId( 'Q4' ) ); - $enBarFoo4->setLabel( 'en', 'Bar' ); - $enBarFoo4->setDescription( 'en', 'Foo' ); - - $deFooQuux5 = new Item( new ItemId( 'Q5' ) ); - $deFooQuux5->setLabel( 'de', 'Foo' ); - $deFooQuux5->setDescription( 'de', 'Quux' ); + $entities = array( + $this->makeTermConflictItem( 'Q1', 'de', 'Foo', 'Bar' ), + $this->makeTermConflictItem( 'Q2', 'de', 'Bar', 'Foo' ), + $this->makeTermConflictItem( 'Q3', 'en', 'Foo', 'Bar' ), + $this->makeTermConflictItem( 'Q4', 'en', 'Bar', 'Foo' ), + $this->makeTermConflictItem( 'Q5', 'de', 'Foo', 'Quux' ) + ); $deFooBarP6 = Property::newFromType( 'string' ); $deFooBarP6->setId( new PropertyId( 'P6' ) ); @@ -526,18 +514,19 @@ $deFooBarP6->setAliases( 'de', array( 'AFoo' ) ); $deFooBarP6->setDescription( 'de', 'Bar' ); - $entities = array( - $deFooBar1, - $deBarFoo2, - $enFooBar3, - $enBarFoo4, - $deFooQuux5, - $deFooBarP6, - ); + $entities[] = $deFooBarP6; return $entities; } + private function makeTermConflictItem( $id, $languageCode, $label, $description ) { + $item = new Item( new ItemId( $id ) ); + $item->setLabel( $languageCode, $label ); + $item->setDescription( $languageCode, $description ); + + return $item; + } + public function labelConflictProvider() { $entities = $this->getTermConflictEntities(); -- To view, visit https://gerrit.wikimedia.org/r/260239 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1d13970847bbdb3659ce33040236bea8cba8c2e0 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move TermSqlIndexTest to lib (where TermSqlIndex is) - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260238 Change subject: Move TermSqlIndexTest to lib (where TermSqlIndex is) .. Move TermSqlIndexTest to lib (where TermSqlIndex is) Change-Id: I179e95e28d8e1456d96fc5b674da17cbbd64afe8 --- R lib/tests/phpunit/store/Sql/TermSqlIndexTest.php 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/38/260238/2 diff --git a/repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php b/lib/tests/phpunit/store/Sql/TermSqlIndexTest.php similarity index 96% rename from repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php rename to lib/tests/phpunit/store/Sql/TermSqlIndexTest.php index 27e7882..ccf1581 100644 --- a/repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php +++ b/lib/tests/phpunit/store/Sql/TermSqlIndexTest.php @@ -17,7 +17,7 @@ * @covers Wikibase\TermSqlIndex * * @group Wikibase - * @group WikibaseRepo + * @group WikibaseLib * @group WikibaseStore * @group Database * @@ -31,6 +31,11 @@ protected function setUp() { parent::setUp(); + if ( !defined( 'WB_VERSION' ) ) { + $this->markTestSkipped( "Skipping because a local wb_terms table" + . " is not available on a WikibaseClient only instance." ); + } + $this->tablesUsed[] = 'wb_terms'; } -- To view, visit https://gerrit.wikimedia.org/r/260238 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I179e95e28d8e1456d96fc5b674da17cbbd64afe8 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move ApiQueryGeneratorBase to it's own file - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/260236 Change subject: Move ApiQueryGeneratorBase to it's own file .. Move ApiQueryGeneratorBase to it's own file Change-Id: Ia8e9ab256c8a7a72bb407090f7a4a49484e529e4 --- M autoload.php M includes/api/ApiQueryBase.php A includes/api/ApiQueryGeneratorBase.php 3 files changed, 104 insertions(+), 79 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/36/260236/1 diff --git a/autoload.php b/autoload.php index dea31ab..1387ebd 100644 --- a/autoload.php +++ b/autoload.php @@ -90,7 +90,7 @@ 'ApiQueryExternalLinks' => __DIR__ . '/includes/api/ApiQueryExternalLinks.php', 'ApiQueryFileRepoInfo' => __DIR__ . '/includes/api/ApiQueryFileRepoInfo.php', 'ApiQueryFilearchive' => __DIR__ . '/includes/api/ApiQueryFilearchive.php', - 'ApiQueryGeneratorBase' => __DIR__ . '/includes/api/ApiQueryBase.php', + 'ApiQueryGeneratorBase' => __DIR__ . '/includes/api/ApiQueryGeneratorBase.php', 'ApiQueryIWBacklinks' => __DIR__ . '/includes/api/ApiQueryIWBacklinks.php', 'ApiQueryIWLinks' => __DIR__ . '/includes/api/ApiQueryIWLinks.php', 'ApiQueryImageInfo' => __DIR__ . '/includes/api/ApiQueryImageInfo.php', diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index 01968c2..ad92e53 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -682,81 +682,3 @@ /**@}*/ } - -/** - * @ingroup API - */ -abstract class ApiQueryGeneratorBase extends ApiQueryBase { - - private $mGeneratorPageSet = null; - - /** -* Switch this module to generator mode. By default, generator mode is -* switched off and the module acts like a normal query module. -* @since 1.21 requires pageset parameter -* @param ApiPageSet $generatorPageSet ApiPageSet object that the module will get -*by calling getPageSet() when in generator mode. -*/ - public function setGeneratorMode( ApiPageSet $generatorPageSet ) { - if ( $generatorPageSet === null ) { - ApiBase::dieDebug( __METHOD__, 'Required parameter missing - $generatorPageSet' ); - } - $this->mGeneratorPageSet = $generatorPageSet; - } - - /** -* Get the PageSet object to work on. -* If this module is generator, the pageSet object is different from other module's -* @return ApiPageSet -*/ - protected function getPageSet() { - if ( $this->mGeneratorPageSet !== null ) { - return $this->mGeneratorPageSet; - } - - return parent::getPageSet(); - } - - /** -* Overrides ApiBase to prepend 'g' to every generator parameter -* @param string $paramName Parameter name -* @return string Prefixed parameter name -*/ - public function encodeParamName( $paramName ) { - if ( $this->mGeneratorPageSet !== null ) { - return 'g' . parent::encodeParamName( $paramName ); - } else { - return parent::encodeParamName( $paramName ); - } - } - - /** -* Overridden to set the generator param if in generator mode -* @param string $paramName Parameter name -* @param string|array $paramValue Parameter value -*/ - protected function setContinueEnumParameter( $paramName, $paramValue ) { - if ( $this->mGeneratorPageSet !== null ) { - $this->getContinuationManager()->addGeneratorContinueParam( $this, $paramName, $paramValue ); - } else { - parent::setContinueEnumParameter( $paramName, $paramValue ); - } - } - - /** -* @see ApiBase::getHelpFlags() -* -* Corresponding messages: api-help-flag-generator -*/ - protected function getHelpFlags() { - $flags = parent::getHelpFlags(); - $flags[] = 'generator'; - return $flags; - } - - /** -* Execute this module as a generator -* @param ApiPageSet $resultPageSet All output should be appended to this object -*/ - abstract public function executeGenerator( $resultPageSet ); -} diff --git a/includes/api/ApiQueryGeneratorBase.php b/includes/api/ApiQueryGeneratorBase.php new file mode 100644 index 000..67fe0d6 --- /dev/null +++ b/includes/api/ApiQueryGeneratorBase.php @@ -0,0 +1,103 @@ +@gmail.com" + * + * 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
[MediaWiki-commits] [Gerrit] Enable Wikidata data access for meta-wiki - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/259218 Change subject: Enable Wikidata data access for meta-wiki .. Enable Wikidata data access for meta-wiki Bug: T117524 Change-Id: I79fafa8ed23b27a685f8fa91ec810164e924abce --- M dblists/arbitraryaccess.dblist M wmf-config/InitialiseSettings-labs.php M wmf-config/InitialiseSettings.php 3 files changed, 1 insertion(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/18/259218/1 diff --git a/dblists/arbitraryaccess.dblist b/dblists/arbitraryaccess.dblist index ebf2466..b04844d 100644 --- a/dblists/arbitraryaccess.dblist +++ b/dblists/arbitraryaccess.dblist @@ -342,6 +342,7 @@ map_bmswiki mdfwiki mediawikiwiki +metawiki mgwiki mgwikibooks mhrwiki diff --git a/wmf-config/InitialiseSettings-labs.php b/wmf-config/InitialiseSettings-labs.php index 6d4ddba..39d64de 100644 --- a/wmf-config/InitialiseSettings-labs.php +++ b/wmf-config/InitialiseSettings-labs.php @@ -563,14 +563,5 @@ 'default' => true, 'private' => false, ), - 'wmgWikibaseEnableArbitraryAccess' => array( - 'default' => false, - 'metawiki' => true, - 'arbitraryaccess' => true, - ), - 'wmgWikibaseEnableData' => array( - 'default' => true, - 'metawiki' => true, - ), ); } # wmflLabsSettings() diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index e9682ff..40de5fc 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -15190,7 +15190,6 @@ 'wmgWikibaseEnableData' => array( 'default' => true, - 'metawiki' => false, ), 'wmgWikibaseEnableArbitraryAccess' => array( -- To view, visit https://gerrit.wikimedia.org/r/259218 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79fafa8ed23b27a685f8fa91ec810164e924abce Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add option to export specific site definition - change (mediawiki/core)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/259198 Change subject: Add option to export specific site definition .. Add option to export specific site definition in exportSites.php maintenance script. Change-Id: I7461fea704d300c54605a7490cfbe173df91e3e3 --- M maintenance/exportSites.php 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/98/259198/1 diff --git a/maintenance/exportSites.php b/maintenance/exportSites.php index 145c924..662c951 100644 --- a/maintenance/exportSites.php +++ b/maintenance/exportSites.php @@ -17,6 +17,7 @@ public function __construct() { $this->mDescription = 'Exports site definitions the sites table to XML file'; + $this->addOption( 'site', 'Site to export', false, true ); $this->addArg( 'file', 'A file to write the XML to (see docs/sitelist.txt). ' . 'Use "php://stdout" to write to stdout.', true ); @@ -43,6 +44,16 @@ $exporter = new SiteExporter( $handle ); $sites = SiteSQLStore::newInstance()->getSites( 'recache' ); + $site = $this->getOption( 'site', null ); + + if ( is_string( $site ) ) { + $site = $sites->getSite( $site ); + + if ( $site ) { + $sites = new SiteList( array( $site ) ); + } + } + $exporter->exportSites( $sites ); fclose( $handle ); -- To view, visit https://gerrit.wikimedia.org/r/259198 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7461fea704d300c54605a7490cfbe173df91e3e3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set formatterUrlProperty setting for Wikibase - change (operations/mediawiki-config)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/258968 Change subject: Set formatterUrlProperty setting for Wikibase .. Set formatterUrlProperty setting for Wikibase adds the setting for beta wikidata, test wikidata and the real wikidata. Bug: T121382 Change-Id: I1600266233b481fd1d3e19390cb8d56c41a89a98 --- M wmf-config/Wikibase-labs.php M wmf-config/Wikibase-production.php 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/68/258968/1 diff --git a/wmf-config/Wikibase-labs.php b/wmf-config/Wikibase-labs.php index 65114c2..95dee64 100644 --- a/wmf-config/Wikibase-labs.php +++ b/wmf-config/Wikibase-labs.php @@ -1,6 +1,8 @@ 'wb-badge-goodarticle', 'Q49447' => 'wb-badge-featuredarticle', diff --git a/wmf-config/Wikibase-production.php b/wmf-config/Wikibase-production.php index 135575f..b664d44 100644 --- a/wmf-config/Wikibase-production.php +++ b/wmf-config/Wikibase-production.php @@ -2,6 +2,8 @@ if ( $wmgUseWikibaseRepo ) { if ( $wgDBname === 'testwikidatawiki' ) { + $wgWBRepoSettings['formatterUrlProperty'] = 'P368'; + $wgWBRepoSettings['badgeItems'] = array( 'Q608' => 'wb-badge-goodarticle', 'Q609' => 'wb-badge-featuredarticle' @@ -22,6 +24,8 @@ 'P185', ); } else { + $wgWBRepoSettings['formatterUrlProperty'] = 'P1630'; + $wgWBRepoSettings['badgeItems'] = array( 'Q17437798' => 'wb-badge-goodarticle', 'Q17437796' => 'wb-badge-featuredarticle', -- To view, visit https://gerrit.wikimedia.org/r/258968 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1600266233b481fd1d3e19390cb8d56c41a89a98 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use LabelDescriptionLookup in LanguageLinkBadgeDisplay - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/257628 Change subject: Use LabelDescriptionLookup in LanguageLinkBadgeDisplay .. Use LabelDescriptionLookup in LanguageLinkBadgeDisplay instead of loading entities to get labels. Bug: T120838 Change-Id: I9ec47a2649ac326eefc3707ea3c4257adc079dea --- M client/includes/Hooks/LanguageLinkBadgeDisplay.php M client/includes/Hooks/SidebarHookHandlers.php M client/includes/WikibaseClient.php M client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php M client/tests/phpunit/includes/Hooks/ParserOutputUpdateHookHandlersTest.php M client/tests/phpunit/includes/Hooks/SidebarHookHandlersTest.php 6 files changed, 81 insertions(+), 91 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/28/257628/1 diff --git a/client/includes/Hooks/LanguageLinkBadgeDisplay.php b/client/includes/Hooks/LanguageLinkBadgeDisplay.php index 0a9240e..8acfbe1 100644 --- a/client/includes/Hooks/LanguageLinkBadgeDisplay.php +++ b/client/includes/Hooks/LanguageLinkBadgeDisplay.php @@ -8,7 +8,8 @@ use Sanitizer; use Title; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\DataModel\Services\Lookup\EntityLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; +use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookupException; use Wikibase\DataModel\SiteLink; /** @@ -24,9 +25,9 @@ class LanguageLinkBadgeDisplay { /** -* @var EntityLookup +* @var LabelDescriptionLookup; */ - protected $entityLookup; + protected $labelDescriptionLookup; /** * @var array @@ -39,12 +40,16 @@ protected $language; /** -* @param EntityLookup $entityLookup +* @param LabelDescriptionLookup $labelDescriptionLookup * @param array $badgeClassNames * @param Language $language */ - public function __construct( EntityLookup $entityLookup, array $badgeClassNames, Language $language ) { - $this->entityLookup = $entityLookup; + public function __construct( + LabelDescriptionLookup $labelDescriptionLookup, + array $badgeClassNames, + Language $language + ) { + $this->labelDescriptionLookup = $labelDescriptionLookup; $this->badgeClassNames = $badgeClassNames; $this->language = $language; } @@ -119,19 +124,19 @@ * added to the link's title attribute, so the can be effectively ignored * on this client wiki. * -* @param ItemId[] $badges +* @param ItemId[] $badgesIds * * @return array An associative array with the keys 'class' and 'itemtitle' with assigned * string values. These fields correspond to the fields in the description array for language * links used by the SkinTemplateGetLanguageLink hook and expected by the applyBadges() * function. */ - private function getBadgeInfo( array $badges ) { + private function getBadgeInfo( array $badgeIds ) { $classes = array(); $labels = array(); - foreach ( $badges as $badge ) { - $badgeSerialization = $badge->getSerialization(); + foreach ( $badgeIds as $badgeId ) { + $badgeSerialization = $badgeId->getSerialization(); $classes[] = 'badge-' . Sanitizer::escapeClass( $badgeSerialization ); // nicer classes for well known badges @@ -140,7 +145,7 @@ $classes[] = Sanitizer::escapeClass( $this->badgeClassNames[$badgeSerialization] ); // add label (but only if this badge is well known on this wiki) - $label = $this->getLabel( $badge ); + $label = $this->getLabel( $badgeId ); if ( $label !== null ) { $labels[] = $label; @@ -159,21 +164,22 @@ /** * Returns the label for the given badge. * -* @param ItemId $badge +* @param ItemId $badgeId * * @return string|null */ - private function getLabel( ItemId $badge ) { - $entity = $this->entityLookup->getEntity( $badge ); - if ( !$entity ) { + private function getLabel( ItemId $badgeId ) { + try { + $term = $this->labelDescriptionLookup->getLabel( $badgeId ); + } catch ( LabelDescriptionLookupException $ex ) { return null; } - $title = $entity->getLabel( $this->language->getCode() ); - if ( !$title ) { - return nul