Daniel Kinzler has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/370974 )
Change subject: Remove pointless showExternalRecentChanges option. ...................................................................... Remove pointless showExternalRecentChanges option. Change-Id: I67de8daf7fcdc3c27a2e6470ac25cc6b600c3802 --- M client/WikibaseClient.hooks.php M client/config/WikibaseClient.default.php M client/config/WikibaseClient.example.php M client/includes/Hooks/ChangesListSpecialPageHookHandlers.php M docs/options.wiki 5 files changed, 3 insertions(+), 58 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/74/370974/1 diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php index 4853c6d..f0d6458 100644 --- a/client/WikibaseClient.hooks.php +++ b/client/WikibaseClient.hooks.php @@ -252,10 +252,6 @@ public static function onGetPreferences( User $user, array &$prefs ) { $settings = WikibaseClient::getDefaultInstance()->getSettings(); - if ( !$settings->getSetting( 'showExternalRecentChanges' ) ) { - return true; - } - $prefs['rcshowwikidata'] = [ 'type' => 'toggle', 'label-message' => 'wikibase-rc-show-wikidata-pref', diff --git a/client/config/WikibaseClient.default.php b/client/config/WikibaseClient.default.php index 29b8098..023acfe 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, - 'showExternalRecentChanges' => true, 'sendEchoNotification' => false, 'echoIcon' => false, 'allowDataTransclusion' => true, diff --git a/client/config/WikibaseClient.example.php b/client/config/WikibaseClient.example.php index 07d4489..03f2cfe 100644 --- a/client/config/WikibaseClient.example.php +++ b/client/config/WikibaseClient.example.php @@ -20,8 +20,6 @@ // Defaults to $wgDBname. // $wgWBClientSettings['siteGlobalID'] = "mywiki"; -$wgWBClientSettings['showExternalRecentChanges'] = true; - // If this wiki also runs the Wikibase repo extension, // use the automatic defaults for repo-related settings. // If this wiki isn't running the repo extension, diff --git a/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php b/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php index 26ea3b9..ecfb0c4 100644 --- a/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php +++ b/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php @@ -44,11 +44,6 @@ private $pageName; /** - * @var bool - */ - private $showExternalChanges; - - /** * @var self */ private static $instance = null; @@ -58,20 +53,17 @@ * @param User $user * @param LoadBalancer $loadBalancer * @param string $pageName - * @param bool $showExternalChanges */ public function __construct( WebRequest $request, User $user, LoadBalancer $loadBalancer, - $pageName, - $showExternalChanges + $pageName ) { $this->request = $request; $this->user = $user; $this->loadBalancer = $loadBalancer; $this->pageName = $pageName; - $this->showExternalChanges = $showExternalChanges; } /** @@ -92,8 +84,7 @@ $context->getRequest(), $context->getUser(), MediaWikiServices::getInstance()->getDBLoadBalancer(), - $specialPageName, - $settings->getSetting( 'showExternalRecentChanges' ) + $specialPageName ); } @@ -162,40 +153,9 @@ $specialPageName ); - $hookHandler->addWikibaseConditionsIfFilterUnavailable( $conds ); + // FIXME: now the hook hander is unused - can this entire method go away? return true; - } - - // This is separate so hasWikibaseChangesEnabled can be mocked - - /** - * This is used to force-hide Wikibase changes if hasWikibaseChangesEnabled returns - * false. The user will not even see the option in that case. - * - * @param array &$conds - */ - protected function addWikibaseConditionsIfFilterUnavailable( array &$conds ) { - if ( !$this->hasWikibaseChangesEnabled() ) { - // Force-hide if hasWikibaseChangesEnabled is false - // The user-facing hideWikibase is handled by - // ChangesListSpecialPageStructuredFilters and connected code. - $this->addWikibaseConditions( - $this->loadBalancer->getConnection( DB_REPLICA ), - $conds - ); - } - } - - public function addFilterIfEnabled( ChangesListSpecialPage $specialPage ) { - // The *user-facing* filter is only registered if external changes - // are enabled. - // - // If the user-facing filter is not registered, it's always *hidden*. - // (See ChangesListSpecialPageQuery). - if ( $this->hasWikibaseChangesEnabled() ) { - $this->addFilter( $specialPage ); - } } protected function addFilter( ChangesListSpecialPage $specialPage ) { @@ -263,13 +223,6 @@ */ public function addWikibaseConditions( IDatabase $dbr, array &$conds ) { $conds[] = 'rc_source != ' . $dbr->addQuotes( RecentChangeFactory::SRC_WIKIBASE ); - } - - /** - * @return bool - */ - protected function hasWikibaseChangesEnabled() { - return $this->showExternalChanges; } /** diff --git a/docs/options.wiki b/docs/options.wiki index 3e8a570..6660f4a 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 === -;showExternalRecentChanges: Whether changes on the repository should be displayed on Special:RecentChanges, Special:Watchlist, etc on the client wiki. ;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/370974 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67de8daf7fcdc3c27a2e6470ac25cc6b600c3802 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Daniel Kinzler <daniel.kinz...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits