Hoo man has uploaded a new change for review.

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

Change subject: Support null as last parameter for the SpecialWatchlistQuery 
hook
......................................................................

Support null as last parameter for the SpecialWatchlistQuery hook

SpecialMobileWatchlist does this...

Bug: 63087
Change-Id: Id057da66f94a806f0ff029b2d29a89e13950fab8
---
M client/WikibaseClient.hooks.php
M client/includes/hooks/SpecialWatchlistQueryHandler.php
2 files changed, 8 insertions(+), 4 deletions(-)


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

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 6d1e9bd..38912f4 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -309,12 +309,12 @@
         * @param array &$tables
         * @param array &$join_conds
         * @param array &$fields
-        * @param array|FormOptions $opts array until MW 1.22, FormOptions 
since MW 1.23
+        * @param FormOptions|null $opts
         *
         * @return bool
         */
        public static function onSpecialWatchlistQuery( array &$conds, array 
&$tables,
-               array &$join_conds, array &$fields, $opts = array()
+               array &$join_conds, array &$fields, $opts
        ) {
                $db = wfGetDB( DB_SLAVE );
                $handler = new SpecialWatchlistQueryHandler( 
$GLOBALS['wgUser'], $db );
diff --git a/client/includes/hooks/SpecialWatchlistQueryHandler.php 
b/client/includes/hooks/SpecialWatchlistQueryHandler.php
index 02ce7fa..34e6316 100644
--- a/client/includes/hooks/SpecialWatchlistQueryHandler.php
+++ b/client/includes/hooks/SpecialWatchlistQueryHandler.php
@@ -41,14 +41,18 @@
        /**
         * @param WebRequest $request
         * @param array $conds
-        * @param FormOptions $opts
+        * @param FormOptions|null $opts
         *
         * @return array
         */
        public function addWikibaseConditions( WebRequest $request, array 
$conds, $opts ) {
                // do not include wikibase changes for activated enhanced 
watchlist
                // since we do not support that format yet
-               if ( $this->isEnhancedChangesEnabled( $request ) === true || 
$opts->getValue( 'hideWikibase' ) === true ) {
+               if (
+                       $this->isEnhancedChangesEnabled( $request ) === true ||
+                       !$opts ||
+                       $opts->getValue( 'hideWikibase' ) === true
+               ) {
                        $newConds = $this->makeHideWikibaseConds( $conds );
                } else {
                        $newConds = $this->makeShowWikibaseConds( $conds );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id057da66f94a806f0ff029b2d29a89e13950fab8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <h...@online.de>

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

Reply via email to