Hello Daniel Kinzler, Aude, Addshore, jenkins-bot, Thiemo Mättig (WMDE),

I'd like you to do a code review.  Please visit

    https://gerrit.wikimedia.org/r/382989

to review the following change.


Change subject: Revert "remove unused injectrecentChanges option"
......................................................................

Revert "remove unused injectrecentChanges option"

This reverts commit cb9cdd33f7414b74eb54c1c2ee59d1004f98aff0.

Change-Id: I3e68bfc818238037f82eaafc6e8db10bf200013f
---
M client/config/WikibaseClient.default.php
M client/config/WikibaseClient.example.php
M client/includes/Changes/ChangeHandler.php
M client/includes/WikibaseClient.php
M client/tests/phpunit/includes/Changes/ChangeHandlerTest.php
M docs/options.wiki
6 files changed, 30 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/89/382989/1

diff --git a/client/config/WikibaseClient.default.php 
b/client/config/WikibaseClient.default.php
index 29b8098..0f233c3 100644
--- a/client/config/WikibaseClient.default.php
+++ b/client/config/WikibaseClient.default.php
@@ -24,6 +24,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/client/config/WikibaseClient.example.php 
b/client/config/WikibaseClient.example.php
index 07d4489..27469f0 100644
--- a/client/config/WikibaseClient.example.php
+++ b/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/client/includes/Changes/ChangeHandler.php 
b/client/includes/Changes/ChangeHandler.php
index 3c65800..58dc2ec 100644
--- a/client/includes/Changes/ChangeHandler.php
+++ b/client/includes/Changes/ChangeHandler.php
@@ -50,11 +50,23 @@
        private $siteLookup;
 
        /**
+        * @var string
+        */
+       private $repoId;
+
+       /**
+        * @var bool
+        */
+       private $injectRecentChanges;
+
+       /**
         * @param AffectedPagesFinder $affectedPagesFinder
         * @param TitleFactory $titleFactory
         * @param PageUpdater $updater
         * @param ChangeRunCoalescer $changeRunCoalescer
         * @param SiteLookup $siteLookup
+        * @param string $repoId
+        * @param bool $injectRecentChanges
         *
         * @throws InvalidArgumentException
         */
@@ -63,13 +75,21 @@
                TitleFactory $titleFactory,
                PageUpdater $updater,
                ChangeRunCoalescer $changeRunCoalescer,
-               SiteLookup $siteLookup
+               SiteLookup $siteLookup,
+               $repoId,
+               $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->repoId = $repoId;
+               $this->injectRecentChanges = $injectRecentChanges;
        }
 
        /**
diff --git a/client/includes/WikibaseClient.php 
b/client/includes/WikibaseClient.php
index 8a250dc..164f09f 100644
--- a/client/includes/WikibaseClient.php
+++ b/client/includes/WikibaseClient.php
@@ -1199,7 +1199,8 @@
                        new TitleFactory(),
                        $pageUpdater,
                        $changeListTransformer,
-                       $this->siteLookup
+                       $this->siteLookup,
+                       $this->settings->getSetting( 'injectRecentChanges' )
                );
        }
 
diff --git a/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php 
b/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php
index 5857711..a3dc146 100644
--- a/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php
+++ b/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php
@@ -78,7 +78,9 @@
                        $titleFactory,
                        $updater ?: new MockPageUpdater(),
                        $this->getChangeRunCoalescer(),
-                       $this->getMock( SiteLookup::class )
+                       $this->getMock( SiteLookup::class ),
+                       'repowiki',
+                       true
                );
 
                return $handler;
diff --git a/docs/options.wiki b/docs/options.wiki
index 3e8a570..f1905ca 100644
--- a/docs/options.wiki
+++ b/docs/options.wiki
@@ -106,7 +106,8 @@
 :;'prefixMapping': A prefix mapping array, see also: 
docs/foreign-entity-ids.wiki in the DataModel component.
 
 === 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").

-- 
To view, visit https://gerrit.wikimedia.org/r/382989
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e68bfc818238037f82eaafc6e8db10bf200013f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Reedy <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to