Ladsgroup has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370998 )

Change subject: Remove redundant attributes in ChangeHandler
......................................................................

Remove redundant attributes in ChangeHandler

Change-Id: I4844c5f8c88dbf1310dd4f7eb585c6c51fc9e537
---
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, 3 insertions(+), 28 deletions(-)


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

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

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4844c5f8c88dbf1310dd4f7eb585c6c51fc9e537
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgr...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to