WikidataBuilder has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/383095 )
Change subject: New Wikidata Build - 2017-10-09T10:00:02+0000 ...................................................................... New Wikidata Build - 2017-10-09T10:00:02+0000 Change-Id: Ifc2832afc9f4719099d2a62cd38d083911aa2d4a --- M composer.lock M extensions/Wikibase/client/config/WikibaseClient.default.php M extensions/Wikibase/client/config/WikibaseClient.example.php M extensions/Wikibase/client/includes/Changes/ChangeHandler.php M extensions/Wikibase/client/includes/WikibaseClient.php M extensions/Wikibase/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php M extensions/Wikibase/docs/options.wiki M vendor/composer/installed.json 8 files changed, 32 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata refs/changes/95/383095/1 diff --git a/composer.lock b/composer.lock index f41eebb..844b4e8 100644 --- a/composer.lock +++ b/composer.lock @@ -1548,12 +1548,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git", - "reference": "fcb36fe5997a14536ac696a252fd073233506d57" + "reference": "96e331637209ee498b2ef2f1dd964324511577ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/fcb36fe5997a14536ac696a252fd073233506d57", - "reference": "fcb36fe5997a14536ac696a252fd073233506d57", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/96e331637209ee498b2ef2f1dd964324511577ee", + "reference": "96e331637209ee498b2ef2f1dd964324511577ee", "shasum": "" }, "require": { @@ -1631,7 +1631,7 @@ "wikibaserepo", "wikidata" ], - "time": "2017-10-07 13:00:31" + "time": "2017-10-07 18:12:27" }, { "name": "wikibase/wikimedia-badges", diff --git a/extensions/Wikibase/client/config/WikibaseClient.default.php b/extensions/Wikibase/client/config/WikibaseClient.default.php index f0df283..c8943de 100644 --- a/extensions/Wikibase/client/config/WikibaseClient.default.php +++ b/extensions/Wikibase/client/config/WikibaseClient.default.php @@ -25,6 +25,7 @@ // but we will need to make sure the caching works good enough 'siteLocalID' => $wgLanguageCode, 'languageLinkSiteGroup' => null, + 'injectRecentChanges' => true, 'showExternalRecentChanges' => true, 'sendEchoNotification' => false, 'echoIcon' => false, diff --git a/extensions/Wikibase/client/config/WikibaseClient.example.php b/extensions/Wikibase/client/config/WikibaseClient.example.php index 03f0878..7a5b509 100644 --- a/extensions/Wikibase/client/config/WikibaseClient.example.php +++ b/extensions/Wikibase/client/config/WikibaseClient.example.php @@ -20,6 +20,7 @@ // Defaults to $wgDBname. // $wgWBClientSettings['siteGlobalID'] = "mywiki"; +$wgWBClientSettings['injectRecentChanges'] = true; $wgWBClientSettings['showExternalRecentChanges'] = true; // If this wiki also runs the Wikibase repo extension, diff --git a/extensions/Wikibase/client/includes/Changes/ChangeHandler.php b/extensions/Wikibase/client/includes/Changes/ChangeHandler.php index d14fb8a..9a36677 100644 --- a/extensions/Wikibase/client/includes/Changes/ChangeHandler.php +++ b/extensions/Wikibase/client/includes/Changes/ChangeHandler.php @@ -50,11 +50,17 @@ private $siteLookup; /** + * @var bool + */ + private $injectRecentChanges; + + /** * @param AffectedPagesFinder $affectedPagesFinder * @param TitleFactory $titleFactory * @param PageUpdater $updater * @param ChangeRunCoalescer $changeRunCoalescer * @param SiteLookup $siteLookup + * @param bool $injectRecentChanges * * @throws InvalidArgumentException */ @@ -63,13 +69,19 @@ TitleFactory $titleFactory, PageUpdater $updater, ChangeRunCoalescer $changeRunCoalescer, - SiteLookup $siteLookup + SiteLookup $siteLookup, + $injectRecentChanges = true ) { + if ( !is_bool( $injectRecentChanges ) ) { + throw new InvalidArgumentException( '$injectRecentChanges must be a bool' ); + } + $this->affectedPagesFinder = $affectedPagesFinder; $this->titleFactory = $titleFactory; $this->updater = $updater; $this->changeRunCoalescer = $changeRunCoalescer; $this->siteLookup = $siteLookup; + $this->injectRecentChanges = $injectRecentChanges; } /** @@ -129,7 +141,9 @@ // NOTE: signature depends on change ID, effectively disabling deduplication $changeSignature = $this->getChangeSignature( $change ); $rootJobParams['rootJobSignature'] = $titleBatchSignature . '&' . $changeSignature; - $this->updater->injectRCRecords( $titlesToUpdate, $change, $rootJobParams ); + if ( $this->injectRecentChanges ) { + $this->updater->injectRCRecords( $titlesToUpdate, $change, $rootJobParams ); + } } /** diff --git a/extensions/Wikibase/client/includes/WikibaseClient.php b/extensions/Wikibase/client/includes/WikibaseClient.php index 256042c..53d1a6a 100644 --- a/extensions/Wikibase/client/includes/WikibaseClient.php +++ b/extensions/Wikibase/client/includes/WikibaseClient.php @@ -1169,7 +1169,8 @@ new TitleFactory(), $pageUpdater, $changeListTransformer, - $this->siteLookup + $this->siteLookup, + $this->settings->getSetting( 'injectRecentChanges' ) ); } diff --git a/extensions/Wikibase/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php b/extensions/Wikibase/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php index 67b9858..7ab5082 100644 --- a/extensions/Wikibase/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php +++ b/extensions/Wikibase/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php @@ -79,7 +79,8 @@ $titleFactory, $updater ?: new MockPageUpdater(), $this->getChangeRunCoalescer(), - $this->getMock( SiteLookup::class ) + $this->getMock( SiteLookup::class ), + true ); return $handler; diff --git a/extensions/Wikibase/docs/options.wiki b/extensions/Wikibase/docs/options.wiki index 70959b6..e6d55c5 100644 --- a/extensions/Wikibase/docs/options.wiki +++ b/extensions/Wikibase/docs/options.wiki @@ -105,7 +105,8 @@ ;propertyOrderUrl: URL to use for retrieving the property order used for sorting properties by property ID. Will be ignored if set to null. === Expert Settings === -;showExternalRecentChanges: Whether changes on the repository should be displayed on Special:RecentChanges, Special:Watchlist, etc on the client wiki. +;injectRecentChanges: Whether changes on the repository should be injected into this wiki's recent changes table, so they show up on watchlists, etc. Requires the <code>dispatchChanges.php</code> script to run, and this wiki to be listed in the <code>localClientDatabases</code> setting on the repository. +;showExternalRecentChanges: Whether changes on the repository should be displayed on Special:RecentChanges, Special:Watchlist, etc on the client wiki. In contrast to <code>injectRecentChanges</code>, this setting just removes the changes from the user interface. The default is <code>false</code>. This is intended to temporarily prevent external changes from showing in order to find or fix some issue on a live site. ;sendEchoNotification: If true, allows users on the client wiki to get a notification when a page they created is connected to a repo item. This requires the Echo extension. ;echoIcon: If <code>sendEchoNotification</code> is set to <code>true</code>, you can also provide what icon the user will see. The correct syntax is <code>[ 'url' => '...' ]</code> or <code>[ 'path' => '...' ]</code> where <code>path</code> is relative to <code>$wgExtensionAssetsPath</code>. Defaults to <code>false</code> which means that there will be the default Echo icon. ;disabledUsageAspects: Array of usage aspects that should not be saved in the <code>wbc_entity_usage</code> table. This currently only supports aspect codes (like "T", "L" or "X"), but not full aspect keys (like "L.de"). diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 50f5d7e..fd1bb81 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1389,12 +1389,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git", - "reference": "fcb36fe5997a14536ac696a252fd073233506d57" + "reference": "96e331637209ee498b2ef2f1dd964324511577ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/fcb36fe5997a14536ac696a252fd073233506d57", - "reference": "fcb36fe5997a14536ac696a252fd073233506d57", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/96e331637209ee498b2ef2f1dd964324511577ee", + "reference": "96e331637209ee498b2ef2f1dd964324511577ee", "shasum": "" }, "require": { @@ -1429,7 +1429,7 @@ "mediawiki/minus-x": "0.1.0", "wikibase/wikibase-codesniffer": "^0.1.0" }, - "time": "2017-10-07 13:00:31", + "time": "2017-10-07 18:12:27", "type": "mediawiki-extension", "installation-source": "dist", "autoload": { -- To view, visit https://gerrit.wikimedia.org/r/383095 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifc2832afc9f4719099d2a62cd38d083911aa2d4a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikidata Gerrit-Branch: master Gerrit-Owner: WikidataBuilder <wikidata-servi...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits